Skip to content

fix: avoid panic on missing application spec during migration#6983

Open
CodeWith-sakib wants to merge 3 commits into
pipe-cd:masterfrom
CodeWith-sakib:fix/migrate-app-config-panic
Open

fix: avoid panic on missing application spec during migration#6983
CodeWith-sakib wants to merge 3 commits into
pipe-cd:masterfrom
CodeWith-sakib:fix/migrate-app-config-panic

Conversation

@CodeWith-sakib

Copy link
Copy Markdown

What this PR does:

  • Prevents pipectl migrate application-config from panicking when the input application configuration is missing or has an invalid spec field.
  • Returns a descriptive validation error instead of panicking.
  • Adds a regression test covering this scenario.

Why we need it:

Currently, the migration command performs an unchecked type assertion on the spec field. When the field is missing or malformed, the command terminates with a Go panic instead of reporting a validation error. This change makes the migration command more robust and improves the user experience when handling invalid input.

Which issue(s) this PR fixes:

Fixes #6980

Does this PR introduce a user-facing change?:
Yes

  • How are users affected by this change:
    Users now receive a descriptive error message instead of a panic when running pipectl migrate application-config with an invalid application configuration that is missing or has an invalid spec field.

  • Is this breaking change:
    No.

  • How to migrate (if breaking change):
    N/A

Signed-off-by: Mohammad Sakib <mohammadsakib00978@gmail.com>
@CodeWith-sakib CodeWith-sakib requested a review from a team as a code owner July 6, 2026 10:45

@rahulshendre rahulshendre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch @CodeWith-sakib 🙌

@mohammedfirdouss @khanhtc1202 PTAL, when you have time

@mohammedfirdouss

Copy link
Copy Markdown
Contributor

nice catch @CodeWith-sakib 🙌

@mohammedfirdouss @khanhtc1202 PTAL, when you have time

LGTM @rahulshendre

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pipectl migrate application-config panics on malformed application configuration

3 participants