Repository navigation
feat(AF-992): map ticket resolution onto a deployment decision - #1184
Merged
Merged
Conversation
Contributor
Frontend Test Results 1 files 341 suites 9m 49s ⏱️ Results for commit 6ae02ba. |
Contributor
Coverage Report for Frontend Coverage (frontend)
File CoverageNo changed files found. |
Contributor
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 #992 (part of epic #989).
What
A signed ServiceNow / Jira status callback now reaches deployment change tickets as well as query tickets.
TicketingInboundServicechecksquery_ticketsfirst (a query ticket still wins), then falls back todeployment_tickets. If neither matches, the result isignored.APPROVED/REJECTED/ null) on thedeployment_ticketsrow, whether or notbidirectional_syncis on. It also writesTICKET_STATUS_SYNCEDagainstdeployment_ticket.bidirectional_syncon, the still-PENDING_REVIEWdeployment is decided through the newworkflow.api.ExternalDecisionService.applyDeploymentTicketDecision. That method delegates to the newdeploygov.api.DeploymentExternalDecisionService.workflowbecauseworkflow → deploygovalready exists, anddeploygovusescore.api.DecisionType.deployment_review_decisionsrowDEPLOYMENT_APPROVED/DEPLOYMENT_REJECTEDaudit row with a null actor,trigger=ticket, andticket_system/external_key/channel_id/actor/pipeline_id/versionDeploymentDecidedEvent(..., "ticket:<SYSTEM>:<key>"), so the submitter is notified with no listener changefalse→ the webhook answerssyncedDeviations from the issue sketch
DeploymentTicketProvenancerecord instead of a barereasonstring, so the audit metadata the issue requires (ticket_system,external_key,channel_id,actor) is exact.DeploymentRequestRepository.findByIdForUpdate(PESSIMISTIC_WRITE) instead ofstateService.require. This means a missing row returnsfalse, and a concurrent manual decision can never leave a ticket-attributed audit row behind for a transition that then fails to commit. The audit log writes on its own connection, so without the lock that row would commit even when the status change did not.Docs / website
docs/03-data-model.md,docs/18-deployment-governance.md: theticketaudit triggerdocs/04-api-spec.md: webhook resolution orderdocs/05-backend.md: deployment paragraph under External ticket decisions, and thetickettriggerdocs/08-notifications.md: the deployment section, including the self-approval caveat (theactoris free text, so a submitter approving their own change ticket is not stopped; keep sync off if you need that guarantee). It also says the gate conjunct that reads the stamp is deploygov: gate requires an approved ticket on change_ticket_required environments #993, not built yetwebsite/docs/configuration/notifications/,website/docs/guides/notifications/(dates bumped in JSON-LD, visible date and sitemap), andhelp-corpus/regeneratedCLAUDE.mddeploygov entryTests
DefaultDeploymentExternalDecisionServiceTestDefaultExternalDecisionServiceTestandTicketingInboundServiceTest(unknown in both tables, query ticket wins, sync off still stamps, unmapped status stamps null, approve and reject applied, raced decision →synced, audit failure swallowed)DeploymentTicketWebhookIntegrationTest: signed HTTP callback to/api/v1/integrations/jira/webhook/{channelId}, sync on and sync off, asserting the ticket decision, the request status and the audit rowsVerified locally: spotless + checkstyle; all deploygov, notifications and workflow tests plus
ApplicationModulesTest/ApiPackageDependencyTest(3064 tests, green);MessagesParityTest; website guards (npm run test:coverage); help-corpus drift (byte-identical). Not run: the fullmvn verify -Pcoverage.No e2e spec covers the ticketing webhook and there is no frontend change, so no e2e update. No UI change, so no screenshots.
Review notes
DEPLOYMENT_*audit row. Fixed with the row lock above, and the inbound-service catch for that case was removed. af-reviewer also asked for thetickettrigger in docs 03/05/18, which is done. Its other point, that docs/18 has no change-ticket chapter yet, is left for the epic's docs sweep.DeploymentRequestStateService.markTimedOutandDeploymentReviewStateMachinehave the same audit-before-commit ordering. That existed before this PR and is not touched here.