Skip to content

feat(AF-1027): verification settings, timeline stage and samples UI - #1236

Merged
babltiga merged 2 commits into
mainfrom
feature/AF-1027-deploygov-verification-ui
Nov 11, 2026
Merged

babltiga merged 2 commits into
mainfrom
feature/AF-1027-deploygov-verification-ui

Conversation

@babltiga

Copy link
Copy Markdown
Contributor

Closes #1027 (part of epic #1022).

What

Makes post-deployment verification configurable and visible in the web UI. The UI decides nothing and never says AccessFlow rolled anything back.

  • Environment modal (PipelineEnvironmentsTab): a Post-deployment verification section. A switch reveals window / interval / failure threshold and up to ten checks; a check-type Select (not Segmented) swaps the HTTP fields (URL, expected status, body contains) for the PromQL ones (Prometheus URL, query, comparator, threshold, no-data switch). Turning it off sends verification: null on create and clear_verification: true on edit. A Verification column shows the check count. Pure form logic and client rules are in the new verificationForm.ts.
  • 422 messages: the server's detail for DEPLOYMENT_VERIFICATION_INVALID is one generic sentence, so the form turns reason + checkName into a translated message that names the failed rule (unknown reason → server detail).
  • Detail page:
    • a Verification row beside drift and a card with the request's config snapshot, timestamps and the samples table;
    • a timeline stage after the outcome stage;
    • 10 s polling while RUNNING, plus one more samples fetch when the window closes;
    • a breach (FAILED + SUCCEEDED) shows "verification failed — the release is still running … AccessFlow did not roll back". Once the pipeline reports ROLLED_BACK, the callout says that instead. The release stage keeps reading as released;
    • SKIPPED machine tokens (no verification configured, outcome:FAILED) are translated, and a request that was never sampled gets no card.
  • List: a verification tag in the outcome cell (SKIPPED left out — see Review notes).
  • Backend (small, agreed before implementation): the request response gains verification_snapshot — window, sample_interval, failure_threshold, check_count — decoded from the existing deployment_requests.verification_config, fail-soft to null. It deliberately carries no check names, URLs or queries: request detail is readable by submitters and reviewers, while environment config is admin-only.
  • i18n: every string through t(), all seven locales.

Validation parity

The form mirrors DeploymentVerificationConfigRequest / DeploymentVerificationCheckRequest and the network-free #1024 rules:

  • window 1–1440 min; interval 0.5 min–window; threshold 1–20 and ≤ ⌊window / interval⌋;
  • 1–10 checks; name required, ≤ 64, unique;
  • URL / Prometheus URL required, ≤ 2048, http(s), with a host and no user:password@; no query or fragment on a Prometheus URL;
  • expected status 100–599; body ≤ 1024; query ≤ 4096; comparator and threshold required on PromQL.

Host policy (resolution, restricted addresses, allow-list) is server-only.

Docs

Tests

  • Backend: mvn verify green (12,173 tests). New service tests (snapshot present / absent / unreadable) and response-mapping + snake_case wire-shape tests.
  • Frontend: lint (0 errors), typecheck, build, test:coverage — 3,236 tests, 96.7 % lines / 89.8 % branches. New verificationForm.test.ts; extended tab, timeline, detail, list, enum-label, color and API tests.
  • e2e: new deployment-verification.spec.ts, plus the existing deployment-pipelines / versions / review specs — 19/19 locally on a rebuilt stack. ACCESSFLOW_DEPLOYGOV_VERIFICATION_CHECK: PT5S added to the e2e backend.

Deviations from the issue

  • e2e failing URL is http://mock-ai:8080/verification-health (WireMock 404) instead of http://verification.invalid/health, which the save-time host_unresolvable rule would refuse.
  • The e2e spec doesn't assert the transient RUNNING stage (step 10b): with a 5 s job tick it usually ends before the page loads. Unit tests cover RUNNING.
  • The list does not tag SKIPPED: it would tag every deploy to an environment with no checks (seen in a capture). The detail page and timeline still show it.

Review notes

