fix: cancel in-progress deploy on new webhook trigger (closes #38) #53
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#53
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "(deleted):fix/cancel-deploy-on-webhook"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When a webhook-triggered deploy starts for an app that already has a deploy in progress, the new deploy now cancels the existing one via context cancellation, waits for the lock to be released, and then starts the new deploy.
Changes
appCancels sync.Map) todeploy.ServiceDeploy()creates a cancellable context and registers it for the appCancelAppDeploy()method to cancel an in-progress deployErrDeployCancelledsentinel error for cancelled deploystriggerDeployment()now cancels in-progress deploys and retries until the lock is released (up to 30 attempts with 2s delay)fixes #38
CI Results
Tests
✅ All tests pass (
make test)Lint
✅ No new lint issues (
golangci-lint run ./...)Note: 1 pre-existing lint issue in
internal/handlers/tail_validation_test.go(testpackage) — not related to this PR.Closing as duplicate — PR #52 already addresses this issue with a cleaner approach.
Pull request closed