fix: check token scopes before interactive app setup - #760
Conversation
|
fullsend review is working on this — view logs |
Site previewPreview: https://d4840ba9-site.fullsend-ai.workers.dev Commit: |
Review: #760Head SHA: 88fb974 SummaryThis PR adds an early token scope check ( FindingsInfo
FooterOutcome: approve Previous runReview: #760Head SHA: d6d198f SummaryThis PR adds a useful early scope check before the interactive GitHub App setup flow, preventing users from wasting time on browser-based app creation when their token is missing required scopes. The change is correctly placed after the dry-run check and before FindingsMedium
Low
FooterOutcome: comment-only |
|
fullsend review is working on this — view logs |
The install command creates GitHub Apps (requiring browser interaction) before checking if the token has required scopes. If scopes are missing, the user wastes time on browser flows before the install fails. Move a lightweight scope check before app setup so missing scopes are caught immediately. Signed-off-by: Wayne Sun <gsun@redhat.com>
Extract hardcoded scope list to package-level installRequiredScopes variable and add tests covering all four code paths (all scopes present, missing scopes, fine-grained token skip, API error). A SyncWithLayers test builds the full install layer stack and asserts parity with the variable, preventing silent drift. Signed-off-by: Wayne Sun <gsun@redhat.com>
b9db3e7 to
88fb974
Compare
|
fullsend review is working on this — view logs |
Summary
repo,workflow,admin:org) before GitHub App creation infullsend admin installrunPreflightinsiderunInstallremains as defense-in-depthTest plan
go vet ./...passesgo test -race ./internal/cli/passesfullsend admin installwith a token missingworkflowscope — should fail immediately with scope error before any browser windows open