AnswerDotAI / AnswerDotAI/ghapi

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

Offen
#101 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
685
Forks
70
Ø Merge
1 Min.
Gemergte PRs (30 T.)
2

Beschreibung

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: ; 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne in /opt/conda/lib/python3.9/site-packages/ghapi/core.py und vergleiche, wie get_audit_log die Anfrage mit und ohne das Argument after erstellt. Prüfe die Dokumentation der GitHub audit-log API und reproduziere den bereitgestellten Aufruf unter Verwendung der dokumentierten Datums- und Zeitstempelformate; abgeschlossen ist die Aufgabe, wenn das unterstützte Format korrekt verarbeitet wird oder der ungültige Wert einen eindeutigen Fehler erzeugt und das erwartete Format dokumentiert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
github, python
Bereich
api
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.