RateLimitExceededException not raised when rate limit exceeds via making many PRs
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 7.8k
- Forks
- 1.9k
- Merge medio
- 17 min
- PR fusionados (30 d)
- 2
Descripción
When the rate limit is exceeded using by making too many PRs, the RateLimitExceededException is not raised, instead it is a GithubException. I would expect that it would be the rate limit exception, given it's a 403 and gives the rate limit exceeded exception:
403 {"documentation_url": "https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#secondary-rate-limits", "message": "You have exceeded a secondary rate limit. Please wait a few minutes before you try again."}
Example code:
def create_branch(repo, branch_name):
sb = repo.get_branch(repo.default_branch)
repo.create_git_ref(ref='refs/heads/' + branch_name, sha=sb.commit.sha)
def exceed():
for i in range(100):
repo = g.get_repo("mhoeger/test")
branch = f"mhoeger/test-branch-{time.time()}"
create_branch(repo, branch)
repo.create_file("test.txt", "TEST!", "hi", branch)
repo.create_pull("testing", "test", repo.default_branch, branch)
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza reproduciendo la respuesta de secondary-rate-limit con el ejemplo que crea ramas, archivos y pull requests repetidamente. Rastrea cómo el cliente de la API de GitHub maneja esta respuesta 403 y compáralo con el manejo de RateLimitExceededException. La tarea estará terminada cuando la respuesta documentada de secondary-rate-limit lance RateLimitExceededException en lugar de GithubException, con pruebas que cubran este comportamiento.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- github, python
- Área
- api, backend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100