Skip to content

feat: Support archived repo exclusion from GH org scans#4875

Open
hibare wants to merge 1 commit intotrufflesecurity:mainfrom
hibare:main
Open

feat: Support archived repo exclusion from GH org scans#4875
hibare wants to merge 1 commit intotrufflesecurity:mainfrom
hibare:main

Conversation

@hibare
Copy link
Copy Markdown
Contributor

@hibare hibare commented Apr 8, 2026

Description:

Adds optional exclusion of archived GitHub repositories from organization scans. Introduces the --exclude-archived flag on the github subcommand, a matching exclude_archived field on the GitHub source protobuf (sourcespb.GitHub), and wiring through GithubConfig, the engine, and org repo enumeration so archived repos are skipped when the option is enabled. Default behavior is unchanged when the flag is not set. Includes unit tests, an integration test case, and README usage.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@hibare hibare requested a review from a team April 8, 2026 16:34
@hibare hibare marked this pull request as draft April 8, 2026 16:34
@hibare hibare requested review from a team as code owners April 8, 2026 16:34
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 64137fa. Configure here.

continue
}
numArchived++
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Archived repo counter incremented only when not excluding

Low Severity

The numArchived counter is placed after the continue statement inside the ExcludeArchived check, so it's only incremented when archived repos are included (not excluded). When ExcludeArchived is true, repos are skipped via continue before numArchived++ runs, making the final log line always report num_archived=0 — exactly when you'd most want to know how many were skipped.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 64137fa. Configure here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behaviour is inline with how numForks is counted.

@hibare hibare marked this pull request as ready for review April 8, 2026 16: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