feat(deploy): improve error message when no deploy script found#330
feat(deploy): improve error message when no deploy script found#330
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #330 +/- ##
==========================================
- Coverage 64.68% 64.67% -0.01%
==========================================
Files 212 212
Lines 17778 17775 -3
==========================================
- Hits 11499 11496 -3
Misses 5204 5204
Partials 1075 1075 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zimeg
left a comment
There was a problem hiding this comment.
@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 🧪 ✨
| 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.
🧪 suggestion: Can we include this as a case in the table tests below?
There was a problem hiding this comment.
👾 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
| "To start a local development server, use:", | ||
| fmt.Sprintf(" %s", style.Commandf("run", false)), |
There was a problem hiding this comment.
👁️🗨️ 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>
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.
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.
github is not letting me commit this change so i added it manually 🫡
| assert.Contains(t, slackErr.Remediation, "run") | ||
| assert.Contains(t, slackErr.Remediation, "local development server") | ||
| assert.Contains(t, slackErr.Remediation, "https://docs.slack.dev/deployment") | ||
| } |
zimeg
left a comment
There was a problem hiding this comment.
👁️🗨️ Left a comment on test pending from earlier conversation!
| 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.
👾 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
Summary
This PR updates the deploy command to show a helpful message suggesting
slack runfor local development when no deploy hook is configured.Requirements