From c20227b2cf762c6a5d52c0064161d7979f66cc34 Mon Sep 17 00:00:00 2001 From: Codex Date: Sun, 5 Jul 2026 19:57:00 +0000 Subject: [PATCH] fix: report current gitea snapshot refs --- scripts/src/platform-infra-gitea-remote.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/src/platform-infra-gitea-remote.sh b/scripts/src/platform-infra-gitea-remote.sh index be000353..a27d76ec 100644 --- a/scripts/src/platform-infra-gitea-remote.sh +++ b/scripts/src/platform-infra-gitea-remote.sh @@ -553,15 +553,18 @@ for repo in meta: if len(parts) == 2: refs[parts[1]] = parts[0] branch_ref = f"refs/heads/{repo['branch']}" + branch_commit = refs.get(branch_ref) snapshots = sorted((ref, sha) for ref, sha in refs.items() if ref.startswith(repo["snapshotPrefix"] + "/")) - latest_snapshot = snapshots[-1] if snapshots else None + matching_snapshots = [item for item in snapshots if branch_commit and item[1] == branch_commit] + latest_snapshot = matching_snapshots[-1] if matching_snapshots else (snapshots[-1] if snapshots else None) + current_snapshot_ready = bool(branch_commit and latest_snapshot and latest_snapshot[1] == branch_commit) repos.append({ **repo, - "branchCommit": refs.get(branch_ref), + "branchCommit": branch_commit, "snapshotRef": latest_snapshot[0] if latest_snapshot else None, "snapshotCommit": latest_snapshot[1] if latest_snapshot else None, - "sourceBundleReady": bool(refs.get(branch_ref) and latest_snapshot), - "mirrorState": "ready" if refs.get(branch_ref) and latest_snapshot else "missing-ref", + "sourceBundleReady": current_snapshot_ready, + "mirrorState": "ready" if current_snapshot_ready else "missing-ref", "errorTail": text(os.path.join(tmp, f"{repo['key']}.ls.err")), }) payload = {"ok": status_rc == 0 and all(r["sourceBundleReady"] for r in repos), "repositories": repos, "valuesPrinted": False}