Unnecessary API requests
オープン
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 7.8k
- フォーク
- 1.9k
- 平均マージ
- 17分
- マージ済み PR(30日)
- 2
説明
From my reading of the code, it seems that posting a Reaction to an Issue Comment results in two unnecessary get requests. I haven't been able to watch the actual network traffic to verify this though.
In the following example it looks like the two get requests will be mabe but are not needed.
# No API call because of lazy=True
repo = github.get_repo(repo_name, lazy=True)
# GET: /repos/{owner}/{repo}/issues/{id}
issue = repo.get_issue(number=issue_id)
# GET: /repos/{owner}/{repo}/issues/comments/{id}
comment = issue.get_comment(comment_id)
# POST: /repos/{owner}/{repo}/issues/comments/{id}/reactions
reaction = comment.create_reaction(reaction_type)
Is this right?
Can we add lazy to all get methods?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、例にある呼び出し repo.get_issue、issue.get_comment、comment.create_reaction を追跡し、実際のネットワークリクエストを確認します。これらやその他の get メソッドに遅延動作を適用できるかを判断し、不要な GET リクエストを避けつつリアクションのフローを壊さないことをテストで確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- github, python
- 領域
- api
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100