Unnecessary API requests
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 7.8k
- Fork
- 1.9k
- Merge medio
- 17m
- PR unite (30g)
- 2
Descrizione
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?
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando le chiamate nell'esempio: repo.get_issue, issue.get_comment e comment.create_reaction, quindi verifica le richieste di rete effettive. Determina se il comportamento lazy può essere applicato a questi e ad altri metodi get, con test che confermino che le richieste GET non necessarie vengono evitate senza interrompere il flusso delle reazioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- github, python
- Ambito
- api
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100