Repository navigation
feat(AF-994): show the change ticket on deployments, env switch - #1186
Merged
Merged
Conversation
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.
Contributor
Contributor
Coverage Report for Frontend Coverage (frontend)
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
Contributor
Contributor
Backend Code Coverage
|
Postgres rounds TIMESTAMPTZ to the nearest microsecond, so truncating the in-memory nanosecond instant can land one microsecond short on Linux CI.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #994 (part of epic #989).
What
The UI shows the deployment change ticket, and admins get a switch to require one:
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.DEPLOYMENT_SUBMITTED). Both forms share one trigger list.Backend (deploygov)
DeploymentRequestView/DeploymentRequestResponsegainchange_ticket_required(mirrors the environment flag) andchange_ticket. Every request body carries them: list, detail, trigger, confirm-execution and outcome.DefaultDeploymentGateService.chooseTickettoDefaultDeploymentTicketService.representative, so the gate and the request views share one rule: newest rejected, else newest approved, else newest.findAllByDeploymentRequestIdInquery, and skips it for an empty page.ChangeTicketrecord becameDeploymentChangeTicketResponse, shared by both responses. The wire shape is unchanged.Deliberate deviation from the issue: the detail card reads
change_ticketfrom the request body, not the gate. The page only queries the gate while the request isAPPROVED, but the ticket is opened atPENDING_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
DefaultDeploymentRequestServiceTestcovers list batching (one query; skipped for an empty page), rejected-over-approved choice, no ticket or flag, and a missing environment.DeploygovWebModelsTestcovers 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.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) andbuildare green.deployment-pipelines: toggles the switch and asserts the column.deployment-review(new case): a flagged environment, then trigger, then approve. The gate answersreleasable:false, change_ticket_required:truewith 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 assertsDEPLOYMENT_SUBMITTEDin the postedconfig.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:
decision: null, but nulls are omitted on the wire.Surviving concerns, attributed:
NotificationsPageunit 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.change_ticket_requiredis typed optional in the frontend even though the backend sends a primitiveboolean(af-reviewer, af-frontend-reviewer). Kept optional, matching the issue's spec for the gate type. Making it required would touch everyDeploymentRequestfixture across unrelated tests.detailViewnow runs one extra ticket query on the confirm-execution and outcome paths (af-java-reviewer). Negligible, and accepted.Screenshots