fix(config): include unsupported type in SecretManagement unmarshal error - #7277
Open
SinghAman21 wants to merge 1 commit into
Open
fix(config): include unsupported type in SecretManagement unmarshal error#7277SinghAman21 wants to merge 1 commit into
SinghAman21 wants to merge 1 commit into
Conversation
SinghAman21
requested review from
Warashi,
ffjlabo and
khanhtc1202
and
a lite review from Copilot
and removed request for
Copilot
August 29, 2026 18:09
✅ Deploy Preview for pipecd-site canceled.
|
…rror Signed-off-by: SinghAman21 <singhaman1825@gmail.com>
SinghAman21
force-pushed
the
fix/secret-management-unmarshal-error
branch
from
August 30, 2026 16:40
51d8eaa to
d8a639f
Compare
Contributor
There was a problem hiding this comment.
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.UnmarshalJSONto useg.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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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?: