fix: force rollout on same-version app redeploy#18915
fix: force rollout on same-version app redeploy#18915martinothamar-agent wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis change introduces a deployment ID identifier that flows from the database-assigned deployment sequence number through the Azure DevOps pipeline queueing parameters and into the Kubernetes pod annotations. The designer service captures the repository-assigned ChangesDeployment ID tracking and pipeline integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Have you manually tested the full path? Example experiment that could be useful
ensure that we actually get the behavior we want:
are you able to do that? |
|
Yes, I was able to run a local full-path experiment through Flux/Helm in a disposable kind cluster. What I tested:
Test sequence and observed result: Helm history after the failed same-tag upgrade showed the failed upgrade and rollback: Then I fixed the runtime config and redeployed the same image tag with a new deployment id: Final Helm history ended with: So the experiment verifies both properties we care about:
One useful detail from the first attempt: with the default rolling Deployment strategy, Helm considered the upgrade applied while the new pod was crashing because the old pod was still available. For the final experiment I used |
what do we use for the latest version of the altinn-studio-charts deployment helm chart which the apps use? |
|
Good catch. I checked the actual app path now. For apps, For that chart/version:
spec:
interval: 5m
install:
remediation:
retries: 1
upgrade:
remediation:
retries: 1
So my final kind experiment was stricter than the actual app chart on the failure/rollback part: I used The part that is directly representative for this PR is the same-version rollout trigger: Given this, I would phrase the manual verification more narrowly: it verifies the pod-template rollout mechanism under Flux/Helm after a rollback, but it is not an exact reproduction of the current chart's failure detection settings. The observed |
Description
DEPLOYMENT_ID.DEPLOYMENT_IDin generated Helm values aspodAnnotations.altinn.studio/deployment-id.DEPLOYMENT_IDfor app OCI deployments so same-version redeploys cannot silently miss the rollout marker.Previously, retrying deployment of the same release could leave the rendered runtime Deployment unchanged: the image tag stayed the same, and the Azure DevOps build id only appeared on HelmRelease metadata. After a Helm/Flux rollback, refreshing the app config artifact was therefore not guaranteed to produce a new Kubernetes pod template. The deployment id annotation is part of
spec.values, and the deployment chart renderspodAnnotationsinto the Kubernetes Deployment pod template, so every logical Designer deployment attempt creates a rollout-relevant desired-state change even when the app version/tag is unchanged.I also inspected the frontend deployment status logic. It keeps
PipelineSucceededas in-progress for normal deployments for 15 minutes unless a final Flux event arrives, but after that it can still show success based only on the pipeline event. I left that out of this PR because it is a separate UX/status semantics change from forcing the actual rollout.Verification
Automated:
Formatting/YAML checks:
Manual HelmRelease values verification:
I mirrored the pipeline merge with
mikefarah/yq:4.45.1using normalized values containing an existing pod annotation and overrides containingaltinn.studio/deployment-id: "42". The resulting HelmReleasespec.values.podAnnotationswas:This verifies the generated HelmRelease values include:
cc @martinothamar
Summary by CodeRabbit
Release Notes
New Features