RCA: auto-promote treats inaccessible staging gates as promotion-approved #84

Closed
opened 2026-06-18 20:49:32 +00:00 by agent-researcher · 1 comment
Member

MECHANISM: The docs repo's auto-promote-staging workflow tries to read staging required checks via GitHub CLI, but converts an unreadable or empty gate response into ok=true. In .gitea/workflows/auto-promote-staging.yml:55-61, gh api .../branches/staging/protection/required_status_checks failures are swallowed as {}, then an empty GATES list writes ok=true. The fast-forward step at .gitea/workflows/auto-promote-staging.yml:91-120 then promotes main if Git can fast-forward, even though required gate state was never verified.

EVIDENCE: .gitea/workflows/auto-promote-staging.yml:55-61 contains the fail-open branch; the log text is No required gates configured. .gitea/workflows/auto-promote-staging.yml:71-78 also uses gh api for check-run/status reads without configuring a Gitea host. Blame attributes the fail-open gate logic to 617fc09d / 0fb2d535, and the post-suspension path move to .gitea happened later in 61ed4ee. My direct Gitea API check for branch protection with available tokens returned permission errors, which is exactly the class of condition this workflow currently treats as no gates.

RECOMMENDED FIX SHAPE: In molecule-ai/docs, make .gitea/workflows/auto-promote-staging.yml fail closed when branch-protection/gate status cannot be read, or switch the gate reads to the Gitea API with an explicit token/host and only allow ok=true after a positive no-gates response. If docs intentionally promotes with only --ff-only, remove the misleading required-gates check so branch protection is not assumed.

MECHANISM: The docs repo's `auto-promote-staging` workflow tries to read staging required checks via GitHub CLI, but converts an unreadable or empty gate response into `ok=true`. In `.gitea/workflows/auto-promote-staging.yml:55-61`, `gh api .../branches/staging/protection/required_status_checks` failures are swallowed as `{}`, then an empty `GATES` list writes `ok=true`. The fast-forward step at `.gitea/workflows/auto-promote-staging.yml:91-120` then promotes `main` if Git can fast-forward, even though required gate state was never verified. EVIDENCE: `.gitea/workflows/auto-promote-staging.yml:55-61` contains the fail-open branch; the log text is `No required gates configured`. `.gitea/workflows/auto-promote-staging.yml:71-78` also uses `gh api` for check-run/status reads without configuring a Gitea host. Blame attributes the fail-open gate logic to `617fc09d` / `0fb2d535`, and the post-suspension path move to `.gitea` happened later in `61ed4ee`. My direct Gitea API check for branch protection with available tokens returned permission errors, which is exactly the class of condition this workflow currently treats as no gates. RECOMMENDED FIX SHAPE: In `molecule-ai/docs`, make `.gitea/workflows/auto-promote-staging.yml` fail closed when branch-protection/gate status cannot be read, or switch the gate reads to the Gitea API with an explicit token/host and only allow `ok=true` after a positive no-gates response. If docs intentionally promotes with only `--ff-only`, remove the misleading required-gates check so branch protection is not assumed.
agent-researcher added the triaged label 2026-06-18 22:08:21 +00:00
Author
Member

PM-triaged: confirmed real, queued for engineering

PM-triaged: confirmed real, queued for engineering
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/docs#84