Skip to content

fix(get_repo): verify git tag exists before fetching (issue #10)#11

Merged
sbs44 merged 1 commit into
mainfrom
fix/issue-10-get-repo-tag-check
Jun 10, 2026
Merged

fix(get_repo): verify git tag exists before fetching (issue #10)#11
sbs44 merged 1 commit into
mainfrom
fix/issue-10-get-repo-tag-check

Conversation

@claude

@claude claude Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Root cause

The cron build (run 27261205466) failed because:

  1. The MS update API reported VS Code 1.123.2 at commit 3c631b164c239e7aeaaae7c626b46c527b361af2.
  2. The cron's check job detected upstream (1.123.2) > pin (1.123.0) and set MS_COMMIT from the API response.
  3. The build job ran get_repo.sh, which attempted git fetch --depth 1 origin 3c631b16....
  4. Microsoft's GitHub repo had no 1.123.2 tag at that time (only 1.123.0 is tagged). git fetch returned fatal: remote error: upload-pack: not our ref 3c631b16....

The update API sometimes announces a binary release before the corresponding git tag is pushed to GitHub (typically a few-hour gap). The previous error message gave no indication of this timing issue.

Fix

get_repo.sh now runs git ls-remote origin "refs/tags/${MS_TAG}" before attempting the fetch:

  • If the tag is absent → clear error: "Tag 1.123.2 is not yet present in microsoft/vscode … The next scheduled cron run will retry automatically."
  • If the tag is present but with a different commit than the API reported (force-push scenario) → adopt the git-authoritative hash so the fetch succeeds.

What this doesn't change

  • PR builds test the pinned version (1.123.0 today), so CI is unaffected.
  • The cron will keep failing until Microsoft pushes the 1.123.2 tag — this PR improves the error message and robustness; it does not change when the build attempts run.

Deeper fix (needs human action)

The ideal prevention is in the check job of cron-build-and-release.yml: run git ls-remote before deciding needs_build=true, so the expensive macOS runner never starts for a version whose tag isn't in git. That change requires workflows: write permission which the Claude App's GITHUB_TOKEN does not currently have. A repo admin can apply it with a PAT that has workflow scope.

Refs #10

…ritative hash

Root cause of run https://github.com/bradford-tech/code/actions/runs/27261205466:

The cron check job queried the MS update API, found VS Code 1.123.2 at commit
3c631b164c239e7aeaaae7c626b46c527b361af2, and decided to build it (upstream
> pin). The build job's get_repo.sh then attempted:

  git fetch --depth 1 origin 3c631b164c239e7aeaaae7c626b46c527b361af2

Microsoft's GitHub repo had no 1.123.2 tag at the time — only 1.123.0 is
tagged. GitHub rejected the fetch with "not our ref", a generic error that
hides the real cause.

Fix: after MS_TAG and MS_COMMIT are resolved, run git ls-remote to verify
the tag is present in microsoft/vscode before attempting the fetch. This
converts the opaque "not our ref" failure into a clear diagnostic:

  Error: Tag 1.123.2 is not yet present in microsoft/vscode ...

Bonus: if the tag IS present but its commit differs from the API-reported
hash (e.g. after a force-push), adopt the git-authoritative hash so the
subsequent git fetch succeeds rather than failing with "not our ref" again.
@sbs44 sbs44 merged commit f78d448 into main Jun 10, 2026
6 checks passed
@sbs44 sbs44 deleted the fix/issue-10-get-repo-tag-check branch June 10, 2026 15:26
sbs44 added a commit that referenced this pull request Jun 12, 2026
* fix: rebase 11-update-use-github-release patch onto VS Code 1.124.0

VS Code 1.124.0 restructured doApplyUpdate in updateService.win32.ts:
moved the spawn() block inside an else { } branch guarded by a new
mutex-based isInstallerActive() check, adding one tab of indentation
and a blank line before const child = spawn().

Hunk #11 of the patch was searching for the old 2-tab-indented context
without the blank line — no longer present in 1.124.0 — causing a
patch rejection.

Fix: regenerate the win32.ts section of the patch from the 1.124.0
base so the spawn MSI/Setup conditional lands inside the existing
else { } block with correct 3-tab indentation and blank-line context.

Also bump upstream/stable.json to 1.124.0 so the PR build targets
the same upstream commit the patch is written against.

* fix(patches): rebase 20-keymap-use-custom-lib for vscode 1.124.0

* fix(patches): rebase 51-ext-copilot-remove-it for VS Code 1.124.0

VS Code 1.124.0 restructured the agent host's Copilot integration, so
51-ext-copilot-remove-it no longer applied (build halted on it after the
11 + 20 rebases). Rebase it so it both applies AND leaves no dangling
references once @github/copilot* is removed (would otherwise fail
compile-src on the next attempt):

- package.json / package-lock.json: drop @github/copilot +
  @github/copilot-sdk against the new 1.0.57 / 1.0.0 entries (versions
  drifted from 1.0.55-3 / 1.0.0-beta.8); lock root deps stay in sync
  with package.json for `npm ci`.
- agentHostServerMain.ts: drop the CopilotAgent import + registration
  (surrounding context shifted in 1.124.0).
- Delete copilotSessionLauncher.ts — a new copilot-only file that
  imports @github/copilot-sdk and is referenced only by the deleted
  copilot agent/tests.
- common/otel/agentHostOTelService.ts: shim the SDK TelemetryConfig
  import. 1.123.0 used a local IAgentHostSdkTelemetryConfig mirror;
  1.124.0 switched it to `import type { TelemetryConfig } from
  '@github/copilot-sdk'`, mirroring the existing node/otel shim.

Verified locally: every patch applies in CI order against pristine
1.124.0, and no @github/copilot* imports or references to deleted
copilot modules remain in compiled src.

Refs #12

---------

Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <claude@anthropic.com>
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.

1 participant