Skip to content

Paginate workflow jobs when generating traces #19

Description

@ANonABento

Problem

get_data(...) fetches jobs with:

jobs_url = f"{run_url}/jobs"
jobs_response = requests.get(jobs_url + "?per_page=100", headers=headers)

GitHub returns paginated results for workflow jobs. Large workflows with more than 100 jobs will silently produce incomplete traces because only the first page is included.

Suggested fix

  • Follow pagination via the Link header, or loop with page=N&per_page=100 until fewer than 100 jobs are returned.
  • Add a test or fixture that simulates more than 100 jobs.
  • Consider applying the same timeout/retry handling to all GitHub API requests in this path.

Relevant file

  • src/github_actions_tracing/main.py

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions