-
Notifications
You must be signed in to change notification settings - Fork 24
feat: add support for 'feedback --name slack-platform' #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #70 +/- ##
==========================================
+ Coverage 63.00% 63.18% +0.17%
==========================================
Files 210 210
Lines 22183 22187 +4
==========================================
+ Hits 13976 14018 +42
+ Misses 7115 7082 -33
+ Partials 1092 1087 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
mwbrooks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚩 Some comments to guide the review and help answer a few open questions!
| SlackCLIFeedback = "slack-cli" | ||
| SlackPlatformFeedback = "slack-platform" | ||
| SlackPlatformFeedbackDeprecated = "platform-improvements" // DEPRECATED(semver:major) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Added a DEPRECATED(semver:X) comment to make this easier to find in the future. We are a little consistent with our deprecation comments - TODO(semver:major) and others also exist. Preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for both this comment and calling out the formatting!
IIRC we are using TODO(semver:major) more often, but this is often for internal breaking changes AFAICT.
I think DEPRECATED is meaningful here since it captures the ongoing support with an existing alternative option, but IMO the semver:major part is the most important! This is what I would use in searching for these 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I learned in review of #71 that go has a convention around making machine-readable comments that I'm interested in exploring:
...this comment directives are line comments that start with
//go:, with no space between the//and thego:.
https://go.dev/wiki/Comments#directives
Using a similar pattern might be interesting for these more "conventional" comments, but I don't believe we have explicit notes on how these should be used overall...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One addition to this comment might also note the deprecated suggestions? 📚
Edit: I realize you make a similar comment a few lines down - no blocker here!
| SlackCLIFeedback = "slack-cli" | |
| SlackPlatformFeedback = "slack-platform" | |
| SlackPlatformFeedbackDeprecated = "platform-improvements" // DEPRECATED(semver:major) | |
| SlackCLIFeedback = "slack-cli" | |
| SlackPlatformFeedback = "slack-platform" | |
| SlackPlatformFeedbackDeprecated = "platform-improvements" // DEPRECATED(semver:major) - Replaced with the "slack-platform" option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The //go: directive is interesting. It led me down a path to find the use of the // DEPRECATED: comment in Golang. So, perhaps we can start to use that convention to signal deprecated code. I definitely agree that the (semver:major) scope is most important though!
| clients.IO.PrintInfo(ctx, false, fmt.Sprintf( | ||
| "%s\n%s\n", | ||
| style.Secondary("Ask questions, submit issues, or suggest features for the SLack CLI:"), | ||
| style.Secondary("Ask questions, submit issues, or suggest features for the Slack CLI:"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Writing tests found a typo!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mwbrooks Whew great catch! It's nice to know this wasn't released, but darn that's an L for sure 😉
| // DEPRECATED(semver:major): Support the deprecated survey name for backwards compatibility | ||
| if surveyNameFlag == SlackPlatformFeedbackDeprecated { | ||
| surveyNameFlag = SlackPlatformFeedback | ||
| clients.IO.PrintDebug(ctx, "DEPRECATED: The '--name %s' flag is deprecated; use '--name %s' instead", SlackPlatformFeedbackDeprecated, SlackPlatformFeedback) | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: I print a deprecation message to our PrintDebug instead of PrintWarning. We use both. Preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📣 I'm in favor of annoying and loud deprecation messages to encourage making expected changes as soon as possible.
This is a pattern I've found in build tools like goreleaser and nix that can be frustrating at first, but also save headache when the actual breaking changes do happen!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool with me! Commit 06e247e now prints this loud and in the open!
| _surveys := SurveyStore | ||
| SurveyStore = surveys | ||
| defer func() { SurveyStore = _surveys }() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: After adding some Command Table Tests, I noticed that the tests started failing when ran together. The reason is that the current tests clobber the global SurveyStore. This code backs up and restores the original SurveyStore after each test.
🧪 In a follow-up PR, I'd like to refactor these tests to all use the Command Table Test.
zimeg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mwbrooks The feedback command is coming together so nicely! It's much more intuitive to match the feedback target:
slack-cli: Slack CLIslack-platform: Slack Platform- ...
And I remain excited for what might else be included here 👾
A few rambles were made below, but this is a smooth experience already so please feel free to merge when the time is right 🚢 💨
| SlackCLIFeedback = "slack-cli" | ||
| SlackPlatformFeedback = "slack-platform" | ||
| SlackPlatformFeedbackDeprecated = "platform-improvements" // DEPRECATED(semver:major) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for both this comment and calling out the formatting!
IIRC we are using TODO(semver:major) more often, but this is often for internal breaking changes AFAICT.
I think DEPRECATED is meaningful here since it captures the ongoing support with an existing alternative option, but IMO the semver:major part is the most important! This is what I would use in searching for these 😉
| SlackCLIFeedback = "slack-cli" | ||
| SlackPlatformFeedback = "slack-platform" | ||
| SlackPlatformFeedbackDeprecated = "platform-improvements" // DEPRECATED(semver:major) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also I learned in review of #71 that go has a convention around making machine-readable comments that I'm interested in exploring:
...this comment directives are line comments that start with
//go:, with no space between the//and thego:.
https://go.dev/wiki/Comments#directives
Using a similar pattern might be interesting for these more "conventional" comments, but I don't believe we have explicit notes on how these should be used overall...
| SlackCLIFeedback = "slack-cli" | ||
| SlackPlatformFeedback = "slack-platform" | ||
| SlackPlatformFeedbackDeprecated = "platform-improvements" // DEPRECATED(semver:major) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One addition to this comment might also note the deprecated suggestions? 📚
Edit: I realize you make a similar comment a few lines down - no blocker here!
| SlackCLIFeedback = "slack-cli" | |
| SlackPlatformFeedback = "slack-platform" | |
| SlackPlatformFeedbackDeprecated = "platform-improvements" // DEPRECATED(semver:major) | |
| SlackCLIFeedback = "slack-cli" | |
| SlackPlatformFeedback = "slack-platform" | |
| SlackPlatformFeedbackDeprecated = "platform-improvements" // DEPRECATED(semver:major) - Replaced with the "slack-platform" option |
| clients.IO.PrintInfo(ctx, false, fmt.Sprintf( | ||
| "%s\n%s\n", | ||
| style.Secondary("Ask questions, submit issues, or suggest features for the SLack CLI:"), | ||
| style.Secondary("Ask questions, submit issues, or suggest features for the Slack CLI:"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mwbrooks Whew great catch! It's nice to know this wasn't released, but darn that's an L for sure 😉
| // DEPRECATED(semver:major): Support the deprecated survey name for backwards compatibility | ||
| if surveyNameFlag == SlackPlatformFeedbackDeprecated { | ||
| surveyNameFlag = SlackPlatformFeedback | ||
| clients.IO.PrintDebug(ctx, "DEPRECATED: The '--name %s' flag is deprecated; use '--name %s' instead", SlackPlatformFeedbackDeprecated, SlackPlatformFeedback) | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📣 I'm in favor of annoying and loud deprecation messages to encourage making expected changes as soon as possible.
This is a pattern I've found in build tools like goreleaser and nix that can be frustrating at first, but also save headache when the actual breaking changes do happen!
| "supports --name slack-platform": { | ||
| CmdArgs: []string{"--name", "slack-platform"}, | ||
| Setup: func(t *testing.T, ctx context.Context, cm *shared.ClientsMock, cf *shared.ClientFactory) { | ||
| setupFeedbackCommandMocks(t, ctx, cm, cf) | ||
| }, | ||
| ExpectedOutputs: []string{ | ||
| "[email protected]", | ||
| "https://docs.slack.dev/developer-support", | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💌 👏
|
@zimeg Thanks again for the solid review and ideas around Golang comment directives! I'm going to follow-up with a PR that updates our maintainers guide with a recommendation to use the Before merging, I updated the deprecation warning to be printed to |
CHANGELOG
Summary
This pull request replaces
feedback --name platform-improvementswithfeedback --name slack-platform:feedback --name platform-improvementsplatform-improvementsfrom the help documentationfeedback --name slack-platform--name platform-improvementscontinues to work until the next semver:major updatePreview
slack feedback --helpdisplaysslack-platform:slack feedback --name slack-platform:slack feedback --name platform-improvementsis backwards compatible:slack feedback --name platform-improvements --verbosedeprecation message:Reviewers
Requirements