fix(pkg/config): use provider type instead of name in unsupported type error messages
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 364
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 84
Description
Description
The error messages returned by PipedPlatformProvider.MarshalJSON() and PipedAnalysisProvider.MarshalJSON() incorrectly display the provider's Name rather than the invalid Type when an unsupported provider type is encountered.
Current Behavior
In pkg/config/piped.go, the following error messages are generated:
default:
err = fmt.Errorf("unsupported platform provider type: %s", p.Name)
default:
err = fmt.Errorf("unsupported analysis provider type: %s", p.Name)
As a result, users see the provider name instead of the actual invalid type value.
Example:
platformProviders:
- name: my-provider
type: UNKNOWN_TYPE
Current error:
unsupported platform provider type: my-provider
Expected Behavior
The error should report the unsupported type value:
unsupported platform provider type: UNKNOWN_TYPE
Benefits
- Improves debugging experience.
- Makes error messages accurate and actionable.
- Reduces confusion when diagnosing configuration issues.
- No functional behavior changes; only error message output is corrected.
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/config/piped.go by reading PipedPlatformProvider.MarshalJSON() and PipedAnalysisProvider.MarshalJSON(), especially their default error branches. Verify the unsupported provider example with type UNKNOWN_TYPE, then confirm both errors report the invalid Type value rather than the provider Name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100