Skip to content

feat(AF-991): open change tickets for flagged deployments - #1175

Merged
babltiga merged 2 commits into
mainfrom
feature/AF-991-deployment-change-ticket-creation
Oct 21, 2026
Merged

babltiga merged 2 commits into
mainfrom
feature/AF-991-deployment-change-ticket-creation

Conversation

@babltiga

Copy link
Copy Markdown
Contributor

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_required and the channel carries the new DEPLOYMENT_SUBMITTED trigger. This PR covers outbound creation only: inbound sync is #992, the gate is #993 and the UI is #994.

  • TicketingTrigger.DEPLOYMENT_SUBMITTED maps two events: DEPLOYMENT_SUBMITTED and DEPLOYMENT_APPROVED. The ticket opens on whichever arrives first, because an auto-approved deployment never reaches review. No new NotificationEventType.
  • TicketingNotificationStrategy branches on target. A deployment context is deduped per (channel, deployment) through deploygov.api.DeploymentTicketService.existsFor and persisted via RecordDeploymentTicketCommand. trigger_event records which event opened the ticket. The audit row is TICKET_CREATED against the new AuditResourceType.DEPLOYMENT_TICKET, with deployment_request_id in its metadata. The query path is unchanged.
  • ServiceNow correlation_id=accessflow-deployment-<id>; Jira adds a deployment label.
  • TicketDescriptionBuilder gives 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.
  • NotificationContext gains a nested DeploymentDetails component, wired in through a compatibility constructor. NotificationContextBuilder.buildDeployment populates it and now sets reviewUrl to /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-private FreezeWindowEvaluator, and only for flagged environments. When the window has no reason, it falls back to the behavior name (HOLD/REJECT).
  • Break-glass, rejected and outcome-failed deployment events never open a ticket.

Docs

Verification

  • mvn -o verify -Pcoverage: 11,367 tests. The run surfaced 2 failures in DeploymentNotificationTest.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, ApplicationModulesTest and ApiPackageDependencyTest, and they are green. I did not repeat the full verify after those fixes; CI will run it.
  • Frontend lint, typecheck and build pass.

Screenshots

No UI change — no screenshots.

Review notes

Four review agents ran: af-verifier, af-reviewer, af-java-reviewer and af-content-reviewer.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Frontend Test Results

    1 files    341 suites   12m 31s ⏱️
2 968 tests 2 968 ✅ 0 💤 0 ❌
2 969 runs  2 969 ✅ 0 💤 0 ❌

Results for commit 1b7dc0a.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report for Frontend Coverage (frontend)

Status Category Percentage Covered / Total
🟢 Lines 96.56% (🎯 90%) 4326 / 4480
🟢 Statements 95.31% (🎯 90%) 4778 / 5013
🟢 Functions 94.83% (🎯 90%) 1322 / 1394
🟢 Branches 89.11% (🎯 80%) 3104 / 3483
File CoverageNo changed files found.
Generated in workflow #1577 for commit 1b7dc0a by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Backend Test Results

11 369 tests   11 369 ✅  12m 38s ⏱️
 1 217 suites       0 💤
 1 217 files         0 ❌

Results for commit 1b7dc0a.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Backend Code Coverage

Overall Project 95.15% 🍏
Files changed 100% 🍏

File Coverage
TicketingTrigger.java 100% 🍏
NotificationContext.java 100% 🍏
AuditResourceType.java 100% 🍏
TicketDescriptionBuilder.java 100% 🍏
DeploymentNotificationView.java 100% 🍏
JiraNotificationStrategy.java 97.8% 🍏
ServiceNowNotificationStrategy.java 96.3% 🍏
TicketingNotificationStrategy.java 94.55% 🍏
DefaultDeploymentNotificationLookupService.java 93.42% 🍏
NotificationContextBuilder.java 90.99% 🍏

@babltiga
babltiga merged commit c616d1f into main Oct 21, 2026
35 checks passed
@babltiga
babltiga deleted the feature/AF-991-deployment-change-ticket-creation branch October 21, 2026 13:19
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.

notifications: create a change ticket on DEPLOYMENT_SUBMITTED

1 participant