Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#101 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
github, python
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu trong /opt/conda/lib/python3.9/site-packages/ghapi/core.py và so sánh cách get_audit_log xây dựng request khi có và không có đối số after. Kiểm tra tài liệu về GitHub audit-log API và tái hiện lệnh gọi được cung cấp bằng các định dạng ngày tháng và timestamp được tài liệu hóa; hoàn thành khi định dạng được hỗ trợ được xử lý chính xác hoặc giá trị không hợp lệ tạo ra lỗi rõ ràng, đồng thời định dạng mong đợi được tài liệu hóa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
687
Fork
69
Merge trung bình
1 phút
Pull request đã merge (30 ngày)
2

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AnswerDotAI/ghapi

Tất cả issue của AnswerDotAI/ghapi

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.