Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Improves project-scope error reporting during issue and pull request creation while preserving optional metadata behavior.
Changes:
- Parses structured GraphQL missing-scope errors.
- Propagates deferred ProjectV2 scope failures during project resolution.
- Adds API and command regression tests.
Show a summary per file
| File | Description |
|---|---|
api/client.go |
Adds missing-scope parsing and error formatting. |
api/client_test.go |
Tests scope extraction and formatting. |
api/queries_projects_v2.go |
Recognizes structured ProjectV2 scope errors. |
api/queries_projects_v2_test.go |
Tests ignorable missing-scope errors. |
api/queries_repo.go |
Carries scope failures through project resolution. |
api/queries_repo_test.go |
Tests classic and inaccessible project resolution. |
pkg/cmd/issue/create/create_test.go |
Covers issue creation without project scope. |
pkg/cmd/pr/create/create_test.go |
Covers pull request creation without project scope. |
pkg/cmd/pr/shared/params.go |
Surfaces missing-scope errors during metadata resolution. |
Review details
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Suppressed comments (1)
api/client_test.go:72
- 🛑 Requirement: Use
requirefor these error assertions.AGENTS.md:110-118requires error checks to stop the test immediately, preventing later assertions from running against an invalid setup.
assert.EqualError(t, GraphQLMissingScopesError(err), "error: your authentication token is missing required scopes [read:discussion read:project]\nUpdate your authentication token to include: read:discussion,read:project")
assert.Empty(t, GraphQLMissingScopes(errors.New("not a GraphQL error")))
assert.NoError(t, GraphQLMissingScopesError(errors.New("not a GraphQL error")))
- Files reviewed: 9/9 changed files
- Comments generated: 4
- Review effort level: Balanced
Comment on lines
+74
to
+79
| m := requiredScopesRE.FindStringSubmatch(graphQLError.Message) | ||
| if m == nil { | ||
| continue | ||
| } | ||
| for _, scope := range strings.Split(m[1], ",") { | ||
| missing[strings.Trim(scope, "' ")] = struct{}{} |
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Bumps [charm.land/bubbles/v2](https://github.com/charmbracelet/bubbles) from 2.2.0 to 2.2.1. - [Release notes](https://github.com/charmbracelet/bubbles/releases) - [Commits](charmbracelet/bubbles@v2.2.0...v2.2.1) --- updated-dependencies: - dependency-name: charm.land/bubbles/v2 dependency-version: 2.2.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [github.com/sigstore/protobuf-specs](https://github.com/sigstore/protobuf-specs) from 0.5.1 to 0.5.2. - [Release notes](https://github.com/sigstore/protobuf-specs/releases) - [Changelog](https://github.com/sigstore/protobuf-specs/blob/main/CHANGELOG.md) - [Commits](sigstore/protobuf-specs@v0.5.1...v0.5.2) --- updated-dependencies: - dependency-name: github.com/sigstore/protobuf-specs dependency-version: 0.5.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.21.9 to 0.22.0. - [Release notes](https://github.com/google/go-containerregistry/releases) - [Commits](google/go-containerregistry@v0.21.9...v0.22.0) --- updated-dependencies: - dependency-name: github.com/google/go-containerregistry dependency-version: 0.22.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Copilot App <[email protected]>
maxbeizer
force-pushed
the
maxbeizer-fix-project-scope-error
branch
from
October 23, 2026 14:59
09b7ae0 to
8097bcc
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Undefined credential-test helpers prevent compilation, and three view commands introduce incompatible flag restrictions.
6 open issues
Use the defined Git configuration isolation helper · New Use the existing Git configuration isolation helper · New Preserve the supported discussion view flag combination · New Preserve the supported issue view flag combination · New Preserve the supported pull request view flag combination · New 🛑 Requirement: Reuse this parser from the existing project-command scope handling instead of…
3 resolved since last review
Review effort: Balanced
| contract.HelperConfig{ | ||
| NewHelperConfig: func(t *testing.T) shared.HelperConfig { | ||
| git.IsolateConfig(t) | ||
| test.IsolateGitConfig(t) |
| // Given we have an isolated git config and we're using the built in store credential helper | ||
| // https://git-scm.com/docs/git-credential-store | ||
| git.IsolateConfig(t) | ||
| test.IsolateGitConfig(t) |
Comment on lines
+155
to
+158
| if err := cmdutil.MutuallyExclusive("specify only one of --comments or --json", | ||
| opts.Comments, opts.Exporter != nil); err != nil { | ||
| return err | ||
| } |
Comment on lines
+60
to
+63
| if err := cmdutil.MutuallyExclusive("specify only one of --comments or --json", | ||
| opts.Comments, opts.Exporter != nil); err != nil { | ||
| return err | ||
| } |
Comment on lines
+60
to
+63
| if err := cmdutil.MutuallyExclusive("specify only one of --comments or --json", | ||
| opts.Comments, opts.Exporter != nil); err != nil { | ||
| return err | ||
| } |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #8798
Surface missing ProjectV2
read:projectauthorization failures when an issue or pull request is explicitly created with--project. Previously, an inaccessible requested ProjectV2 was reported as not found.gh issue viewandgh pr viewread:projectgh projectmissing-scope output unchangedLocal demonstration
Fixture-backed checks
From this PR branch, run the focused tests without changing credentials or creating GitHub content:
These exercise an
INSUFFICIENT_SCOPESresponse requiringread:project. They show that explicit issue/PR creation returns actionable scope guidance, while optional ProjectV2 lookup remains ignorable and classic-project resolution still succeeds.Live comparison with
trunkUse a disposable repository and a token that can access that repository but deliberately lacks
read:project. Choose the title of a ProjectV2 that is attached to the repository. Both commands stop during metadata resolution, before creating an issue.Captured locally against
cli/cliwith a token that lacksread:project:The same comparison applies to
gh pr create --project, but the fixture-backed PR test above is preferred because it cannot create a pull request.