fix(sqldef): replace panic with error return in ExecuteStage - #50
Open
vanshika2720 wants to merge 1 commit into
Open
fix(sqldef): replace panic with error return in ExecuteStage#50vanshika2720 wants to merge 1 commit into
vanshika2720 wants to merge 1 commit into
Conversation
ExecuteStage panicked on an unrecognized stage name. The stage name originates from the pipeline configuration, so a typo or unsupported stage would crash the plugin process instead of failing the deployment cleanly. Return a descriptive error instead, matching the existing error-returning signature of this method. Signed-off-by: Vanshika <pahalvanshikaa@gmail.com>
Author
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
Replaces the
panic()in the SQLDef deployment plugin'sExecuteStagewith a descriptive error return when an unrecognized stage name is provided.Adds a regression test covering the previously-panicking path and verifies that the returned error contains the invalid stage name.
Why we need it / Without this PR, what is the problem?
input.Request.StageNamecomes from the deployment pipeline configuration. A typo, stale configuration after a stage rename, or an unsupported stage could previously trigger a panic and crash the plugin process instead of failing the affected deployment stage cleanly.Returning an error uses
ExecuteStage's existing(*sdk.ExecuteStageResponse, error)signature and allows PipeCD to handle the failure through its normal stage-failure path while keeping the plugin process running.This also matches the existing error-handling pattern used by other plugins for unrecognized stages.