Skip to content

Skip excluded repos before fetching per-repo stats - #161

Open
ArnauNau wants to merge 1 commit into
jstrieb:masterfrom
ArnauNau:skip-excluded-repos-early
Open

ArnauNau wants to merge 1 commit into
jstrieb:masterfrom
ArnauNau:skip-excluded-repos-early

Conversation

@ArnauNau

Copy link
Copy Markdown

EXCLUDE_REPOS is only applied when aggregating in main.zig, so excluded repositories are still queried for /traffic/views and /stats/contributors, and, when that endpoint keeps returning 202, cloned locally to count lines changed.

Large upstream projects are the most likely repos to exclude, and also where those requests are the most expensive and fragile. In my case libsdl-org/SDL returned 504 from /stats/contributors, which failed the whole run (any status other than 202/403/429 is fatal) even though the repo was excluded.

This passes the exclude patterns into Statistics.init and skips matching repos right after the GraphQL contributions query, before any per-repo REST requests. Skipped repos are marked as seen, so later date ranges skip them too.

Notes:

  • The aggregated output is unchanged: matching uses the same glob.matchAny, and the aggregation-time filter in main.zig stays, so it still applies to --json-input-file.
  • Excluded repos no longer appear in --json-output-file.
  • Complementary to Filter inherited stats by ownership #155, which filters at aggregation time.

Testing: zig build, zig build test and zig fmt --check src/ pass. In my own copy of the workflow, runs that failed on the SDL 504 now succeed, and the language percentages match a separate computation from the same GraphQL data.

EXCLUDE_REPOS was only applied when aggregating, so excluded repos were
still queried for views and contributor stats. For huge repos (e.g.
libsdl-org/SDL) that endpoint returns 504s or truncated responses that
fail the whole run.
@ArnauNau
ArnauNau force-pushed the skip-excluded-repos-early branch from a585ec6 to ad20b2e Compare October 18, 2026 15:55
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