Repository navigation
feat(AF-990): persist deployment change tickets and env flag - #1174
Merged
Merged
Conversation
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 #990 (part of epic #989).
What
This is the persistence and API groundwork for deployment change tickets. No ticket is created, no webhook is handled, and gate, review, routing and notification behaviour do not change.
add_deployment_change_ticketsdeployment_environments.change_ticket_required BOOLEAN NOT NULL DEFAULT FALSE.deployment_ticketstable:deployment_request_idis a foreign key withON DELETE CASCADE.organization_idandchannel_idare bare UUIDs (no foreign key), following the V149 convention.(channel_id, deployment_request_id)and(channel_id, external_id), plus an index on the request.decisionisAPPROVED/REJECTED/ null, enforced bychk_deployment_tickets_decision, with adecided_attimestamp.deploygov.apitypes:DeploymentTicketService,DeploymentTicketViewandRecordDeploymentTicketCommand, implemented by the package-privateDefaultDeploymentTicketService.decisionis always overwritten.decided_atis stamped when the decision changes to a non-null value, kept when the same decision is sent again, and cleared when the decision becomes null.changeTicketRequiredon environments: threaded through the create/update commands, the view and its mapper, the web request/response records, andDefaultDeploymentPipelineAdminService.false.DeploymentNotificationView: gainschangeTicketRequired,commitSha,artifactRefandrunUrlfor notifications: create a change ticket on DEPLOYMENT_SUBMITTED #991.Docs
docs/03-data-model.md: adds a V202 paragraph todeployment_environmentsand a new### deployment_ticketssection.docs/04-api-spec.md: addschangeTicketRequiredto the environment create/update fields and responses.Tests
DefaultDeploymentTicketServiceTest(8 tests).DeploymentTicketPersistenceIntegrationTest(Testcontainers,ddl-auto=validate). It covers:null/falsearguments in about 20 existing test files across deploygov, schemachange, serviceaccounts and notifications. These edits are mechanical: no assertion changed.ApplicationModulesTest,ApiPackageDependencyTest, and every deploygov / schemachange / deployment-notification /OnBehalfOfIntegrationTestclass passed (1455 tests, 0 failures). The ticket IT was then re-run after the CHECK constraint was added: 6/6 passed.No UI change, so no screenshots.
Review notes
None of af-reviewer, af-java-reviewer or af-content-reviewer reported a blocker.
Applied:
decisionCHECK constraint (af-java-reviewer, af-reviewer).decided_atwording and a "persistence only, no writer yet" qualifier in the data model (af-content-reviewer, af-reviewer).Remaining:
docs/04-api-spec.mdnames environment fields in camelCase (changeTicketRequired), but the wire uses global SNAKE_CASE, so the actual key ischange_ticket_required. The whole section already does this (allowBreakGlass,datasourceId, …), so I followed its convention rather than mixing styles. Worth fixing section-wide in deploygov: change-ticket documentation sweep #995.change_ticket_required. The deploygov controller tests call controller methods directly, and the key comes from the global naming strategy like every other field.DeploymentTicketRepository.findAllByDeploymentRequestIdhas no production caller yet. It is reserved for the gate (deploygov: gate requires an approved ticket on change_ticket_required environments #993), per the issue.