Repository navigation
fix(fleet): let GraphQL board reads fail over to the App identity - #12157
Conversation
Treat a gh api graphql call whose inline query is a { } selection or a
named query as read-only, and count GraphQL's 'Could not resolve to a
node' answer as a permission refusal, so board reads try the next
identity. Mutations, file or stdin queries and unknown shapes stay writes.
Refs #12154
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 40 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d71e430981
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
operationName can select a mutation from a document that opens with a query, so a mutation or subscription anywhere makes the call a write. Drop the 'Could not resolve to a' permission class: read-only calls already fail over on any error, and for a write that string does not prove the request was refused before it ran. Refs #12154 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e36bf98b5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A --template or --jq value shaped like -fquery=... no longer counts as the query field, and a call with more than one query field is a write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24e95b79de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A cluster like `gh api -it graphql repos/o/r/issues ...` makes the token after it a value, not the endpoint, so the scanner could take a REST write for a GraphQL read. Any short option longer than two characters that is not a value-taking flag with its value attached now counts as a write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7fc7c21887
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
gh expands {owner}, {repo} and {branch} in -F/--field values before
sending, so the unexpanded text is not the operation gh sends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 603e776bb4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Generated documents, field forms and option placement check the invariant that a call able to mutate is never a read eligible for arbitrary-error retries, and that plain read documents still are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #12154
Before:
fleet ghtreated everygh api graphqlcall as a write, because GraphQL sends its query with-f. Writes only fail over on rate-limit or permission wording, and a board the personal token can't see answers "Could not resolve to a node". So board reads never reached the owner's App identity.After: a GraphQL call counts as a read when its inline
queryis a{ ... }selection or a namedqueryand the document holds nomutationorsubscription. Like any read, it fails over to the next identity on any error, the hidden-node answer included. Mutations, subscriptions (anywhere in the document, sinceoperationNamecan pick one), queries read from a file (query=@path) or--input, and anything else that can't be told apart still count as writes. Failure classification for writes is unchanged.How:
api_endpointfinds thegh apiendpoint, skipping the values of flags that take one.is_graphql_readreads thequeryfield, rejects any document with amutationorsubscriptionword, and otherwise checks the leading operation keyword after skipping#comment lines. The old test that pinned a GraphQL query as a write now pins the new rule, with mutation, file,--input, no-query and look-alike keyword (queryish), query-then-mutation withoperationName, and trailing-subscription cases. It also checks that a REST call with aquery=field is still a write.Generated by Claude Code