Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Factory type signature to accept context.Context and store.ID parameters, enabling factory functions to make context-aware decisions and return different secret types based on the identifier being accessed.
Changes:
- Updated
Factoryfunction signature fromfunc() Ttofunc(context.Context, ID) T - Updated all factory function invocations across stores to pass context and ID parameters
- Updated test mocks and helper functions to match the new signature
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| store/store.go | Updated Factory type signature to include context and ID parameters |
| store/posixage/store.go | Updated factory invocations in Filter, Get, and GetAllMetadata methods |
| store/posixage/store_test.go | Updated test factory functions to accept new parameters |
| store/keychain/keychain_darwin.go | Updated factory field type and method signatures to use context parameter |
| store/keychain/keychain_darwin_test.go | Added context import and updated factory function signature |
| store/keychain/keychain_test.go | Updated setupKeychain helper and test factories to match new signature |
| store/keychain/cmd/main.go | Updated factory function in command setup |
| plugins/pass/store/store.go | Added context import and updated PassStore factory function |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
2940b29 to
93c26da
Compare
joe0BAB
approved these changes
Jan 27, 2026
joe0BAB
pushed a commit
that referenced
this pull request
Feb 16, 2026
feat: factory function provides more context
joe0BAB
pushed a commit
that referenced
this pull request
Feb 16, 2026
feat: factory function provides more context
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.
This change provides more context to the factory function. A more informed factory, could even add additional data based on data only it knows about (e.g. via context or the id).
Another use case is returning different store.Secret types based on what is being read from the store.