From a7e2af444a981c1e4454a6897cd0a5ac391af054 Mon Sep 17 00:00:00 2001 From: autonomic-bot Date: Sat, 30 May 2026 05:49:27 +0100 Subject: [PATCH] fix(2): assert_upgraded tolerate abra's '+U' working-tree marker on chaos-version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A cc-ci deploy overlay sitting in the recipe checkout as an untracked file (ghost's compose.ccci-health.yml via install_steps) makes abra stamp chaos-version='+U' (U=untracked). The commit still equals head_ref (HC1 satisfied) but the '+U' broke the exact-prefix match → spurious upgrade-tier FAIL. Strip the working-tree-state marker before the commit match; HC1 preserved (commit must still equal head_ref — a stale checkout's commit would not match even after stripping). General: benefits every future cc-ci overlay recipe. --- runner/harness/generic.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/runner/harness/generic.py b/runner/harness/generic.py index 60a0057..b714a33 100644 --- a/runner/harness/generic.py +++ b/runner/harness/generic.py @@ -163,7 +163,14 @@ def assert_upgraded(domain: str, meta: dict) -> None: "PR-head checkout (the code under test was not exercised by the upgrade)" ) # chaos-version is an abbreviated commit (e.g. '8a026066'); head_ref may be full or short. - assert head_ref.startswith(chaos) or chaos.startswith(head_ref), ( + # abra appends a working-tree-state marker (e.g. '+U' = untracked file present) to the + # chaos-version when a cc-ci DEPLOY OVERLAY sits in the recipe checkout as an untracked file + # (e.g. ghost's compose.ccci-health.yml, provided by install_steps). That marker is NOT part + # of the commit identity — strip it before the HC1 commit match. HC1 is preserved: the + # underlying COMMIT must still equal head_ref; a stale prev-checkout chaos redeploy would + # stamp prev's commit (also '+U' if overlaid) and STILL not match head_ref after stripping. + chaos_commit = chaos.split("+", 1)[0] + assert head_ref.startswith(chaos_commit) or chaos_commit.startswith(head_ref), ( f"{domain}: upgrade deployed chaos commit {chaos!r}, not the intended PR-head " f"{head_ref[:12]!r} — the re-checkout to the code under test failed, so the upgrade is " "not exercising the PR's changes (HC1)"