Skip to content

fix: add pagination, error handling, and modernize runtime#3

Open
peterkrauz wants to merge 1 commit into
masterfrom
improvements/reliability-and-modernization
Open

fix: add pagination, error handling, and modernize runtime#3
peterkrauz wants to merge 1 commit into
masterfrom
improvements/reliability-and-modernization

Conversation

@peterkrauz

Copy link
Copy Markdown
Owner

Summary

  • Paginate GitHub API responses — follows Link: rel="next" headers, fetching up to 1,000 comments (10 pages × 100). Previously only the first 30 were fetched, causing false negatives on active PRs.
  • Handle HTTP errors — raises with status code and response body excerpt instead of silently parsing error JSON as comment data.
  • Modernize runtime — Python 3.7 (EOL since June 2023) → 3.13, requests 2.27.1 → 2.32.3, removed unused curl/jq from the Docker image.

Other improvements

  • Exit code protocol replaces fragile "0" stdout sentinel
  • Failure output goes to stderr as human-readable text instead of a Python list repr
  • set -euo pipefail in entrypoint
  • Full type annotations on all functions
  • Removed unused imports (logging, dumps)
  • README updated: version ref @v0, removed unnecessary container: line, mentions pagination

Test plan

  • Create a release on a fork and verify the publish workflow succeeds
  • Trigger the action on a PR with <30 comments — should behave as before
  • Trigger the action on a PR with >30 comments — should now find users beyond page 1
  • Verify failure output is readable in the Actions log
  • Verify a revoked/invalid token produces a clear RuntimeError instead of a crash

The action silently returned incomplete results on PRs with >30 comments
because the GitHub API was never paginated. HTTP errors were also swallowed,
producing opaque crashes instead of actionable messages.

- Paginate GitHub API responses (up to 1000 comments)
- Raise on non-200 HTTP status with context
- Use exit codes instead of stdout sentinel for success/failure
- Upgrade Python 3.7 (EOL) to 3.13 and requests to 2.32.3
- Remove unused apt packages (curl, jq) from Docker image
- Fix publish workflow trigger and pin third-party action to SHA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant