fix(qg): find 14-deploy-log.md in origin/main when absent in feature worktree (false-FAILED deploy) #23

Merged
admin merged 1 commits from fix/deploy-gate-log-path into main 2026-06-04 13:38:31 +03:00
Owner

Problem (ET-013, 2026-06-04)

Successful deploys were falsely failed and rolled back deploy->development.

The deployer writes 14-deploy-log.md (deploy_status: SUCCESS) and merges deploy artifacts into main via a separate PR, so the log lands in origin/main. But check_deploy_status reads it from the feature-branch worktree via _repo_path(repo, branch) where only 10/12/13 exist -> Deploy log not found -> FAILED -> rollback. Hits every successful deploy.

Fix

In check_deploy_status: if 14-deploy-log.md is absent in the worktree, fall back to origin/main on the shared clone (git fetch origin main + git show origin/main:docs/work-items//14-deploy-log.md). Lookup order: worktree -> origin/main -> not found. Fetch/show failures degrade to not found (never raise). Frontmatter parsing factored into _parse_deploy_status (reads only deploy_status:).

Does NOT touch the merge-gate in gitea.py (current_stage==deploy ignores merge-driven done) — that gate is correct and stays.

Tests (mocked git/files)

  • worktree SUCCESS -> PASS (regress)
  • absent in worktree, SUCCESS in origin/main -> PASS (ET-013 fix)
  • FAILED in main -> FAILED
  • absent everywhere -> not found
  • fetch raises -> degrades, no exception
  • worktree log short-circuits main lookup

pytest: 277 passed, 9 failed (same 9 off-limits HMAC/401 as baseline; -p no:randomly deterministic).

## Problem (ET-013, 2026-06-04) Successful deploys were falsely failed and rolled back deploy->development. The deployer writes 14-deploy-log.md (deploy_status: SUCCESS) and merges deploy artifacts into **main** via a separate PR, so the log lands in **origin/main**. But check_deploy_status reads it from the **feature-branch worktree** via _repo_path(repo, branch) where only 10/12/13 exist -> Deploy log not found -> FAILED -> rollback. Hits every successful deploy. ## Fix In check_deploy_status: if 14-deploy-log.md is absent in the worktree, fall back to origin/main on the shared clone (git fetch origin main + git show origin/main:docs/work-items/<WI>/14-deploy-log.md). Lookup order: worktree -> origin/main -> not found. Fetch/show failures degrade to not found (never raise). Frontmatter parsing factored into _parse_deploy_status (reads only deploy_status:). Does NOT touch the merge-gate in gitea.py (current_stage==deploy ignores merge-driven done) — that gate is correct and stays. ## Tests (mocked git/files) - worktree SUCCESS -> PASS (regress) - absent in worktree, SUCCESS in origin/main -> PASS (ET-013 fix) - FAILED in main -> FAILED - absent everywhere -> not found - fetch raises -> degrades, no exception - worktree log short-circuits main lookup pytest: 277 passed, 9 failed (same 9 off-limits HMAC/401 as baseline; -p no:randomly deterministic).
admin added 1 commit 2026-06-04 13:35:57 +03:00
ET-013: deployer writes 14-deploy-log.md and merges deploy artifacts into
main via a separate PR, so the log lands in origin/main, not the feature
branch worktree that check_deploy_status reads via _repo_path(repo, branch).
Result: every successful deploy was falsely failed (Deploy log not found)
and rolled back deploy->development.

Fix: when the log is absent in the worktree, fall back to reading it from
origin/main on the shared clone (git fetch origin main + git show
origin/main:docs/work-items/<WI>/14-deploy-log.md). Lookup order:
worktree -> origin/main -> not found. Fetch/show failures degrade to
not found (never raise). Does not touch the merge-gate in gitea.py.

Tests: origin/main SUCCESS->PASS (ET-013 case), origin/main FAILED->FAILED,
absent everywhere->not found, fetch failure->degrades no exception,
worktree log short-circuits main lookup.
admin merged commit 34894f4684 into main 2026-06-04 13:38:31 +03:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/orchestrator#23