-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix: CI - Hard Reset at changeset versioning #118 #119
Conversation
|
WalkthroughThe pull request introduces enhancements to the GitHub Actions workflow defined in Changes
Possibly related PRs
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 (
|
Triggered from #119 by @black7375. Checking if we can fast forward Target branch ( commit 3b26c193de8b4a5e4acd651f4d82cf706e01d35b (HEAD -> main, tag: @mincho-js/transform-to-vanilla@0.0.3, tag: @mincho-js/css@0.0.4, origin/main, origin/HEAD)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Mon Sep 30 19:42:10 2024 +0900
Chore: Version Packages Pull request ( commit a622db098de896208b38b097783448a1287e698c (pull_request/versioning-pr)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Tue Oct 1 16:13:57 2024 +0900
Fix: CI - Hard Reset at changeset versioning #118 It is possible to fast forward |
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
🧹 Outside diff range and nitpick comments (3)
.github/workflows/fast-forward.yml (3)
Line range hint
59-99
: Excellent addition of PR merge check with retry mechanismThe implementation of
check_pr_merged
function with a retry mechanism is a great improvement. It ensures that the workflow doesn't fail due to potential delays in PR merging. The code is well-structured and includes proper error handling.One minor suggestion for improvement:
Consider extracting the
max_attempts
andsleep_duration
as variables at the beginning of the script. This would make it easier to adjust these values in the future if needed. For example:MAX_ATTEMPTS=30 SLEEP_DURATION=1 # ... rest of the script
Line range hint
152-158
: Improved error handling in log displayThe adjustment to the "Show log on failure" step is a good improvement. By adding
|| exit
to thecd
command, you ensure that the script exits gracefully if it can't access the log directory. This prevents potential issues with trying to read logs from an incorrect location.One minor suggestion for further improvement:
Consider adding an error message when the directory change fails. This will make it clearer what went wrong if the step fails. Here's an example:
- name: Show log on failure if: failure() run: | cd /home/runner/.npm/_logs/ || { echo "Failed to change to log directory"; exit 1; } for file in *; do echo "=== File: $file ===" cat "$file" echo -e "\n\n" doneThis change will provide more context in case of a failure, making it easier to diagnose issues.
127-127
: Minor: Quote variables to prevent word splittingTo address the static analysis hint and improve script safety:
Consider quoting the
$md_files
variable to prevent potential word splitting issues. While it's likely safe in the current context, it's a good shell scripting practice. Here's the suggested change:- if [ -n "$md_files" ]; then + if [ -n "${md_files}" ]; thenThis change ensures that the variable is treated as a single entity, preventing any potential issues with word splitting or globbing.
🧰 Tools
🪛 actionlint
127-127: shellcheck reported issue in this script: SC2086:info:4:35: Double quote to prevent globbing and word splitting
(shellcheck)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- .github/workflows/fast-forward.yml (4 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/fast-forward.yml
127-127: shellcheck reported issue in this script: SC2086:info:4:35: Double quote to prevent globbing and word splitting
(shellcheck)
134-134: property "pr_sha" is not defined in object type {should_run: string}
(expression)
🔇 Additional comments (2)
.github/workflows/fast-forward.yml (2)
136-142
: Effective implementation of hard reset before versioningThe modification to the
version
command in the "Create Release Pull Request or Publish to npm" step is well-implemented. By resetting to thechangeset-release/main
branch before running the versioning command, you ensure that the versioning process is based on the most recent and accurate state of the codebase.This change aligns perfectly with the PR objectives of implementing a hard reset during the versioning process. It should effectively address the issues mentioned in the related issue #118.
Line range hint
1-158
: Overall: Excellent improvements to the workflowThis pull request introduces several valuable enhancements to the "fast-forward and release" workflow:
- The addition of a retry mechanism for checking PR merge status improves reliability.
- The new "Is versioning PR" step effectively manages the versioning process.
- The implementation of a hard reset before versioning ensures accuracy.
- Error handling has been improved throughout the workflow.
These changes align well with the PR objectives and should effectively address the issues mentioned in #118. The code quality is high, and the modifications are well-thought-out.
A few minor suggestions have been made to further improve the code, but these are not critical. Great work on enhancing this workflow!
🧰 Tools
🪛 actionlint
124-124: description is required in metadata of "Setup" action at "/cache/34/d5746033-993b-42a9-becb-d6907f600eac/home/jailuser/git/.github/actions/node-setup/action.yml"
(action)
127-127: shellcheck reported issue in this script: SC2086:info:4:35: Double quote to prevent globbing and word splitting
(shellcheck)
134-134: property "pr_sha" is not defined in object type {should_run: string}
(expression)
a622db0
to
d5e2ba2
Compare
Triggered from #119 by @black7375. Checking if we can fast forward Target branch ( commit 3b26c193de8b4a5e4acd651f4d82cf706e01d35b (HEAD -> main, tag: @mincho-js/transform-to-vanilla@0.0.3, tag: @mincho-js/css@0.0.4, origin/main, origin/HEAD)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Mon Sep 30 19:42:10 2024 +0900
Chore: Version Packages Pull request ( commit d5e2ba2028355f39deb4990d9312faf1d2ea3eda (pull_request/versioning-pr)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Tue Oct 1 16:34:08 2024 +0900
Fix: CI - Hard Reset at changeset versioning #118 It is possible to fast forward |
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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- .github/workflows/fast-forward.yml (5 hunks)
🧰 Additional context used
🪛 actionlint
.github/workflows/fast-forward.yml
128-128: shellcheck reported issue in this script: SC2086:info:4:35: Double quote to prevent globbing and word splitting
(shellcheck)
🔇 Additional comments (4)
.github/workflows/fast-forward.yml (4)
19-20
: LGTM: New output for PR SHAThe addition of the
pr_sha
output to thefast-forward
job is a good improvement. It allows the SHA of the pull request to be passed to subsequent jobs, which can be useful for various operations, such as the new versioning step added later in this workflow.
Line range hint
60-97
: Excellent addition: Robust PR merge checkThe new
check_pr_merged
function is a great improvement to the workflow. It implements a retry mechanism that checks the merge status of a PR up to 30 times with a 1-second delay between attempts. This approach effectively addresses potential race conditions in the CI process and improves the overall reliability of the workflow.Key benefits:
- Increased resilience against temporary API issues or delays in merge status updates.
- Improved handling of fast-forward scenarios where the merge might not be immediately reflected.
- Clear error handling if the maximum number of attempts is reached.
This change demonstrates thoughtful consideration of real-world CI challenges.
98-100
: LGTM: Storing PR SHA for later useThis change correctly retrieves the HEAD SHA of the merged PR and stores it as an output variable. This is a crucial step that enables the new versioning process introduced later in the workflow. The implementation is straightforward and effective.
143-143
: LGTM: Improved versioning processThe modification to the
version
command in the "Create Release Pull Request or Publish to npm" step is an excellent improvement. By performing a hard reset to thechangeset-release/main
branch before running the versioning command, this change ensures that:
- The versioning process always starts from a clean, known state.
- Any potential conflicts or inconsistencies from previous runs are eliminated.
- The versioning accurately reflects the most recent state of the codebase.
This change directly addresses the PR objective of implementing a hard reset during versioning, which should lead to more reliable and consistent release processes.
/fast-forward |
Triggered from #119 (comment) by @black7375. Trying to fast forward Target branch ( commit 3b26c193de8b4a5e4acd651f4d82cf706e01d35b (HEAD -> main, tag: @mincho-js/transform-to-vanilla@0.0.3, tag: @mincho-js/css@0.0.4, origin/main, origin/HEAD)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Mon Sep 30 19:42:10 2024 +0900
Chore: Version Packages Pull request ( commit d5e2ba2028355f39deb4990d9312faf1d2ea3eda (pull_request/versioning-pr)
Author: alstjr7375 <alstjr7375@daum.net>
Date: Tue Oct 1 16:34:08 2024 +0900
Fix: CI - Hard Reset at changeset versioning #118 Fast forwarding $ git push origin d5e2ba2028355f39deb4990d9312faf1d2ea3eda:main
To https://github.com/mincho-js/mincho.git
3b26c19..d5e2ba2 d5e2ba2028355f39deb4990d9312faf1d2ea3eda -> main |
Description
changeset-release/main
branch with PR_SHARelated Issue
Summary by CodeRabbit
New Features
Improvements
Additional context
Even if this PR is merged, you cannot be sure that it will be fixed, so you should not close it.
Checklist