← Back to Pull requests

feat(ci): apply approved release environments during deployment #3286

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Dec 04, 2026 04:05 UTC
Author

TL;DR

Preview and apply use one verified mstage snapshot, and release reviewers can waive a failed dev E2E by approving this attempt with a reason.

How it works

  • Under the stage lock, both entry points resolve the selector, confirm protected stages and reject unsupported component scopes before the callback. The callback uses a stage-scoped OIDC bearer and a zero-byte POST.

  • The callback job is named mstage release env v1 | STAGE | SELECTOR | INFRA_SHA. Timeouts and HTTP 504 allow three retries with the same bearer.

  • A terminal callback failure sends one advisory and continues with latest. An uncertain write is identified in the advisory.

  • A receipt, including already_set, pins one full read in memory for digest verification, group selection and the target engine (GCP Pulumi or AWS SST). An unreadable pin or latest-only tool permits one advised latest read.

  • An invalid digest or unreadable latest stops before the deployment engine. Environment runbook
  • Source selection

  • HEAD and empty input select the workflow commit. An eligible PR keeps its number and selects its resolved merge SHA. A full SHA selects that commit.

  • Stable tags use workflow-owned infrastructure and import image and Runner digests for the tagged commit. Local actions always use the workflow checkout.

  • Dev and stage admit custom workflow branches. Prod requires the workflow on main, a stable tag reachable from main and separate approval.
  • Waiver approval

  • Stable release E2E starts after a successful release plan records dev apply for this attempt, including when the commit preparation job was skipped.

  • For complete failing dev E2E reports, open Review deployments → release-e2e-override. Inspect the tag, SHA, evidence and logs, enter a reason and approve.

  • Before approval, the prerequisite binds run, attempt, candidate ID and digest, tag, SHA and failed artifact ID. It freezes all existing review IDs for that Environment.

  • Exactly one new approved review from a configured reviewer qualifies. The receipt records its ID, author and reason. The release summary records dev E2E 失败,已人工豁免.

  • Passing E2E continues normally. Deployment failures, missing reports and interrupted or cancelled tests block release. Review and rerun instructions
  • Verification

  • Linux make coverage:infra ran make test:apps:infra with 2,283 tests passing and two skipped.

  • Local HTTP tests covered manual and reusable preview/apply, caller-prefixed job names, request bytes, 200, 404, 409, timeouts, 504, retries and Slack failure.

  • All 13 deployment adapter tests passed against both v0.13.1 and v0.16.1 with simulated cloud and Pulumi dependencies. Preview and apply consumed V2 after latest advanced to V3.

  • An unreadable pin fell back once. A corrupt digest resulted in zero Pulumi calls.

  • Two attempts reused the same tag and SHA with different evidence. Only the new reason-only approval passed. Rejection, ambiguity and whitespace-only reasons blocked release.
  • Evidence

  • GitHub workflow and infrastructure checks passed at 17b308f0c74. Codecov reported 95.92% patch coverage against a 90% target. Hosted checks · Codecov

  • A read-only workflow retrieved three distinct waiver reviews with the declared token permissions. GitHub Actions run

  • Six regression assertions failed on the handoff revision, covering request bytes, reason-only approval, ref selection and V2/V3 isolation.

  • The v0.16.1 manifest includes API and Runner digests and omits Secret Server. Full deployments requiring that image fail import, while API-only selects the published API digest. Release assets

  • Actionlint 1.7.12 reported the same 17 existing queue and cache-mode diagnostics on the handoff and changed workflows. Checks used local simulations and read-only GitHub access.
  • Regression checks after review

  • Seven assertions failed on the reviewed revision across the five findings. All 14 focused cases passed after the fixes. Fix commit

  • A Git fixture rejected an off-main prod tag and admitted the same tag for dev and stage. The callback guard rejected AWS single-component requests before OIDC.

  • The actual mbuild import command and Pulumi program used the same API digest from the published v0.16.1 manifest. API-only apply also passed with just one image digest.

  • Full previews and applies use the candidate CLI's default component scope. The v0.13.1 parser rejected the reviewed workflow's explicit full-scope argument and accepted the corrected invocation.
  • Design review

    The reviews called out response-body deadlines, malformed receipts and token access to approval history. Tests exercise the response failures and the read-only workflow verifies access. Combined design · Environment design

    Static Slack secret references preserve channel selection when the chosen webhook is empty. CodeQL thread and fix

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: DefeatMan Review duration: 2176m
    All Vouch review confidence checks passed
    Residual risk 0.43 = Change Risk (0.75) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.75 · 650 lines diff across 8 files
    0.75
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Sensitive Paths sensitive_paths
    0.075
    Real PR Conversation Timeline
    1 comments
    "Review active on #3286"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 43.0% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 75.2% (HIGH) · Higher = larger blast radius
    75.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 42.9% · Moderate risk
    42.9%