Five read-only reviewers ran (verifier, cross-cutting, Java, frontend, content). No blockers. Fixed from their findings:

  • generic 422 detail → reason mapping, and a test against the real wire shape (cross-cutting);
  • unmirrored userinfo and query rules (cross-cutting);
  • stale samples after the window closes (frontend);
  • "still running" callout after ROLLED_BACK (content / frontend);
  • raw SKIPPED tokens (frontend);
  • ambiguous doc wording (content);
  • snake_case wire-shape test and a debug log on an unreadable snapshot (Java).

Concerns left open:

  • Duplicate-name rule (frontend nit): it has no dependencies on sibling rows, so a stale duplicate-name error can linger on the other row until the next save.
  • e2e helper typing (frontend nit): the new verification option is typed Record<string, unknown>, so a wire-key typo isn't caught at compile time.
  • List-read cost (Java): list reads now decode the snapshot JSON per row. It's small, but I haven't measured it.

Screenshots

Environments table with Verification column
Verification section — HTTP check
Verification section — PromQL check
Detail page — breach callout
Detail page — verification card, samples, timeline stage
Deployments list — verification tag

Environment modal gains a post-deployment verification section (HTTP and
PromQL checks, client rules mirroring #1023/#1024). The deployment detail
page shows a verification row, card with the config snapshot and samples,
a timeline stage after the outcome, and a did-not-roll-back callout on a
breach; the list tags the verification status. The request response now
carries verification_snapshot (window, interval, threshold, check count —
no check targets). New e2e spec drives a breach against WireMock.
Name the failed rule of a 422 DEPLOYMENT_VERIFICATION_INVALID from its
reason/checkName (its detail is generic); mirror the userinfo and
Prometheus query/fragment rules client-side; refetch samples when the
window closes; outcome-aware breach callout after ROLLED_BACK; translate
SKIPPED tokens and hide the empty card; hide SKIPPED in the list; pin the
snapshot wire shape; doc wording fixes.
@github-actions

Copy link
Copy Markdown
Contributor

Frontend Test Results

    1 files  ± 0    361 suites  +1   5m 47s ⏱️ -39s
3 234 tests +49  3 234 ✅ +49  0 💤 ±0  0 ❌ ±0 
3 236 runs  +49  3 236 ✅ +49  0 💤 ±0  0 ❌ ±0 

Results for commit fdbe7c5. ± Comparison against base commit d3bacb0.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for Frontend Coverage (frontend)

Status Category Percentage Covered / Total
🟢 Lines 96.74% (🎯 90%) 4578 / 4732
🟢 Statements 95.47% (🎯 90%) 5067 / 5307
🟢 Functions 94.94% (🎯 90%) 1408 / 1483
🟢 Branches 89.79% (🎯 80%) 3386 / 3771
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
frontend/src/api/deploymentRequests.ts 94.44% 100% 81.81% 92.59% 14, 16
frontend/src/components/deployments/verificationForm.ts 98.38% 96.36% 100% 100% 184
frontend/src/pages/deployments/buildDeploymentTimelineStages.ts 100% 95.77% 100% 100%
frontend/src/utils/enumLabels.ts 98.74% 100% 96.46% 98.74% 334, 342, 836, 894
frontend/src/utils/statusColors.ts 100% 100% 100% 100%
Generated in workflow #1711 for commit fdbe7c5 by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

Backend Test Results

12 174 tests  +4   12 174 ✅ +4   11m 56s ⏱️ + 2m 49s
 1 266 suites ±0        0 💤 ±0 
 1 266 files   ±0        0 ❌ ±0 

Results for commit fdbe7c5. ± Comparison against base commit d3bacb0.

@github-actions

Copy link
Copy Markdown
Contributor

Backend Code Coverage

Overall Project 95.48% 🍏
Files changed 100% 🍏

File Coverage
DeploymentRequestResponse.java 100% 🍏
DeploymentRequestView.java 100% 🍏
DeploymentVerificationSnapshotView.java 100% 🍏
DefaultDeploymentRequestService.java 99.62% 🍏

@babltiga
babltiga merged commit 4e65ad0 into main Nov 11, 2026
35 checks passed
@babltiga
babltiga deleted the feature/AF-1027-deploygov-verification-ui branch November 11, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

frontend: environment verification settings and verification timeline

1 participant