Repository navigation
feat(AF-991): open change tickets for flagged deployments - #1175
Merged
Merged
Conversation
Contributor
Frontend Test Results 1 files 341 suites 12m 31s ⏱️ Results for commit 1b7dc0a. ♻️ This comment has been updated with latest results. |
Contributor
Coverage Report for Frontend Coverage (frontend)
File CoverageNo changed files found. |
Contributor
Backend Test Results11 369 tests 11 369 ✅ 12m 38s ⏱️ Results for commit 1b7dc0a. ♻️ This comment has been updated with latest results. |
Contributor
Backend Code Coverage
|
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 #991 (part of epic #989; builds on #990).
What
ServiceNow and Jira channels can now open a change ticket for a governed deployment. They do so only when the environment has
change_ticket_requiredand the channel carries the newDEPLOYMENT_SUBMITTEDtrigger. This PR covers outbound creation only: inbound sync is #992, the gate is #993 and the UI is #994.TicketingTrigger.DEPLOYMENT_SUBMITTEDmaps two events:DEPLOYMENT_SUBMITTEDandDEPLOYMENT_APPROVED. The ticket opens on whichever arrives first, because an auto-approved deployment never reaches review. No newNotificationEventType.TicketingNotificationStrategybranches on target. A deployment context is deduped per(channel, deployment)throughdeploygov.api.DeploymentTicketService.existsForand persisted viaRecordDeploymentTicketCommand.trigger_eventrecords which event opened the ticket. The audit row isTICKET_CREATEDagainst the newAuditResourceType.DEPLOYMENT_TICKET, withdeployment_request_idin its metadata. The query path is unchanged.correlation_id=accessflow-deployment-<id>; Jira adds adeploymentlabel.TicketDescriptionBuildergives deployments their own headlines ("Deployment to awaiting approval / approved ()"). The description lists pipeline, environment, version, commit, artifact, CI run, submitter, AI risk, freeze status, justification and the/deployments/{id}link. The default headline no longer says "on a datasource" when there is no datasource.NotificationContextgains a nestedDeploymentDetailscomponent, wired in through a compatibility constructor.NotificationContextBuilder.buildDeploymentpopulates it and now setsreviewUrlto/deployments/{id}, so deployment emails and chat messages get the "Open in AccessFlow" link (the templates were already guarded).DeploymentNotificationView.activeFreezeReason: resolved through the module-privateFreezeWindowEvaluator, and only for flagged environments. When the window has no reason, it falls back to the behavior name (HOLD/REJECT).Docs
docs/08-notifications.md— new "Deployment change tickets (notifications: create a change ticket on DEPLOYMENT_SUBMITTED #991)" section; updated the trigger bullets, the dedupe/correlation text, the event-table rows and the email-template notedocs/04-api-spec.md—triggersvalues for SERVICENOW/JIRAdocs/03-data-model.md—deployment_ticketresource type;change_ticket_required/deployment_ticketsnotes no longer say "nothing writes these rows"docs/05-backend.md— ticketing sectionfrontend/src/types/api.ts—TicketingTriggerunion widened (the checkbox lands in frontend: ticket link and status on the deployment page, environment setting #994)Verification
mvn -o verify -Pcoverage: 11,367 tests. The run surfaced 2 failures inDeploymentNotificationTest.neverOpensATicket, which pinned the old "no deployment event opens a ticket" rule. I updated that test to the new semantics and it is green. After the review fixes I re-ran the touched suites,ApplicationModulesTestandApiPackageDependencyTest, and they are green. I did not repeat the full verify after those fixes; CI will run it.lint,typecheckandbuildpass.Screenshots
No UI change — no screenshots.
Review notes
Four review agents ran:
af-verifier,af-reviewer,af-java-reviewerandaf-content-reviewer.docs/03-data-model.mdstill said nothing writesdeployment_tickets. Also fixed: the freeze-status wording, the bare follow-up references (now workflow: map ticket resolution onto a deployment decision #992/deploygov: gate requires an approved ticket on change_ticket_required environments #993), and the dedupe sentence.change_ticket_requiredenvironments. It no longer adds a query, or a failure mode, to every deployment notification.docs/04-api-spec.mdtrigger values; added the Jira trigger-off test.DEPLOYMENT_APPROVEDarrives, both can create a remote ticket. The link table keeps the first and the other stays unlinked in ServiceNow/Jira. The issue accepts this as the existing lost-race behaviour. It is documented in08-notifications.mdand is worth revisiting with the workflow: map ticket resolution onto a deployment decision #992 inbound sync.Checkbox.Groupoffers only the three query triggers. antd filters unregistered values on change, so editing an API-configured channel's triggers in the UI would silently dropDEPLOYMENT_SUBMITTED. frontend: ticket link and status on the deployment page, environment setting #994 adds the checkbox, so the two should ship together in 2.8.0.