fix(qg): find 14-deploy-log.md in origin/main when absent in feature worktree (false-FAILED deploy) #23
Reference in New Issue
Block a user
Delete Branch "fix/deploy-gate-log-path"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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)
pytest: 277 passed, 9 failed (same 9 off-limits HMAC/401 as baseline; -p no:randomly deterministic).