fix: improve credential graph error handling and resolution logic#602
Merged
jakobmoellerdev merged 5 commits intoSep 3, 2025
Merged
Conversation
#### What this PR does / why we need it - Refined error messages for better clarity when credential resolution fails. - Introduced `ErrNoIndirectCredentials` for clear distinction between direct and indirect resolution failures. - Enhanced `ToGraph` to handle `nil` configurations and added fallback logic for indirect resolution. - Updated method signatures to support the new `GraphResolver` interface. - Adjusted indirect resolution logic to signal failure without excessive verbosity. - Incorporated tests to validate updated error handling and resolution workflows. #### Which issue(s) this PR fixes Improves the readability and maintainability of credential graph resolution errors and ensures consistency across direct and indirect resolution paths. Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
fabianburth
reviewed
Aug 27, 2025
#### What this commit does and why we need it - Removed implicit initialization of `nil` configurations in `ToGraph` implementation. - Updated tests to pass a valid configuration explicitly. - This change enforces clearer and more explicit usage patterns by requiring valid configuration objects to be provided. This enhances code clarity and prevents potential misuse of the `ToGraph` function by relying on explicit input parameters. Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
fabianburth
previously approved these changes
Sep 3, 2025
#### What this commit does and why we need it - Refactored `resolveFromGraph` to streamline handling of indirect resolution fallback. - Consolidated condition checks to avoid redundant error handling. - Ensures fallback to repository plugin provider is only attempted when direct resolution fails with `ErrNoDirectCredentials`. This simplifies the resolution logic, improves code readability, and reduces unnecessary branching during credential resolution. Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
fabianburth
approved these changes
Sep 3, 2025
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 / why we need it
ErrNoIndirectCredentialsfor clear distinction between direct and indirect resolution failures.ToGraphto handlenilconfigurations and added fallback logic for indirect resolution.GraphResolverinterface.Which issue(s) this PR fixes
Improves the readability and maintainability of credential graph resolution errors and ensures consistency across direct and indirect resolution paths. (noticed during testing of CLI interaction with credential graph)