feat(pipeline): add image-only deployment rollback#45
Merged
Conversation
Roll back a deployment to a previous pipeline's image without rebuilding.
Rollback creates a new Pipeline record (preserving history) marked with
triggerType=ROLLBACK and rollbackFromPipelineId, copies the historic
artifact, skips the build step, and deploys straight through the existing
artifact deploy chain. Runtime spec, service config, and env-var ConfigMap
stay at the application's current values (12-factor: config decoupled from
release); full config rollback is deliberately out of scope.
Backend:
- new PipelineTriggerType {BUILD, ROLLBACK} enum + triggerType /
rollbackFromPipelineId fields on Pipeline (domain + JPA), Flyway V10
migration defaulting existing rows to BUILD
- Pipeline.rollback() factory; open state machine edge INITIALIZED -> DEPLOYING
- PipelineService.rollback() and POST .../pipelines/{id}/rollback endpoint
- ApplicationRuntimeGateway.findCurrentImage() + K8s impl, exposed via
GET .../applications/{name}/current-image?env= to highlight the live version
- PipelineDto exposes triggerType + rollbackFromPipelineId
Frontend:
- rollback button (SUCCEEDED pipelines with an artifact that aren't live),
confirm dialog, "live version" highlight, and rollback badge on the
pipelines page
- rollbackPipeline() / getCurrentImage() API clients; i18n in all 4 locales
Tests: PipelineStateMachineTests + PipelineRollbackTests (10 tests).
Move the rollback indicator out of the ID column into its own "Type" column on the pipelines table: BUILD renders a "Build" badge, ROLLBACK renders a "Rollback" badge, so normal builds are labelled explicitly instead of showing nothing. The "live version" highlight stays in the ID column. i18n added for all 4 locales.
Render the pipeline Type column as an icon + text (Rocket "Build" / Undo2 "Rollback") instead of badges, so it no longer competes visually with the adjacent Status badge. Rollback rows get a dotted-underline hover tooltip showing the source pipeline id (rollbackFromPipelineId) for traceability. i18n added for all 4 locales.
Drop the muted color on the Build label so Build and Rollback share the normal foreground color, consistent with the other columns. Replace the dotted-underline hover affordance with a small Info icon next to the Rollback label; hovering it shows the source pipeline id.
Owner
|
lgtm |
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.
What
Roll back a deployment to a previous pipeline's image without rebuilding.
A rollback creates a new
Pipelinerecord (preserving history) marked withtriggerType=ROLLBACKandrollbackFromPipelineId, copies the historic artifact, skips the build step, and deploys straight through the existing artifact deploy chain.Runtime spec, service config, and the env-var ConfigMap stay at the application's current values (12-factor: config decoupled from release). Full config rollback is deliberately out of scope for this first version.
Backend
PipelineTriggerType {BUILD, ROLLBACK}enum +triggerType/rollbackFromPipelineIdfields onPipeline(domain + JPA), FlywayV10migration defaulting existing rows toBUILD.Pipeline.rollback()factory; opened state-machine edgeINITIALIZED → DEPLOYING(rollback skips RUNNING/BUILD_SUCCEEDED).PipelineService.rollback()andPOST .../pipelines/{id}/rollbackendpoint.ApplicationRuntimeGateway.findCurrentImage()+ K8s impl, exposed viaGET .../applications/{name}/current-image?env=to highlight the live version.PipelineDtoexposestriggerType+rollbackFromPipelineId.Frontend
rollbackPipeline()/getCurrentImage()API clients; i18n across all 4 locales.Tests
PipelineStateMachineTests+PipelineRollbackTests— 10 tests, all green. Frontendpnpm buildpasses.Notes
isAuthenticated()— collaborators can roll back, consistent with deploy.