refactor: remove legacy CLIVersion field and SetVersion option#429
Draft
refactor: remove legacy CLIVersion field and SetVersion option#429
Conversation
The CLIVersion field and SetVersion functional option on ClientFactory were a workaround for a circular dependency that no longer exists. The API client reads version from context via slackcontext.Version(ctx), making this indirection unnecessary. Replace with direct version.Raw() calls.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #429 +/- ##
==========================================
- Coverage 70.23% 70.22% -0.02%
==========================================
Files 220 220
Lines 18446 18444 -2
==========================================
- Hits 12956 12952 -4
- Misses 4316 4318 +2
Partials 1174 1174 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Changelog
Summary
This pull request removes the legacy
CLIVersionfield andSetVersion()function fromClientFactory.CLIVersionfield andSetVersion()functional option fromClientFactory.TODOcomment referencing a circular dependency that no longer exists. This was solved byslackcontext.Version(ctx).clients.CLIVersion) with directversion.Raw()calls. Theclients.CLIVersionwas previously set to the raw version value.Context:
ClientFactory.CLIVersionandshared.SetVersion()were a workaround for a circular dependency betweeninternal/api/client.goandpackage version. That dependency no longer exists -internal/api/client.godoes not import the version package and the API client now reads the CLI version from context withslackcontext.Version(ctx).Test Steps
1. Test Version:
2. Test Version Override with Environment Variable:
$ SLACK_TEST_VERSION=v0.0.1 lack version # → Expect: "Using slack v0.0.1"3. Test Doctor Command (confirms
Config.Versionis set):4. Test Debug Output (confirms version reaches context)
Requirements