Skip to content

Require variables for legacy GraphQL queries - #8889

Open
Tamir Duberstein (tamird) wants to merge 1 commit into
microsoft:mainfrom
tamird:fix/legacy-graphql-variables
Open

Require variables for legacy GraphQL queries#8889
Tamir Duberstein (tamird) wants to merge 1 commit into
microsoft:mainfrom
tamird:fix/legacy-graphql-variables

Conversation

@tamird

@tamird Tamir Duberstein (tamird) commented Aug 20, 2026

Copy link
Copy Markdown

fd5f8d8 allowed legacy queries to replace their variables, but left the fallback variables optional. PullRequestComments supplied only a query, so retrying discarded owner, name, number, and the pagination cursor and failed with invalid-variable errors.

Require variables whenever a legacy query is supplied. Pass the review-comment variables explicitly on every page, while preserving separate argument maps for queries with different inputs. Regression coverage exercises replacement and legacy pagination through the repository query boundary.

Handle missing repository data before reading review threads, so a missing response produces the intended diagnostic.

Prepared with Codex.

@tamird
Tamir Duberstein (tamird) marked this pull request as ready for review August 20, 2026 21:14
Copilot AI lite review requested due to automatic review settings August 20, 2026 21:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Preserves GraphQL variables during legacy fallback queries, with regression coverage for inherited and replacement variables.

Changes:

  • Retains original variables unless fallback values are supplied.
  • Adds repository-level regression tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Summary
src/test/github/githubRepository.test.ts Tests inherited and replacement variable behavior.
src/github/githubRepository.ts Preserves variables during legacy fallback.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tamird

Copy link
Copy Markdown
Author

Dirk Bäumer (@dbaeumer) Alex Ross (@alexr00) could you kindly have a look at this?

@alexr00 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR! There does seem to be a bug here, but I think a better fix would be to require that we always pass in new variables, as there is no guarantee that the legacy query and the newer query take the same variables.

Copilot AI review requested due to automatic review settings August 28, 2026 15:35
@tamird Tamir Duberstein (tamird) changed the title Preserve variables in legacy GraphQL queries Require variables for legacy GraphQL queries Aug 28, 2026
@tamird

Copy link
Copy Markdown
Author

Alex Ross (@alexr00):

require that we always pass in new variables

Updated in 2867ea3: legacyFallback.variables is now required, and the review-comment caller explicitly supplies its variables on every page. The assignable-users fallback retains its separate variable map. Regression coverage checks replacement with different arguments and legacy pagination through the real query wrapper.

Desktop and web builds and all 479 extension-host tests pass for this commit. #8890 has also been rebased on it.

Prepared with Codex.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread src/github/pullRequestModel.ts
fd5f8d8 allowed legacy queries to replace their variables, but
left the fallback variables optional. PullRequestComments supplied
only a query, so retrying discarded owner, name, number, and the
pagination cursor and failed with invalid-variable errors.

Require variables whenever a legacy query is supplied. Pass the
review-comment variables explicitly on every page, while preserving
separate argument maps for queries with different inputs. Cover
replacement and legacy pagination at the repository boundary.

Handle missing repository data before reading review threads, so a
missing response produces the intended diagnostic.
Copilot AI review requested due to automatic review settings August 28, 2026 16:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

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.

3 participants