Skip to content

fix(config): include unsupported type in SecretManagement unmarshal error - #7277

Open
SinghAman21 wants to merge 1 commit into
pipe-cd:masterfrom
SinghAman21:fix/secret-management-unmarshal-error
Open

fix(config): include unsupported type in SecretManagement unmarshal error#7277
SinghAman21 wants to merge 1 commit into
pipe-cd:masterfrom
SinghAman21:fix/secret-management-unmarshal-error

Conversation

@SinghAman21

Copy link
Copy Markdown
Contributor

What this PR does: Fixes the SecretManagement.UnmarshalJSON error message in pkg/config and pkg/configv1 to include the actual unsupported type (g.Type) instead of the empty s.Type.

Why we need it: Currently an unknown secret management type produces a misleading error like unsupported secret management type: (empty), making config validation failures hard to debug.

Which issue(s) this PR fixes:

Fixes #7084

Does this PR introduce a user-facing change?:

  • How are users affected by this change: Error messages for unsupported secret management types now include the invalid type value.
  • Is this breaking change: No
  • How to migrate (if breaking change): N/A

@SinghAman21
SinghAman21 requested a review from a team as a code owner August 29, 2026 18:09
@SinghAman21
SinghAman21 requested review from Warashi, ffjlabo and khanhtc1202 and a lite review from Copilot and removed request for Copilot August 29, 2026 18:09
@netlify

netlify Bot commented Aug 29, 2026

Copy link
Copy Markdown

Deploy Preview for pipecd-site canceled.

Name Link
🔨 Latest commit d8a639f
🔍 Latest deploy log https://app.netlify.com/projects/pipecd-site/deploys/6a945ce37fa1450009072b9b

…rror

Signed-off-by: SinghAman21 <singhaman1825@gmail.com>
@SinghAman21
SinghAman21 force-pushed the fix/secret-management-unmarshal-error branch from 51d8eaa to d8a639f Compare August 30, 2026 16:40
Copilot AI lite review requested due to automatic review settings August 30, 2026 16:40

Copilot AI 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.

Pull request overview

This PR fixes a misleading config validation error in SecretManagement.UnmarshalJSON (both pkg/config and pkg/configv1) by reporting the actual unsupported type value from the parsed JSON, making invalid configurations significantly easier to debug.

Changes:

  • Update SecretManagement.UnmarshalJSON to use g.Type (parsed value) in the unsupported-type error message.
  • Add unit tests in both config packages to cover unsupported and supported secret management types.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
pkg/configv1/piped.go Fix error message to include the unsupported secret management type value from JSON.
pkg/configv1/piped_test.go Add tests verifying UnmarshalJSON error message and successful decoding for known types.
pkg/config/piped.go Fix error message to include the unsupported secret management type value from JSON.
pkg/config/piped_test.go Add tests verifying UnmarshalJSON error message and successful decoding for known types.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

fix(pkg/config): SecretManagement.UnmarshalJSON error omits unsupported type

2 participants