Skip to content

Agents - adopting etags for additional REST API calls#312893

Merged
lszomoru merged 2 commits intomainfrom
lszomoru/github-etags-adoption
Apr 27, 2026
Merged

Agents - adopting etags for additional REST API calls#312893
lszomoru merged 2 commits intomainfrom
lszomoru/github-etags-adoption

Conversation

@lszomoru
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 27, 2026 20:08
@lszomoru lszomoru enabled auto-merge (squash) April 27, 2026 20:08
@lszomoru lszomoru self-assigned this Apr 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Agents window’s GitHub integration to use ETag-aware REST responses (request2) for more calls, enabling conditional requests and reducing unnecessary payloads when data hasn’t changed.

Changes:

  • Switch repository and CI check-run fetchers/models to use request2 and carry ETags through refresh cycles.
  • Update PR comment posting and check-run annotation fetching to use request2 response shapes.
  • Adjust browser tests/mocks to assert against { data, statusCode, etag } responses.
Show a summary per file
File Description
src/vs/sessions/contrib/github/test/browser/githubModels.test.ts Updates mock fetcher signatures to match ETag-aware response shape.
src/vs/sessions/contrib/github/test/browser/githubFetchers.test.ts Updates assertions for the new { data, statusCode } fetcher return values.
src/vs/sessions/contrib/github/browser/models/githubRepositoryModel.ts Caches repository ETag and performs conditional refreshes.
src/vs/sessions/contrib/github/browser/models/githubPullRequestCIModel.ts Caches checks ETag and performs conditional refreshes for check runs.
src/vs/sessions/contrib/github/browser/fetchers/githubRepositoryFetcher.ts Moves repository REST call to request2 and returns IGitHubApiResponse.
src/vs/sessions/contrib/github/browser/fetchers/githubPRFetcher.ts Uses request2 for posting PR/issue comments and validates presence of response data.
src/vs/sessions/contrib/github/browser/fetchers/githubPRCIFetcher.ts Uses request2 for check runs, reruns, and annotations fetching (ETag-enabled for check runs).
src/vs/sessions/contrib/github/browser/fetchers/githubChangesFetcher.ts Switches compare API call to request2 and maps response data to changed files.

Copilot's findings

Comments suppressed due to low confidence (1)

src/vs/sessions/contrib/github/browser/fetchers/githubPRFetcher.ts:245

  • Same as above for issue comments: request2() can return data: undefined for 204/304 without throwing, so the thrown error should include response.statusCode to aid debugging and to distinguish server behavior changes from client mapping failures.
		const data = response.data;
		if (!data) {
			throw new Error(`Failed to post issue comment to ${owner}/${repo}#${prNumber}`);
		}
  • Files reviewed: 8/8 changed files
  • Comments generated: 2

Comment thread src/vs/sessions/contrib/github/browser/fetchers/githubPRFetcher.ts
@lszomoru lszomoru merged commit 42a6557 into main Apr 27, 2026
30 checks passed
@lszomoru lszomoru deleted the lszomoru/github-etags-adoption branch April 27, 2026 20:31
@vs-code-engineering vs-code-engineering Bot added this to the 1.119.0 milestone Apr 27, 2026
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