-
Notifications
You must be signed in to change notification settings - Fork 39
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
Create a script to make it easier to add changelog entries. #2166
Conversation
Warning Rate limit exceeded@SpicyLemon has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 56 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes involve enhancements to the documentation and the introduction of a new script, Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 5
🧹 Outside diff range and nitpick comments (4)
.changelog/README.md (2)
33-97
: LGTM! Clear and comprehensive instructions foradd-change.sh
.The new content provides excellent documentation for using the
add-change.sh
script. The usage examples and explanations are clear and cover various scenarios, which will be very helpful for users.Consider adding a brief note about where users can find the
add-change.sh
script (e.g., in the root of the repository or in the.changelog
directory). This would make it even easier for new contributors to get started.🧰 Tools
🪛 LanguageTool
[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...d, behavior depends on the<section>
. If the section is "dependencies", then the...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...executed to create the message content. If it's any other section, the file will b...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🪛 Markdownlint
64-64: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
70-70: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
76-76: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
82-82: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
56-57
: Consider addressing minor style suggestions.The static analysis tools have flagged a few minor style issues:
- In lines 56-57, consider rewording to avoid starting three successive sentences with "If".
- In the command examples (lines 64, 70, 76, 82), consider either removing the dollar signs or showing the command output to comply with Markdown best practices.
These are low-priority suggestions and don't affect the functionality or overall clarity of the documentation.
Also applies to: 64-64, 70-70, 76-76, 82-82
🧰 Tools
🪛 LanguageTool
[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...d, behavior depends on the<section>
. If the section is "dependencies", then the...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...executed to create the message content. If it's any other section, the file will b...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
.changelog/add-change.sh (2)
354-356
: Check for errors when writing to the temporary fileWhen using
awk
to write to the temporary file, it's good practice to check if the write operation was successful. This ensures that any I/O errors are caught promptly.Apply this diff to add error checking:
-awk -v link="$link" '{if(NR==1){sub(/^[[:space:]]*[-*]?[[:space:]]*/,"* "); sub(/[[:space:]]*(\.)?[[:space:]]*$/," " link "."); print;}else{print " " $0;};}' <<< "$message" > "$temp_file" +awk -v link="$link" '{if(NR==1){sub(/^[[:space:]]*[-*]?[[:space:]]*/,"* "); sub(/[[:space:]]*(\.)?[[:space:]]*$/," " link "."); print;}else{print " " $0;};}' <<< "$message" > "$temp_file" || { printf 'Error: Failed to write to temporary file.\n'; clean_exit 1; }
349-349
: Consider usingreturn
instead ofexit
in theclean_exit
functionUsing
exit
inside a function will terminate the entire script, which is appropriate here sinceclean_exit
is meant to finalize and exit. However, if there's a possibility that this function might be reused or sourced in another script, usingreturn
could make it more flexible.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (3)
- .changelog/README.md (3 hunks)
- .changelog/add-change.sh (1 hunks)
- .changelog/unreleased/improvements/2166-add-changelog-helper.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .changelog/unreleased/improvements/2166-add-changelog-helper.md
🧰 Additional context used
🪛 LanguageTool
.changelog/README.md
[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...d, behavior depends on the<section>
. If the section is "dependencies", then the...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...executed to create the message content. If it's any other section, the file will b...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🪛 Markdownlint
.changelog/README.md
64-64: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
70-70: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
76-76: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
82-82: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
🪛 Shellcheck
.changelog/add-change.sh
[warning] 148-148: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
(SC2164)
[warning] 162-162: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
(SC2207)
🔇 Additional comments (3)
.changelog/README.md (3)
108-108
: LGTM! Improved readability.The addition of a blank line before the "Using unclog" section enhances the document's readability by clearly separating it from the previous section.
274-275
: LGTM! Completed instructions for post-release setup.The added steps for creating a new
.changelog/unreleased
directory and.gitkeep
file complete the process of setting up the changelog structure after a release. This ensures that the repository is ready for new unreleased changes.
Line range hint
1-275
: Great job on updating the changelog documentation!The changes to this file significantly improve the documentation for the changelog process, particularly with the introduction of the
add-change.sh
script. The new instructions are clear, comprehensive, and user-friendly, which should make it easier for contributors to add changelog entries correctly.The minor formatting improvements and additional instructions for post-release setup further enhance the overall quality of the documentation.
These updates align well with the PR objectives of creating a script to simplify the process of adding changelog entries. Great work on improving the developer experience!
🧰 Tools
🪛 LanguageTool
[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...d, behavior depends on the<section>
. If the section is "dependencies", then the...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...executed to create the message content. If it's any other section, the file will b...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🪛 Markdownlint
64-64: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
70-70: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
76-76: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
82-82: null
Dollar signs used before commands without showing output(MD014, commands-show-output)
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 don’t generally prefix my branch names with my username, I just use the issue number followed by a dash and a short set of words from the title. Still this form here seems fine.
You'll still be fine. It strips off everything before the last |
Description
This PR creates the
.changelog/add-change.sh
that's hopefully easier to use than unclog.See
.changelog/add-change.sh --help
for full usage details.<num>
can be omitted if your branch name has the format<username>/<issue number>-<id>
.<id>
is omitted, then it'll be derived from your branch name.fzf
installed on your system, you can omit the<section>
and you'll be prompted to select one. Havingfzf
also allows you to use partial section names and it'll either auto-select the one it matches or prompt you to select from the multiple that match. E.g. if you provide a<section>
ofbug
, it'll automatically get changed tobug-fixes
. But if you provide it asdep
, you'll be prompted because that matches bothdependencies
anddeprecated
.fzf
then you'll need to provide the full, valid section name, but if you get it wrong, the error output will at least include the list of possibilities.<message>
is omitted, behavior depends on the<section>
. If it'sdependencies
, then theget-dep-changes.sh
script is used to generate the message content. If it's any other section, then the message will just beTODO
.For this PR, I used this command:
$ .changelog/add-change.sh --pr 2166 imp 'Create the `add-change.sh` script to make it easier to add changelog entries.'
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
).godoc
comments..changelog/unreleased
(see Adding Changes).Files changed
in the Github PR explorer.Codecov Report
in the comment section below once CI passes.Summary by CodeRabbit
New Features
add-change.sh
, to simplify adding entries to the changelog.Documentation
.changelog/README.md
with clear guidelines on using theadd-change.sh
script and preparing for releases.