Skip to content

fix(fleet): let GraphQL board reads fail over to the App identity - #12157

Merged
dezren39 merged 7 commits into
mainfrom
claude/fleet-gh-graphql-reads
Nov 21, 2026
Merged

dezren39 merged 7 commits into
mainfrom
claude/fleet-gh-graphql-reads

Conversation

@dezren39

@dezren39 dezren39 commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Refs #12154

Before: fleet gh treated every gh api graphql call 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 query is a { ... } selection or a named query and the document holds no mutation or subscription. Like any read, it fails over to the next identity on any error, the hidden-node answer included. Mutations, subscriptions (anywhere in the document, since operationName can 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_endpoint finds the gh api endpoint, skipping the values of flags that take one. is_graphql_read reads the query field, rejects any document with a mutation or subscription word, 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 with operationName, and trailing-subscription cases. It also checks that a REST call with a query= field is still a write.


Generated by Claude Code

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>
@dezren39
dezren39 requested a review from a team as a code owner November 21, 2026 04:17
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T04:58:53.468753Z 2873f10 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e1f8d8ef-f0d5-4918-a916-080225a48afb
Commits

Reviewing files that changed from the base of the PR and between b855df4 and 2873f10.

Files ignored due to path filters: 1

  • pkgs/fleet/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 2

  • pkgs/fleet/crates/fleet/Cargo.toml
  • pkgs/fleet/crates/fleet/src/gh.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread pkgs/fleet/crates/fleet/src/gh.rs Resolved
Comment thread pkgs/fleet/crates/fleet/src/gh.rs Resolved
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread pkgs/fleet/crates/fleet/src/gh.rs Resolved
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread pkgs/fleet/crates/fleet/src/gh.rs Resolved
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread pkgs/fleet/crates/fleet/src/gh.rs Resolved
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread pkgs/fleet/crates/fleet/src/gh.rs Resolved
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>
@dezren39
dezren39 merged commit 41b2ad2 into main Nov 21, 2026
2 checks passed
@dezren39
dezren39 deleted the claude/fleet-gh-graphql-reads branch November 21, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants