fix(2): assert_upgraded tolerate abra's '+U' working-tree marker on chaos-version

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='<commit>+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.
This commit is contained in:
2026-05-30 05:49:27 +01:00
parent 13da216f8d
commit a7e2af444a

View File

@ -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)"