-
Notifications
You must be signed in to change notification settings - Fork 26
feat(deploy): 'deploy` command suggests 'run' command when no deploy script found #330
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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #330 +/- ##
==========================================
+ Coverage 64.63% 64.66% +0.03%
==========================================
Files 212 212
Lines 17778 17775 -3
==========================================
+ Hits 11491 11495 +4
+ Misses 5209 5207 -2
+ Partials 1078 1073 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
@srtaalej Super nice improvements for a better experience in getting started ⭐
I'm requesting a few changes before this merges since we might not have a great page to reference at the moment, and I also left a few comments on formatting and tests that might be nice to polish too 🧪 ✨
cmd/platform/deploy_test.go
Outdated
| assert.Contains(t, slackErr.Remediation, "run") | ||
| assert.Contains(t, slackErr.Remediation, "local development server") | ||
| assert.Contains(t, slackErr.Remediation, "https://docs.slack.dev/deployment") | ||
| } |
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.
🧪 suggestion: Can we include this as a case in the table tests below?
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.
👾 suggestion: We want to avoid writing tests outside of our "table" test structures surrounding. I do think we can extend this case as well, for a smaller change:
slack-cli/cmd/platform/deploy_test.go
Lines 144 to 147 in 40b65e3
| "fails if no deploy hook is provided": { | |
| manifestSource: config.ManifestSourceLocal, | |
| expectedError: slackerror.New(slackerror.ErrSDKHookNotFound), | |
| }, |
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.
Looks possible!
| "To start a local development server, use:", | ||
| fmt.Sprintf(" %s", style.Commandf("run", false)), |
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.
👁️🗨️ suggestion(non-blocking): Keeping the command inline might be nice for consistent formatting overall?
To start a local development server, use: slack run
For deployment options, see: https://docs.slack.dev/tools/slack-cli/reference/hooks/#deploy
Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com>
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.
👏🏻 Looks amazing @srtaalej!
✏️ I left a small suggestion to change the formatting. Once the tests are looking good, we can toss a ✅ on this one!
cmd/platform/deploy.go
Outdated
| "To start a local development server, use:", fmt.Sprintf(" %s", style.Commandf("run", false)), | ||
| "", | ||
| fmt.Sprintf("Example `%s` `deploy` hook:", config.GetProjectHooksJSONFilePath()), | ||
| "{", | ||
| ` "hooks": {`, | ||
| ` "deploy": "./deploy.sh"`, | ||
| " }", | ||
| "}", | ||
| "For deployment options, see: https://docs.slack.dev/tools/slack-cli/reference/hooks/#deploy", |
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.
suggestion: I have 2 small formatting suggestions:
- Flip the lines around so the last line is how to run a local server. I think this allows the
lack runto catch the eye better and is more likely to be noticed. - Put the URL on a newline so that it has more character width and is less likely to wrap on 80 character terminals (default width).
| "To start a local development server, use:", fmt.Sprintf(" %s", style.Commandf("run", false)), | |
| "", | |
| fmt.Sprintf("Example `%s` `deploy` hook:", config.GetProjectHooksJSONFilePath()), | |
| "{", | |
| ` "hooks": {`, | |
| ` "deploy": "./deploy.sh"`, | |
| " }", | |
| "}", | |
| "For deployment options, see: https://docs.slack.dev/tools/slack-cli/reference/hooks/#deploy", | |
| "For deployment options, see:", | |
| " https://docs.slack.dev/tools/slack-cli/reference/hooks/#deploy", | |
| "", | |
| "To start a local development server, use:", | |
| fmt.Sprintf(" %s", style.Commandf("run", false)), |
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.
github is not letting me commit this change so i added it manually 🫡
cmd/platform/deploy_test.go
Outdated
| assert.Contains(t, slackErr.Remediation, "run") | ||
| assert.Contains(t, slackErr.Remediation, "local development server") | ||
| assert.Contains(t, slackErr.Remediation, "https://docs.slack.dev/deployment") | ||
| } |
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.
Looks possible!
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.
👁️🗨️ Left a comment on test pending from earlier conversation!
cmd/platform/deploy_test.go
Outdated
| assert.Contains(t, slackErr.Remediation, "run") | ||
| assert.Contains(t, slackErr.Remediation, "local development server") | ||
| assert.Contains(t, slackErr.Remediation, "https://docs.slack.dev/deployment") | ||
| } |
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.
👾 suggestion: We want to avoid writing tests outside of our "table" test structures surrounding. I do think we can extend this case as well, for a smaller change:
slack-cli/cmd/platform/deploy_test.go
Lines 144 to 147 in 40b65e3
| "fails if no deploy hook is provided": { | |
| manifestSource: config.ManifestSourceLocal, | |
| expectedError: slackerror.New(slackerror.ErrSDKHookNotFound), | |
| }, |
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.
@srtaalej LGTM and thanks for working through the test oddities!
This is so much better of an experience for erroring cases - it makes this path feel intentional instead of an after though 💌
Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com>
Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com>
Co-authored-by: Eden Zimbelman <eden.zimbelman@salesforce.com>
Changelog
The
deploycommand will now reference the latest online documentation with a suggestion to run a development app with theruncommand if a "deploy" hook script doesn't exist.Summary
This PR updates the deploy command to show a helpful message suggesting
slack runfor local development when no deploy hook is configured.Requirements