From cb474342234a180e01849f168a16fd27c5f43fff Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Wed, 10 Jun 2026 08:50:24 +0000 Subject: [PATCH] fix(get_repo): verify git tag exists before fetching; adopt git-authoritative hash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- get_repo.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/get_repo.sh b/get_repo.sh index 4ebd9a7..4bd4240 100755 --- a/get_repo.sh +++ b/get_repo.sh @@ -92,6 +92,24 @@ fi echo "MS_TAG=\"${MS_TAG}\"" echo "MS_COMMIT=\"${MS_COMMIT}\"" +# Verify the git tag is actually present in microsoft/vscode. The update API +# sometimes announces a new release before the git tag is pushed to GitHub, +# causing the fetch below to fail with the opaque "not our ref" error. If the +# tag is present but points at a different commit than what the API reported +# (e.g. after a force-push), adopt the git-authoritative hash since that is +# what GitHub can serve. +GIT_TAG_COMMIT=$( git ls-remote origin "refs/tags/${MS_TAG}" | awk '{print $1}' ) +if [[ -z "${GIT_TAG_COMMIT}" ]]; then + echo "Error: Tag ${MS_TAG} is not yet present in microsoft/vscode (update API announced commit ${MS_COMMIT})." + echo "Microsoft typically pushes the git tag within a few hours of the binary release." + echo "The next scheduled cron run will retry automatically." + exit 1 +fi +if [[ "${GIT_TAG_COMMIT}" != "${MS_COMMIT}" ]]; then + echo "Warning: git tag ${MS_TAG} points at ${GIT_TAG_COMMIT}, not update-API hash ${MS_COMMIT}; using git-authoritative hash." + MS_COMMIT="${GIT_TAG_COMMIT}" +fi + git fetch --depth 1 origin "${MS_COMMIT}" git checkout FETCH_HEAD