refactor(cli): remove capture command global logger#2215
Closed
Kelvinoppong wants to merge 2 commits into
Closed
Conversation
Signed-off-by: Kelvin <oppongk139@gmail.com>
Contributor
Author
Member
|
This PR is a duplicated of #2144, please make sure next time the issue you are taking on don't have an active PR addressing it to avoid duplicating work, closing this for now, thanks! |
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.
Description
This pull request removes the CLI capture flow's dependency on the global
retinacmd.Loggerand replaces it with explicit logger injection.The main changes are:
cli/main.gocapture.NewCommandDownloadServiceto use the injected logger instead of package-global statecli/cmd/root.goThis keeps the capture command behavior the same while making the logger usage more explicit and easier to test.
Related Issue
Related to #585
Checklist
git commit -S -s ...). See this documentation on signing commits.Screenshots (if applicable) or Testing Completed
Tested locally with:
go test -v ./cli/cmd/capture/...go test -v ./cli/...go test -run '^$' ./...go test -v -run 'TestDownloadFromBlobValidation' -count=1 ./cli/cmd/captureAdditional Notes
This change is intentionally scoped to the CLI capture flow. It does not attempt to remove logger singletons from the rest of the codebase.
The blob download validation now returns early when the blob URL does not include a SAS token with read/list permissions. This makes the related unit test deterministic in local environments.