pipe-cd / pipe-cd/pipecd

fix(pkg/config): use provider type instead of name in unsupported type error messages

Open Beginner friendly
#6,931 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.