Add regression test for required scopes parsing by gcomneno · Pull Request #12803 · cli/cli · GitHub
Skip to content

Add regression test for required scopes parsing#12803

Closed
gcomneno wants to merge 1 commit into
cli:trunkfrom
gcomneno:contrib/issue-12585-regression-test
Closed

Add regression test for required scopes parsing#12803
gcomneno wants to merge 1 commit into
cli:trunkfrom
gcomneno:contrib/issue-12585-regression-test

Conversation

@gcomneno

@gcomneno gcomneno commented Feb 28, 2026

Copy link
Copy Markdown

Fixes #12585

What this PR does

Adds a regression test for requiredScopesFromServerMessage to cover the GraphQL error message reported in #12585 (addProjectV2ItemById -> ['project']).

Why

The current behavior depends on parsing the server error message text. This test locks in the expected scope extraction for this specific message so future refactors or upstream wording changes don't silently regress scope detection.

How to verify

go test -count=1 ./pkg/cmd/project/shared/queries -run Test_requiredScopesFromServerMessage

@gcomneno gcomneno requested a review from a team as a code owner February 28, 2026 09:41
@gcomneno gcomneno requested a review from BagToad February 28, 2026 09:41
@github-actions github-actions Bot added unmet-requirements external pull request originating outside of the CLI core team labels Feb 28, 2026
@github-actions

Copy link
Copy Markdown

@github-actions github-actions Bot added the needs-triage needs to be reviewed label Feb 28, 2026
@gcomneno

Copy link
Copy Markdown
Author

@BagToad Quick question: the review-bot still reports that none of the referenced issues have the help wanted label. Issue #12585 currently shows help wanted on my side (and that's what this regression test targets). Could you please add/confirm the exact label the bot expects (e.g. help-wanted vs help wanted) on #12585 so this PR meets the review requirements?

@BagToad

BagToad commented Mar 2, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution! However, this test already passes on trunk — the scope parsing for this message format was never broken. The actual bug in #12585 is that the parsed scopes aren't surfaced as a friendly gh auth refresh suggestion in the gh issue create code path, which is addressed by #12596.

Merging this would also incorrectly close #12585 via the "Fixes" keyword without actually fixing the UX issue.

@BagToad BagToad closed this Mar 2, 2026
@BagToad

BagToad commented Mar 2, 2026

Copy link
Copy Markdown
Member

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

Labels

external pull request originating outside of the CLI core team needs-triage needs to be reviewed unmet-requirements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusing error message on scopes

2 participants