Skip to content

fix(azure-functions): replace panic with error returns in deployment plugin - #49

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

fix(azure-functions): replace panic with error returns in deployment plugin#49
vanshika2720 wants to merge 1 commit into
pipe-cd:mainfrom
vanshika2720:fix/azure-functions-panic-error-handling

Conversation

@vanshika2720

Copy link
Copy Markdown

What this PR does

Replaces two panic() calls in the Azure Functions deployment plugin with descriptive error returns.

  • ExecuteStage now returns an error when an unsupported pipeline stage name is provided.
  • DetermineVersions now returns an error when an unsupported application kind is provided.
  • Adds regression tests covering both error paths and the existing supported function kind.

Why we need it / Without this PR, what is the problem?

Both panic conditions are reachable through user-controlled configuration: the pipeline stage name and the application kind field.

A malformed or unsupported value would cause the plugin process to panic instead of failing the affected deployment cleanly. Since these methods already return error as part of their SDK-defined interfaces, returning a descriptive error uses the existing failure-handling path without requiring any additional machinery.

This keeps the plugin process running and provides an actionable error message for invalid configuration.

…plugin

ExecuteStage and DetermineVersions panicked on an unrecognized stage
name or application kind. Both values originate from user-controlled
pipeline/application config, so a typo or unsupported kind would crash
the plugin process instead of failing the deployment cleanly. Return
descriptive errors instead, matching the existing error-returning
signatures of these methods.

Signed-off-by: Vanshika <pahalvanshikaa@gmail.com>
@vanshika2720

Copy link
Copy Markdown
Author

@khanhtc1202 @t-kikuc

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