pipectl migrate application-config panics on malformed application configuration
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 364
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 84
Description
What happened
pipectl migrate application-config panics when the input application configuration is malformed instead of returning a descriptive validation error.
The panic occurs when the input configuration is missing required fields such as spec. Instead of reporting an invalid configuration, the command terminates with a Go panic:
panic: interface conversion: interface {} is nil, not map[string]interface {}
The panic originates from:
pkg/app/pipectl/cmd/migrate/application_config.go:142
What you expected to happen
The command should validate the input application configuration and return a descriptive error (for example, indicating that the required spec field is missing or invalid) instead of panicking.
How to reproduce it
- Create a file named
bad.yamlwith the following content:
kind: KUBERNETES
- Run the migration command:
go run ./cmd/pipectl migrate application-config --config-files bad.yaml
- Observe that the command panics with:
panic: interface conversion: interface {} is nil, not map[string]interface {}
Stack trace (truncated):
panic: interface conversion: interface {} is nil, not map[string]interface {}
github.com/pipe-cd/pipecd/pkg/app/pipectl/cmd/migrate.(*applicationConfig).migrateApplicationConfig(...)
pkg/app/pipectl/cmd/migrate/application_config.go:142
Environment
pipedversion: N/A (issue reproduced usingpipectl)control-planeversion: N/A- Others:
- PipeCD branch:
master - Commit:
5b81c813b - Go version:
go1.26.2 - OS: macOS (Apple Silicon)
- PipeCD branch:
Additional context
From the investigation, the panic is caused by unchecked type assertions while reading the parsed YAML (for example, assuming the spec field is always present and has the expected type). Returning a validation error instead of panicking would make the migration command more robust when handling malformed input.
If this behavior is considered a bug, I'd be happy to work on a fix and submit a PR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/app/pipectl/cmd/migrate/application_config.go at the unchecked parsing around line 142, then reproduce with bad.yaml containing only kind: KUBERNETES and the documented pipectl command. Trace how the parsed YAML reads spec and identify the validation path. Done means malformed configurations return a descriptive validation error instead of panicking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100