-
-
Notifications
You must be signed in to change notification settings - Fork 636
Make the release script update Gemfile.lock #1711
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
WalkthroughThis pull request introduces several updates across multiple files to enhance the release and testing processes. The Changes
Suggested reviewers
Poem
Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🪧 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 (
|
81a2b39
to
b8212e1
Compare
cd #{dummy_app_dir}; bundle update react_on_rails | ||
cd #{gem_root}#{' '} |
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.
Could keep it but I don't see why the space would be useful.
b8212e1
to
cd6c3a8
Compare
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: 0
🧹 Nitpick comments (3)
rakelib/update_changelog.rake (3)
1-3
: Add frozen string literal commentThe file is missing a frozen string literal comment which would help with memory efficiency. This was flagged by both static analysis and the pipeline.
+# frozen_string_literal: true + require "bundler" require_relative "task_helpers"🧰 Tools
🪛 RuboCop (1.73)
[convention] 1-2: Carriage return character detected.
(Layout/EndOfLine)
[convention] 1-1: Missing frozen string literal comment.
(Style/FrozenStringLiteralComment)
🪛 GitHub Actions: Lint JS and Ruby
[warning] 1-1: Layout/EndOfLine: Carriage return character detected.
[warning] 1-1: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
1-40
: Fix line endingsThe static analysis and pipeline checks detected carriage return characters in the file. Ensure consistent line endings (preferably LF) are used across the project.
# Use the following git command to normalize line endings: git config core.autocrlf false git rm --cached -r . git reset --hard🧰 Tools
🪛 RuboCop (1.73)
[convention] 1-2: Carriage return character detected.
(Layout/EndOfLine)
[convention] 1-1: Missing frozen string literal comment.
(Style/FrozenStringLiteralComment)
🪛 GitHub Actions: Lint JS and Ruby
[warning] 1-1: Layout/EndOfLine: Carriage return character detected.
[warning] 1-1: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
19-24
: Consider enhanced error handling for the Git commandThe current implementation uses backticks to execute Git commands, but doesn't handle potential errors if the Git command fails. Consider adding more robust error handling.
- tag_date = `git show -s --format=%cs #{tag}`.split("\n").last.strip + tag_date_output = `git show -s --format=%cs #{tag} 2>&1` + if $?.success? + tag_date = tag_date_output.split("\n").last.strip + else + puts "Failed to find the tag: #{tag_date_output}" + next + end - unless tag_date - puts "Failed to find the tag" - next - end
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Gemfile.lock
is excluded by!**/*.lock
📒 Files selected for processing (4)
CHANGELOG.md
(2 hunks)rakelib/release.rake
(1 hunks)rakelib/task_helpers.rb
(1 hunks)rakelib/update_changelog.rake
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- rakelib/release.rake
🧰 Additional context used
🪛 RuboCop (1.73)
rakelib/update_changelog.rake
[convention] 1-2: Carriage return character detected.
(Layout/EndOfLine)
[convention] 1-1: Missing frozen string literal comment.
(Style/FrozenStringLiteralComment)
🪛 GitHub Actions: Lint JS and Ruby
rakelib/update_changelog.rake
[warning] 1-1: Layout/EndOfLine: Carriage return character detected.
[warning] 1-1: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: dummy-app-integration-tests (newest)
- GitHub Check: dummy-app-integration-tests (oldest)
- GitHub Check: rspec-package-tests (newest)
- GitHub Check: rspec-package-tests (oldest)
🔇 Additional comments (4)
rakelib/task_helpers.rb (1)
47-47
: Method implementation now matches its name functionalityThe updated implementation now explicitly includes
bundle exec
in the command, which makes the method behavior consistent with its namebundle_exec
. This change ensures that Ruby gems are properly executed within the bundler environment.CHANGELOG.md (2)
21-22
: New version entry added correctlyThe addition of the new version entry
15.0.0-alpha.2
dated2025-03-07
follows the project's changelog conventions.
1210-1211
: Updated comparison links for version trackingThe
[Unreleased]
link has been correctly updated to compare the new alpha version against master, and a new link for15.0.0-alpha.2
has been added to compare it with the previous release.rakelib/update_changelog.rake (1)
4-39
: Well-implemented changelog automation taskThis new task automates the process of updating the CHANGELOG.md file during the release process. It handles:
- Finding the latest tag if none provided
- Checking if the tag is already documented
- Retrieving the tag date from Git
- Inserting the new version header
- Updating the comparison links
This is a valuable addition to the release process that will help maintain consistent changelog entries.
cd6c3a8
to
7425e2e
Compare
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: 1
🧹 Nitpick comments (5)
rakelib/update_changelog.rake (5)
14-19
: Add error handling for the CHANGELOG.md file.The script reads the CHANGELOG.md file but doesn't handle the case when the file doesn't exist. Consider adding proper error handling to make the script more robust.
- changelog = File.read("CHANGELOG.md") + changelog_path = "CHANGELOG.md" + unless File.exist?(changelog_path) + puts "ERROR: #{changelog_path} does not exist!" + next + end + + changelog = File.read(changelog_path)
33-39
: Extract repository URL as a constant.The GitHub repository URL is hardcoded in multiple places. Consider extracting it to a constant at the top of the file to make it easier to maintain if the repository URL changes in the future.
require "bundler" require_relative "task_helpers" + REPO_URL = "https://github.com/shakacode/react_on_rails" desc "Updates CHANGELOG.md inserting headers for the new version. ... - match_data = %r{https://github.com/shakacode/react_on_rails/compare/(?<prev_tag>.*)\.\.\.master}.match(changelog) + match_data = %r{#{REPO_URL}/compare/(?<prev_tag>.*)\.\.\.master}.match(changelog) if match_data prev_tag = match_data[:prev_tag] - new_unreleased_link = "https://github.com/shakacode/react_on_rails/compare/#{tag}...master" - new_tag_link = "#{anchor}: https://github.com/shakacode/react_on_rails/compare/#{prev_tag}...#{tag}" + new_unreleased_link = "#{REPO_URL}/compare/#{tag}...master" + new_tag_link = "#{anchor}: #{REPO_URL}/compare/#{prev_tag}...#{tag}" changelog.sub!(match_data[0], "#{new_unreleased_link}\n#{new_tag_link}") end
10-12
: Validate the tag format.The script doesn't validate the format of the tag. Consider adding a validation to ensure the tag follows a valid format (e.g., v1.0.0) to prevent unexpected behavior.
task :update_changelog, %i[tag] do |_, args| tag = args[:tag] || `git describe --tags --abbrev=0`.strip + unless tag =~ /^v\d+\.\d+\.\d+(\.\d+|-(alpha|beta|rc)\d*)?$/ + puts "WARNING: Tag '#{tag}' doesn't follow the expected format (vX.Y.Z, vX.Y.Z.W, or vX.Y.Z-alpha/beta/rcN)" + end anchor = "[#{tag}]"
1-42
: Consider adding logging for completed actions.The script provides feedback when a tag is already documented or when it fails to find a tag, but it doesn't inform the user when it successfully updates the changelog. Consider adding a success message to improve user experience.
File.write("CHANGELOG.md", changelog) + puts "Successfully updated CHANGELOG.md with entries for #{tag}" end
🧰 Tools
🪛 RuboCop (1.73)
[convention] 22-22: Prefer
$CHILD_STATUS
from the stdlib 'English' module (don't forget to require it) over$?
.(Style/SpecialGlobalVars)
🪛 GitHub Actions: Lint JS and Ruby
[warning] 22-22: [Correctable] Style/SpecialGlobalVars: Prefer
$CHILD_STATUS from the stdlib 'English' module (don't forget to require it) over $ ?.
30-30
: Consider more robust pattern matching for changelog sections.The current approach relies on an exact match for "Changes since the last non-beta release." If this text changes, the script will fail to insert the new version header. Consider a more robust approach using regular expressions to match the section.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
-
CHANGELOG.md
(2 hunks) -
rakelib/release.rake
(1 hunks) -
rakelib/task_helpers.rb
(1 hunks) -
rakelib/update_changelog.rake
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- rakelib/task_helpers.rb
- rakelib/release.rake
- CHANGELOG.md
🧰 Additional context used
🪛 RuboCop (1.73)
rakelib/update_changelog.rake
[convention] 22-22: Prefer $CHILD_STATUS
from the stdlib 'English' module (don't forget to require it) over $?
.
(Style/SpecialGlobalVars)
🪛 GitHub Actions: Lint JS and Ruby
rakelib/update_changelog.rake
[warning] 22-22: [Correctable] Style/SpecialGlobalVars: Prefer
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: rspec-package-tests (newest)
- GitHub Check: build-dummy-app-webpack-test-bundles (oldest)
- GitHub Check: rspec-package-tests (oldest)
d6e9e36
to
b3d325a
Compare
Argument: Git tag. Defaults to the latest tag." | ||
|
||
task :update_changelog, %i[tag] do |_, args| | ||
tag = args[:tag] || `git describe --tags --abbrev=0`.strip |
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.
sh_in_dir
is less convenient because it returns an array.
next | ||
end | ||
|
||
tag_date_output = `git show -s --format=%cs #{tag} 2>&1` |
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.
bf0cfd4
to
2c3f6bf
Compare
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: 0
🧹 Nitpick comments (2)
CHANGELOG.md (2)
18-22
: Duplicate Release Section HeadingThere are two identical headings for the 15.0.0‑alpha.2 release (one on line 18 and another on line 21). Duplicate headings can cause confusion when navigating the changelog and trigger markdown lint warnings (MD024). Please remove one of the duplicate headings to keep the changelog clear and compliant.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
21-21: Multiple headings with the same content
null(MD024, no-duplicate-heading)
1210-1211
: Unused Link Reference DefinitionThe link reference for
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/15.0.0-alpha.2...master
appears to be defined but not used elsewhere in the document. If this reference isn’t being utilized in the changelog, consider removing it to clean up the file and adhere to markdown best practices (MD053).🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
1210-1210: Link and image reference definitions should be needed
Unused link or image reference definition: "unreleased"(MD053, link-image-reference-definitions)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
CHANGELOG.md
(2 hunks)rakelib/release.rake
(1 hunks)rakelib/task_helpers.rb
(1 hunks)rakelib/update_changelog.rake
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- rakelib/task_helpers.rb
- rakelib/update_changelog.rake
- rakelib/release.rake
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
CHANGELOG.md
21-21: Multiple headings with the same content
null
(MD024, no-duplicate-heading)
1210-1210: Link and image reference definitions should be needed
Unused link or image reference definition: "unreleased"
(MD053, link-image-reference-definitions)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: rspec-package-tests (newest)
- GitHub Check: rspec-package-tests (oldest)
- GitHub Check: build-dummy-app-webpack-test-bundles (oldest)
- GitHub Check: build
aae831f
to
8501f35
Compare
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: 0
🧹 Nitpick comments (2)
CHANGELOG.md (2)
1209-1210
: Unused Link Reference Definition: [Unreleased]The link reference for “[Unreleased]” is defined at line 1209 but does not appear to be used anywhere within the document. To resolve the markdownlint warning (MD053), please consider either removing this unused definition or incorporating an inline reference (for example, in the introductory sections discussing upcoming features) so that it is utilized.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
1209-1209: Link and image reference definitions should be needed
Unused link or image reference definition: "unreleased"(MD053, link-image-reference-definitions)
1-9
: Verify Alignment with Release ObjectivesWhile the changelog accurately documents version updates and various fixes, the PR objective mentions an update to the release script to ensure that the
Gemfile.lock
file remains stable after a release. There is no explicit mention of this in the changelog. Please double-check that the release instructions or related documentation elsewhere include guidance regarding the handling ofGemfile.lock
so that users are properly informed.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
8-8: Bare URL used
null(MD034, no-bare-urls)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
CHANGELOG.md
(2 hunks)rakelib/release.rake
(1 hunks)rakelib/task_helpers.rb
(1 hunks)rakelib/update_changelog.rake
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- rakelib/release.rake
- rakelib/task_helpers.rb
- rakelib/update_changelog.rake
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
CHANGELOG.md
1209-1209: Link and image reference definitions should be needed
Unused link or image reference definition: "unreleased"
(MD053, link-image-reference-definitions)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: dummy-app-integration-tests (newest)
- GitHub Check: dummy-app-integration-tests (oldest)
🔇 Additional comments (1)
CHANGELOG.md (1)
20-21
: New Version Entry for 15.0.0-alpha.2 AddedThe new version header "### [15.0.0-alpha.2] - 2025-03-07" clearly documents the release date and version. Please ensure that the associated release notes (referenced by the Release Notes link) are up-to-date and in sync with this changelog entry.
42f6699
to
9bc3447
Compare
9bc3447
to
296e025
Compare
Summary
Update the release task post-instructions to make
Gemfile.lock
stable after release.Pull Request checklist
[ ] Add/update test to cover these changes[ ] Update documentation[ ] Update CHANGELOG fileThis change is
Summary by CodeRabbit
Chores
Gemfile.lock
andCHANGELOG.md
after publication.bundle install
command after publication.New Features
CHANGELOG.md
file, improving the documentation process for version releases.Documentation
15.0.0-alpha.2
in theCHANGELOG.md
, including updated links for version comparisons.