Skip to content

Require variables for legacy GraphQL queries - #8889

Merged
Alex Ross (alexr00) merged 1 commit into
microsoft:mainfrom
tamird:fix/legacy-graphql-variables
Sep 1, 2026
Merged

Require variables for legacy GraphQL queries#8889
Alex Ross (alexr00) merged 1 commit into
microsoft:mainfrom
tamird:fix/legacy-graphql-variables

Conversation

@tamird

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

Copy link
Copy Markdown
Contributor

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
Contributor 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
Contributor 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.

@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.

/AzurePipelines run

@alexr00 Alex Ross (alexr00) added this to the 1.137.0 milestone Aug 31, 2026
@alexr00

Copy link
Copy Markdown
Member

/AzurePipelines run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
2 pipeline(s) were filtered out due to trigger conditions.

@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.

Looks good, thank you! I'll merge it after we release this week.

@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) September 1, 2026 15:58
@alexr00 Alex Ross (alexr00) self-assigned this Sep 1, 2026
@tamird

Copy link
Copy Markdown
Contributor Author

Alex Ross (@alexr00) thanks! Could you also review #8890 which is stacked on top of this? I'll rebase that one once this one merges, but I don't expect any further code changes.

@alexr00
Alex Ross (alexr00) merged commit a606d09 into microsoft:main Sep 1, 2026
3 checks passed
@tamird
Tamir Duberstein (tamird) deleted the fix/legacy-graphql-variables branch September 1, 2026 18:01
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.

5 participants