-
Notifications
You must be signed in to change notification settings - Fork 24
fix: update broken URL in the hooks.json error message #3
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 #3 +/- ##
==========================================
- Coverage 62.82% 62.80% -0.02%
==========================================
Files 210 210
Lines 22053 22053
==========================================
- Hits 13854 13851 -3
- Misses 7124 7126 +2
- Partials 1075 1076 +1 ☔ 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.
LGTM! ✨
I've been thinking so much about supporting prior CLI versions expecting slack.json in past CLI versions and I unfortunately don't think we have a migration possible for those versions.
Revisiting sample versioning might be interesting, perhaps bringing tags to the create command, but that's all idea.
This PR is a nice improvement for these cases as is!
I left comments on wording, but more around spacing in linebreaks. I'm so interested in what you think. I realize dense outputs can be offputting, but I'm hoping it becomes familiar in such common errors 👾
internal/slackerror/errors.go
Outdated
| "Hook scripts are defined in a Slack hooks file:", | ||
| "- slack.json", | ||
| "- or", |
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.
| "Hook scripts are defined in a Slack hooks file:", | |
| "- slack.json", | |
| "- or", | |
| "Hook scripts are defined in a Slack hooks file found at either:", | |
| "- slack.json", |
🤔 Hmm I think the list of items makes the "or" somewhat confusing for me.
I'm not sure if this is great wording, but I'm hoping to make the "pick one" option more clear in the line above!
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.
That's definitely a fair suggestion. I wasn't a fan of the "or" but I wanted to keep it readable.
Riffing on your suggestion, commit b9588ea updates the text to end with "Slack hooks files" but tries to emphasize that it can be one of the following:
Hook scripts are defined in one of these Slack hooks files:
- slack.json
- .slack/hooks.json
| "Hook scripts are defined in a Slack hooks file:", | ||
| "- slack.json", | ||
| "- or", | ||
| "- " + filepath.Join(".slack", "hooks.json"), |
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.
🎉 Love the filepath support here!
| "", | ||
| style.Highlight("https://github.com/slack-samples/deno-starter-template/blob/main/.slack/hooks.json"), | ||
| "You can create a hooks file manually or with " + style.Commandf("init", 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.
| "", |
Nit: IMO newlines between some of these details separates some related ideas, but these might be helpful for parsing outputs... 👁️🗨️
No blocker but removing some might be interesting!
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 hear ya on too much separation, but I think it's important to leave a newline after a URL when possible. Depending on the person's terminal, the URL may not be styled and may wrap to multiple lines. So, leaving some whitespace after the URL can help it stand out and make the entire sentence more readable.
For example, here is a smaller window size. I've merged the previous suggestion to remove the whitespace before the URL. However, if we removed the whitespace after, it will become very unreadable:

| "", | ||
| "If this is a Slack project, you can initialize it with " + style.Commandf("init", 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.
| "", | |
| "If this is a Slack project, you can initialize it with " + style.Commandf("init", false), | |
| "You can initialize an existing Slack project with the " + style.Commandf("init", false) + " command", |
I like the wording to the reader! I made a similar line removal here with some adjusted words, but might want to discuss the extra line more. Without having a similar suggestion heading this feels somewhat out of place to me...
Not meaning to block this from merging but am also hoping to lean into fewer linebreaks in output overall? It's at least interesting to me.
Co-authored-by: Eden Zimbelman <[email protected]>
Co-authored-by: Eden Zimbelman <[email protected]>
|
Thanks for the ideas @zimeg! Here's the final result of bringing everything in!
🧠 While iterating on this error, it makes me think that we should try to become more crisp on whether to have complete sentences with a |
|
💌 Once this releases it might be nice to follow up with the kind note of slack-samples/deno-starter-template#76! |

Summary
This pull request updates the URL in the
hooks.jsonerror message to use a working, valid URL.While the Slack CLI now support
.slack/hooks.json, it continues to remain backwards compatible withslack.json. We're in a bit of a messy-in-the-middle situation where the Slack CLI often references.slack/hooks.jsonbut our samples continue to useslack.jsonfor backwards compatibility.I've updated the error messages to also suggest using
initto create the file, when it's missing.Preview
Error when a hook script returns an error code:

Error when the hooks file is missing:

Reviewer
Requirements