Skip to content

Conversation

thaJeztah
Copy link
Member

I have some more changes in this area, but need to dust it off; let's open these already as a PR 😅

cli/config/configfile: inline getConfiguredCredentialStore

It was a premature abstraction; the "nil" check for the map was redundant,
making it literally a 1-liner, so just inline it.

cli/config/configfile: use more idiomatic receiver name

Use a shorter name, which is more idiomatic, and prevents accidental
shadowing of types or arguments.

- Human readable description for the release notes

- A picture of a cute animal (not mandatory but encouraged)

It was a premature abstraction; the "nil" check for the map was redundant,
making it literally a 1-liner, so just inline it.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Use a shorter name, which is more idiomatic, and prevents accidental
shadowing of types or arguments.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added this to the 29.0.0 milestone Aug 23, 2025
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Aug 23, 2025
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@thaJeztah thaJeztah marked this pull request as draft August 23, 2025 00:32
@thaJeztah
Copy link
Member Author

Hm... I messed up something;

#18 64.05 === FAIL: cli/config/configfile TestGetAllCredentialsCredsStore (0.00s)
#18 64.05     file_test.go:238: assertion failed: 
#18 64.05         --- expected
#18 64.05         +++ authConfigs
#18 64.05           map[string]types.AuthConfig{
#18 64.05         - 	"example.com": {Username: "user", Password: "pass"},
#18 64.05           }
#18 64.05         
#18 64.05     file_test.go:239: assertion failed: 1 (int) != 0 (testCredsStore.(*mockNativeStore).GetAllCallCount int)
#18 64.05 
#18 64.05 === FAIL: cli/config/configfile TestGetAllCredentialsCredStoreAndCredHelper (0.00s)
#18 64.05     file_test.go:402: assertion failed: 
#18 64.05         --- expected
#18 64.05         +++ authConfigs
#18 64.05           map[string]types.AuthConfig{
#18 64.05           	"credhelper.com": {Username: "cred_helper_user", Password: "cred_helper_pass"},
#18 64.05         - 	"credstore.com":  {Username: "cred_store_user", Password: "cred_store_pass"},
#18 64.05           }
#18 64.05         

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor PR's that refactor, or clean-up code status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants