AnswerDotAI / AnswerDotAI/ghapi

HTTP Error 500: Internal Server Error when calling get_audit_log with "after" variable

Abierto
#101 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Python
Estrellas
686
Forks
69
Merge medio
1 min
PR fusionados (30 d)
2

Descripción

api.orgs.get_audit_log(ORG, per_page=10, page=2, after="2021-09-27T15:05:06+01:00")
// Here I'm using time format as per GHAPI rest docs. ghapi python docs suggest 2021-09-27 should work. Tried
// this and also timestamps, but all gave internal error.

If i remove the "after" variable, the call works fine.

I believe the problem is that the "after" variable is in [Link header format](api.orgs.get_audit_log(ORG, per_page=10, page=2, after="2021-09-27T15:05:06+01:00")) and perhaps this doesn't get autogenerated correctly.

Link: https://api.github.com/orgs/ORG/audit-log?after=MTYwMTkxOTU5NjQxM3xZbGI4VE5EZ1dvZTlla09uWjhoZFpR&before=; rel="next",

The value between after= and & does not completely URL + base64 decode to an obvious time format.

Signature:  
api.orgs.get_audit_log(
    org,
    phrase=None,
    include=None,
    after=None,
    before=None,
    order=None,
    per_page=None,
    page=None,
)
Type:        _GhVerb
String form:
orgs.get_audit_log(org, phrase=None, include=None, after=None, before=None, order=None, per_page=None, page=None)
https://docs.github.com/rest/reference/orgs#get-audit-log
File:        /opt/conda/lib/python3.9/site-packages/ghapi/core.py

I would expect any values in the signature to specify the time format required, possibly add an example to the docs, and the error should be something less severe than a 500 internal error.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza en /opt/conda/lib/python3.9/site-packages/ghapi/core.py y compara cómo get_audit_log construye la solicitud con y sin el argumento after. Consulta la documentación de la API de audit-log de GitHub y reproduce la llamada proporcionada usando los formatos de fecha y marca de tiempo documentados; se considera terminado cuando el formato compatible se gestiona correctamente o el valor no válido produce un error claro, con el formato esperado documentado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
github, python
Área
api
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.