fix: Treat bundled deployments as success instead of failure #212
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.
Summary
FIX: Treat bundled deployments as success instead of failure when ArgoCD deploys a newer commit that includes your changes.
Problem
Supersede detection was causing false negatives in fast-moving environments where multiple deployments happen in quick succession.
Error Example: https://github.com/monta-app/service-vehicle/actions/runs/21033832041/job/60476819578
Logs:
Root Cause: When comparison status is
ahead, it means the current revision IS ahead of the expected revision - i.e., the expected commit is an ancestor of the current commit. This means the changes ARE deployed, just bundled with other changes in the newer commit.The script was treating this as a failure (
exit 1), but it should be treated as success with a warning about bundling.Solution
Change the supersede detection logic:
Before:
aheadstatus → FAIL (exit 1)divergedstatus → FAIL (exit 1)After:
aheadstatus → SUCCESS with warning (changes ARE deployed in newer commit)divergedstatus → FAIL (branches have no common ancestry, changes might not be deployed)Changes
wait-sync.sh (lines 201-225)
New logic for
aheadstatus:Still fail on
divergedstatus:Git Comparison Status Reference
From GitHub's compare API (
base...head):ahead: head is ahead of base → base IS an ancestor of head ✅behind: head is behind base → base is NOT an ancestor of head ⏳identical: same commit → exact match ✅diverged: branches diverged → no common ancestry ❌In our case (
EXPECTED...CURRENT):ahead= Current ahead of Expected = Expected IS deployed in Current ✅behind= Current behind Expected = Keep waiting for ArgoCD to catch up ⏳diverged= Expected might NOT be in Current ❌Impact
✅ Fixes false negatives - Bundled deployments now succeed instead of failing
✅ Better warnings - Clear indication when deployment was bundled
✅ Correct behavior - Only fail when changes truly aren't deployed (diverged)
✅ Fast environments - Works correctly when multiple deployments happen quickly
Testing
After merge, workflows will:
🤖 Generated with Claude Code