Skip to content

fix(sqldef): replace panic with error return in ExecuteStage - #50

Open
vanshika2720 wants to merge 1 commit into
pipe-cd:mainfrom
vanshika2720:fix/sqldef-panic-error-handling
Open

fix(sqldef): replace panic with error return in ExecuteStage#50
vanshika2720 wants to merge 1 commit into
pipe-cd:mainfrom
vanshika2720:fix/sqldef-panic-error-handling

Conversation

@vanshika2720

Copy link
Copy Markdown

What this PR does

Replaces the panic() in the SQLDef deployment plugin's ExecuteStage with 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.StageName comes 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.

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>
@vanshika2720
vanshika2720 requested review from a team and kadai0308 as code owners August 4, 2026 14:55
@vanshika2720

Copy link
Copy Markdown
Author

@t-kikuc @khanhtc1202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant