-
Notifications
You must be signed in to change notification settings - Fork 2
🎁 Adding PR previews #2
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
|
Warning Rate limit exceeded@cardil has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 25 minutes and 30 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. 📒 Files selected for processing (1)
WalkthroughThe pull request introduces updates to GitHub Actions workflows for documentation deployment and closed pull request management. Key changes include renaming the workflow, upgrading action versions, and changing the runner environment to Ubuntu 24.04. A new workflow for handling closed pull requests has been added, featuring a job to delete preview directories and comment on the pull request closure. These modifications enhance the CI/CD process by streamlining preview management and ensuring the use of the latest GitHub Actions versions. Changes
Sequence DiagramsequenceDiagram
participant PR as Pull Request
participant Workflow as GitHub Actions
participant Pages as GitHub Pages
participant Comment as PR Comment
PR ->> Workflow: Open/Update
Workflow ->> Pages: Deploy Preview
Workflow ->> Comment: Add Preview Link
PR ->> Workflow: Close
Workflow ->> Pages: Delete Preview
Workflow ->> Comment: Notify Preview Deleted
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 (
|
|
A preview of e3b3d81 is uploaded and can be seen here: ✨ https://cardil.github.io/solution-pattern-event-mesh-for-microservices/pull-2 ✨ Changes may take a few minutes to propagate. The source is here: https://github.com/cardil/solution-pattern-event-mesh-for-microservices/tree/gh-pages/pull-2 |
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 (7)
.github/workflows/pr-close.yml (2)
17-24: Consider adding error handling for the preview deletionThe preview deletion step should handle cases where the preview directory doesn't exist (e.g., if the PR was never deployed).
- name: Removing PR preview uses: JamesIves/github-pages-deploy-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} folder: "${{ env.SITE_DIR }}" target-folder: "${{ env.PR_PATH }}" commit-message: "[CI] Delete Preview for PR #${{ github.event.number }}" + clean: true + clean-exclude: | + .nojekyll
25-32: Add newline at end of fileAdd a newline at the end of the file to comply with POSIX standards.
number: ${{ github.event.number }} id: deploy-preview message: "🪓 PR closed, deleted preview at https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }}" +🧰 Tools
🪛 yamllint (1.35.1)
[error] 32-32: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/docs.yml (5)
33-37: Consider restricting permissions scopeThe current permissions might be broader than necessary. The workflow only needs:
contents: writefor deploying to gh-pagespull-requests: writefor commentingpermissions: contents: write pull-requests: write - repository-projects: write - id-token: write
51-55: Add branch protection for gh-pages deploymentConsider adding branch protection to ensure deployments only happen from authorized sources.
Add these parameters to the deploy action:
uses: JamesIves/github-pages-deploy-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} folder: "${{ env.SITE_DIR }}" commit-message: "[CI] Publish Documentation for ${{ github.sha }}" + branch: gh-pages + clean: true + clean-exclude: | + pull-* + .nojekyll
80-81: Add validation for BASE_URL constructionThe BASE_URL construction should handle potential special characters in repository names.
- name: Set base URL for preview - run: echo "BASE_URL=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ env.PR_PATH }}" >> "$GITHUB_ENV" + run: | + REPO_NAME=$(echo "${{ github.event.repository.name }}" | tr '[:upper:]' '[:lower:]') + echo "BASE_URL=https://${{ github.repository_owner }}.github.io/${REPO_NAME}/${{ env.PR_PATH }}" >> "$GITHUB_ENV"
106-113: Fix formatting in PR comment messageRemove trailing spaces and add a newline at the end of the file.
message: | A preview of ${{ github.event.pull_request.head.sha }} is uploaded and can be seen here: - ✨ ${{ env.BASE_URL }} ✨ - Changes may take a few minutes to propagate. - The source is here: https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }} +🧰 Tools
🪛 yamllint (1.35.1)
[error] 108-108: trailing spaces
(trailing-spaces)
[error] 110-110: trailing spaces
(trailing-spaces)
[error] 112-112: trailing spaces
(trailing-spaces)
[error] 113-113: no new line character at the end of file
(new-line-at-end-of-file)
71-78: Consider adding timeout for deployment statusAdd a timeout to the initial status comment to prevent hanging deployments.
- name: Comment on PR uses: hasura/[email protected] with: github-token: ${{ secrets.GITHUB_TOKEN }} repository: ${{ github.repository }} number: ${{ github.event.number }} id: deploy-preview message: "Starting deployment of preview for ${{ github.event.pull_request.head.sha }} ⏳..." + timeout-minutes: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/docs.yml(2 hunks).github/workflows/pr-close.yml(1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/pr-close.yml
[error] 32-32: no new line character at the end of file
(new-line-at-end-of-file)
.github/workflows/docs.yml
[error] 56-56: trailing spaces
(trailing-spaces)
[error] 108-108: trailing spaces
(trailing-spaces)
[error] 110-110: trailing spaces
(trailing-spaces)
[error] 112-112: trailing spaces
(trailing-spaces)
[error] 113-113: no new line character at the end of file
(new-line-at-end-of-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: 1
🧹 Nitpick comments (2)
.github/workflows/pr-close.yml (2)
16-17: Consider using a safer path constructionThe PR path construction could benefit from additional sanitization to prevent potential path traversal issues.
env: SITE_DIR: "gh-pages" - PR_PATH: pull-${{ github.event.number }} + PR_PATH: pull-${{ github.event.number | replace('/','_') }}
22-37: Add newline at end of fileAdd a newline character at the end of the file to comply with YAML best practices.
number: ${{ github.event.number }} id: deploy-preview - message: "🪓 PR closed, deleted preview at https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }}" + message: "🪓 PR closed, deleted preview at https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }}" +🧰 Tools
🪛 yamllint (1.35.1)
[error] 37-37: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/pr-close.yml(1 hunks)
🧰 Additional context used
🪛 yamllint (1.35.1)
.github/workflows/pr-close.yml
[error] 37-37: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (2)
.github/workflows/pr-close.yml (2)
1-5: LGTM! Workflow trigger is properly configured.
The workflow is correctly set to trigger when pull requests are closed.
19-20: Remove unnecessary directory creation step
The Make empty dir step is not needed since the github-pages-deploy-action will handle the directory management.
- - name: Make empty dir
- run: "mkdir -p ${{ env.PR_PATH }}"Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Improvements
Bug Fixes