Skip to content

analyzer/github: include is_fine_grained metadata and make gist enumeration non-fatal - #5332

Merged
unsmith merged 2 commits into
mainfrom
daveh.INT-644-github-pats-ui
Sep 22, 2026
Merged

unsmith merged 2 commits into
mainfrom
daveh.INT-644-github-pats-ui

Conversation

@unsmith

@unsmith unsmith commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Description:

Two fixes for the GitHub PAT analyzer:

  1. Include is_fine_grained in analyzer metadata. secretInfoToAnalyzerResult builds the metadata map that downstream consumers use, but it never included the FineGrained boolean despite it being available on TokenMetadata. Consumers that branch on is_fine_grained to select the correct permission catalog (classic vs fine-grained) always fell back to classic. This adds the field and updates both test fixtures.

  2. Make gist enumeration non-fatal. Both AnalyzeClassicToken and AnalyzeFineGrainedToken call GetAllGistsForUser and treat any error as fatal, discarding all already-gathered metadata, repos, and permissions. Gists are supplemental resources — if enumeration fails (e.g. rate-limit), the core analysis result is still fully usable. The error handling now continues with an empty gists slice instead of aborting.

Checklist:

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

Made with Cursor

unsmith and others added 2 commits September 21, 2026 14:23
Add the FineGrained boolean (already present on TokenMetadata) to the
metadata map in secretInfoToAnalyzerResult. Update both test fixtures
to include the new field.

Co-authored-by: Cursor <cursoragent@cursor.com>
Change both AnalyzeClassicToken and AnalyzeFineGrainedToken to continue
with an empty gists slice when GetAllGistsForUser fails, instead of
aborting. Gists are supplemental resources; the core result (metadata,
repos, permissions) is fully usable without them.

Co-authored-by: Cursor <cursoragent@cursor.com>
@unsmith
unsmith requested a review from a team September 21, 2026 18:26
@unsmith
unsmith requested a review from a team as a code owner September 21, 2026 18:26
@unsmith
unsmith merged commit 64d939a into main Sep 22, 2026
16 checks passed
@unsmith
unsmith deleted the daveh.INT-644-github-pats-ui branch September 22, 2026 13:03
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.

3 participants