Repository navigation
Report deployment failure when pipedv1 planner cannot prepare deploy source - #7649
Open
vikash7485 wants to merge 3 commits into
Open
vikash7485 wants to merge 3 commits into
vikash7485 wants to merge 3 commits into
Conversation
…source When the planner failed to prepare the target or running deploy source, for example because the commit does not exist or the repository could not be cloned, it only logged the error. The deployment stayed PENDING and the application stayed marked as deploying, and the planner retried it again after an hour. Report the deployment as failed and send the failure notification, as already done when building the plan fails. If piped is shutting down, keep the deployment PENDING so it is planned again after restarting. Fixes pipe-cd#7641 Signed-off-by: vikash7485 <vikkiraj073@gmail.com>
vikash7485
requested review from
Warashi,
mohammedfirdouss and
t-kikuc
and
a balanced review from Copilot
November 18, 2026 19:30
👷 Deploy request for pipecd-site pending review.Visit the deploys page to approve it
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Cancellation queued during source preparation can be ignored if preparation fails, incorrectly reporting FAILURE and sending a failure notification instead of reporting CANCELLED and acknowledging the command.
1 open issue
What changed in this PR
Fixes #7641 by routing pipedv1 deploy-source preparation errors through deployment failure reporting, rather than leaving deployments stuck in PENDING.
Changes:
- Reports target and running source preparation failures with a reason and failure notification.
- Preserves PENDING when the planner context is cancelled during shutdown.
- Adds regression tests for both failure paths and shutdown cancellation.
| File | Description |
|---|---|
pkg/app/pipedv1/controller/planner.go |
Adds shared source-failure reporting with a shutdown guard. |
pkg/app/pipedv1/controller/planner_deploysource_test.go |
Tests failure status, notifications, and shutdown behavior. |
Review effort: Balanced
…oy source If a deployment was cancelled while its deploy source was being prepared and the preparation then failed, it was reported as failed and the cancel command was never marked as handled. Check for the cancel command before reporting the failure, reusing the same handling as after building the plan. Signed-off-by: vikash7485 <vikkiraj073@gmail.com>
Member
Contributor
Author
|
Thanks @harshitghagre |
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 this PR does:
In pipedv1, when the planner fails to prepare the target or running deploy source (for example the commit doesn't exist, the repository can't be cloned, or a secret can't be decrypted), it only logged the error and returned. This PR reports the deployment as
DEPLOYMENT_FAILUREand sends the failure notification, the same way the existingbuildPlanerror path already does.If piped is shutting down (the context is cancelled), the deployment is left PENDING so it is planned again after restarting, instead of being marked as failed.
In piped v0 the deploy source is prepared inside
planner.Plan, so these errors were already reported as failures there. pipedv1 prepares it beforebuildPlan, which skipped that reporting.Why we need it:
The deployment stayed PENDING forever, the application stayed marked as deploying, and no failure was shown or notified. The controller then retried the same deployment after
plannerStaleDuration(1 hour) and failed again.Which issue(s) this PR fixes:
Fixes #7641
Does this PR introduce a user-facing change?:
Tests:
The two failure tests fail without this change.