Skip to content

feat(AF-994): show the change ticket on deployments, env switch - #1186

Merged
babltiga merged 3 commits into
mainfrom
feature/AF-994-deployment-change-ticket-ui
Oct 22, 2026
Merged

babltiga merged 3 commits into
mainfrom
feature/AF-994-deployment-change-ticket-ui

Conversation

@babltiga

Copy link
Copy Markdown
Contributor

Closes #994 (part of epic #989).

What

The UI shows the deployment change ticket, and admins get a switch to require one:

  • Pipeline settings → Environments: a Change ticket switch (after Break-glass) and a matching table column. Help text under the switch warns that a ServiceNow or Jira channel must enable the deployment trigger, or the gate never opens.
  • Deployment detail: a Change ticket card showing the key (an external link with rel="noopener noreferrer"), the system, the status (with its resolution) and an approved / rejected tag. On a flagged environment with no ticket it reads "No change ticket linked yet". Two new gate-banner states: waiting for the change ticket (info) and the change ticket was rejected (warning).
  • /deployments: a Ticket column showing the key and its decision tag.
  • ServiceNow / Jira channel forms: a Deployment submitted trigger checkbox (DEPLOYMENT_SUBMITTED). Both forms share one trigger list.

Backend (deploygov)

  • DeploymentRequestView / DeploymentRequestResponse gain change_ticket_required (mirrors the environment flag) and change_ticket. Every request body carries them: list, detail, trigger, confirm-execution and outcome.
  • The "representative ticket" rule moved from DefaultDeploymentGateService.chooseTicket to DefaultDeploymentTicketService.representative, so the gate and the request views share one rule: newest rejected, else newest approved, else newest.
  • The list loads a whole page's tickets with one findAllByDeploymentRequestIdIn query, and skips it for an empty page.
  • The gate's nested ChangeTicket record became DeploymentChangeTicketResponse, shared by both responses. The wire shape is unchanged.

Deliberate deviation from the issue: the detail card reads change_ticket from the request body, not the gate. The page only queries the gate while the request is APPROVED, but the ticket is opened at PENDING_REVIEW, and reviewers need to see it then. The banner still reads the gate.

Docs / website

  • docs/04-api-spec.md → Deployment requests: the new fields, with an example.
  • docs/18-deployment-governance.md: a UI paragraph.
  • website/docs/guides/deployment-approval/: the environment switch, and what the deployment page shows when a release is not going out.
  • website/docs/configuration/notifications/: the deployment submitted trigger.
  • help-corpus/ regenerated.

Tests

  • Backend: DefaultDeploymentRequestServiceTest covers list batching (one query; skipped for an empty page), rejected-over-approved choice, no ticket or flag, and a missing environment. DeploygovWebModelsTest covers record mapping plus a snake_case / non-null JSON wire test of the request body. The gate tests still pass. mvn -o verify: BUILD SUCCESS, 11,415 tests.
  • Frontend: PipelineEnvironmentsTab (the switch round-trips on create and edit, the column), DeploymentDetailPage (the card with and without a ticket, link attributes, the decision tag, the waiting and rejected banners, hidden when not flagged), DeploymentListPage (the ticket column), ChangeTicketLink, and the color/label helpers. lint, typecheck, test:coverage (2,981 tests; 96.6 % lines / 89.1 % branches) and build are green.
  • E2E (main variant, run locally against the stack; 23/23 passed):
    • deployment-pipelines: toggles the switch and asserts the column.
    • deployment-review (new case): a flagged environment, then trigger, then approve. The gate answers releasable:false, change_ticket_required:true with no ticket, and the detail page shows waiting for the change ticket and No change ticket linked yet.
    • admin-notification-channels: the ServiceNow case ticks the new trigger and asserts DEPLOYMENT_SUBMITTED in the posted config.triggers.

Review notes

Reviewed by af-verifier, af-reviewer, af-java-reviewer, af-frontend-reviewer and af-content-reviewer. None found a Blocker. The content review's revise items have been fixed:

  • The API example used a ServiceNow change request; AccessFlow creates incidents.
  • The example showed decision: null, but nulls are omitted on the wire.
  • The notifications page wording was ambiguous.

