Revert "fix: clarify scope error while creating issues for projects"#12915
Merged
williammartin merged 1 commit intotrunkfrom Mar 12, 2026
Merged
Revert "fix: clarify scope error while creating issues for projects"#12915williammartin merged 1 commit intotrunkfrom
williammartin merged 1 commit intotrunkfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reverts #12596, which had added a centralized GenerateScopeErrorForGQL function in api/client.go to detect INSUFFICIENT_SCOPES GraphQL errors and generate user-friendly scope error messages. The revert removes this centralized handling, leaving the original scope error handling in pkg/cmd/project/shared/queries/queries.go intact.
Changes:
- Removes
GenerateScopeErrorForGQLandrequiredScopesFromServerMessagefunctions fromapi/client.go, along with the call site inhandleResponse - Removes associated test cases from
api/client_test.go - Removes now-unused imports (
pkg/set,go-gh/v2/pkg/api)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| api/client.go | Removes GenerateScopeErrorForGQL, requiredScopesFromServerMessage, and the scope error interception in handleResponse |
| api/client_test.go | Removes tests for GenerateScopeErrorForGQL and requiredScopesFromServerMessage, and the unused import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Mar 12, 2026
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.
Description
Reverts #12596
Fixes #12904
This PR introduced a change that adjusted the stringified error message returned in GQL response when there were missing scopes. However, that error message was interrogated by
ProjectsV2IgnorableErrorin order to gracefully degrade the experience onprandissue viewcommands whenread:projectswas missing.We could move this forward, but I actually think the implementation in that PR was incorrect because it previously showed an error message that made sense for personal access tokens and was changed to a message that only made sense for OAuth tokens. And so it just sort of swapped the problem around. I'm gonna reopen that issue, but if we were to address it again we would need to interrogate the type of token or provide an error message that covered both cases.
Acceptance Test
Before
After