Surviving concerns, attributed:

  • No NotificationsPage unit test (af-reviewer, af-frontend-reviewer). The issue asks for one, but there is no NotificationsPage test file in the repo, and pages are outside the coverage include list. The trigger is covered by the e2e ServiceNow case, which asserts the posted payload.
  • The environments screenshot on the website guide predates the new switch and column (af-reviewer, af-content-reviewer). Leave it for the release screenshot pass.
  • change_ticket_required is typed optional in the frontend even though the backend sends a primitive boolean (af-reviewer, af-frontend-reviewer). Kept optional, matching the issue's spec for the gate type. Making it required would touch every DeploymentRequest fixture across unrelated tests.
  • The request view shows a linked ticket even on an unflagged environment, while the gate reports none there (af-java-reviewer). This is intentional: a linked ticket is worth showing. A code comment now says so.
  • detailView now runs one extra ticket query on the confirm-execution and outcome paths (af-java-reviewer). Negligible, and accepted.

Screenshots

Deployments list with the Ticket column

Deployment detail: waiting for the change ticket, with the ticket card

Deployment detail: no change ticket linked yet

Pipeline environments with the Change ticket column

Edit environment: the Change ticket switch and its help text

ServiceNow channel form with the Deployment submitted trigger

Deployment request bodies (list, detail, trigger, confirm, outcome) carry
change_ticket_required and a change_ticket summary chosen by the same rule
as the gate; the list loads a page's tickets in one query.

The UI adds the Change ticket switch and column on pipeline environments,
a Change ticket card and waiting/rejected gate banners on the deployment
detail page, a Ticket column on /deployments, and the Deployment submitted
trigger on the ServiceNow / Jira channel forms.
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Frontend Test Results

    1 files  ± 0    342 suites  +1   9m 58s ⏱️ + 3m 7s
2 980 tests +12  2 980 ✅ +12  0 💤 ±0  0 ❌ ±0 
2 981 runs  +12  2 981 ✅ +12  0 💤 ±0  0 ❌ ±0 

Results for commit cbd4082. ± Comparison against base commit b007a2a.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report for Frontend Coverage (frontend)

Status Category Percentage Covered / Total
🟢 Lines 96.56% (🎯 90%) 4333 / 4487
🟢 Statements 95.31% (🎯 90%) 4785 / 5020
🟢 Functions 94.84% (🎯 90%) 1324 / 1396
🟢 Branches 89.12% (🎯 80%) 3106 / 3485
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
frontend/src/utils/enumLabels.ts 98.64% 100% 96.15% 98.64% 322, 330, 799, 857
frontend/src/utils/statusColors.ts 100% 100% 100% 100%
Generated in workflow #1601 for commit cbd4082 by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Backend Test Results

11 416 tests  +7   11 416 ✅ +8   12m 38s ⏱️ +43s
 1 219 suites ±0        0 💤 ±0 
 1 219 files   ±0        0 ❌  - 1 

Results for commit cbd4082. ± Comparison against base commit b007a2a.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Backend Code Coverage

Overall Project 95.16% 🍏
Files changed 100% 🍏

File Coverage
DefaultDeploymentTicketService.java 100% 🍏
DefaultDeploymentGateService.java 100% 🍏
DeploymentChangeTicketResponse.java 100% 🍏
DeploymentRequestResponse.java 100% 🍏
DeploymentGateResponse.java 100% 🍏
DeploymentRequestView.java 100% 🍏
DefaultDeploymentRequestService.java 99.58% 🍏

Postgres rounds TIMESTAMPTZ to the nearest microsecond, so truncating the
in-memory nanosecond instant can land one microsecond short on Linux CI.
@babltiga
babltiga merged commit 7bc919e into main Oct 22, 2026
35 checks passed
@babltiga
babltiga deleted the feature/AF-994-deployment-change-ticket-ui branch October 22, 2026 14:07
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: ticket link and status on the deployment page, environment setting

1 participant