Skip to content

Conversation

nerdCopter
Copy link
Member

@nerdCopter nerdCopter commented May 14, 2025

  • ensure checkout of ref: ${{ github.event.pull_request.head.sha }} for the Deployment Preview

Summary by CodeRabbit

  • Chores
    • Updated deployment workflow to trigger only on relevant pull request events and deploy the exact commit from the pull request.
    • Improved deployment process by separating build and deploy steps for greater reliability and efficiency.

Copy link
Contributor

coderabbitai bot commented May 14, 2025

Walkthrough

The GitHub Actions workflow for preview deployments was restructured by splitting the original deploy job into two separate jobs: build and deploy. The build job performs checkout, caching, Node.js setup, dependency installation, and build steps, then uploads the build artifact. The deploy job depends on build, downloads the artifact, and runs deployment and commenting steps with expanded permissions. The workflow trigger was restricted to specific pull request target events (opened, synchronize, reopened) on the master branch.

Changes

File(s) Change Summary
.github/workflows/deploy-preview.yml Split single deploy job into build and deploy jobs; build handles checkout, caching, install, build, and artifact upload; deploy downloads artifact, deploys, and comments with expanded permissions; refined workflow triggers to specific PR events on master

Suggested labels

Housekeeping

Suggested reviewers

  • haslinghuis

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between a28d625 and 76a09d3.

📒 Files selected for processing (1)
  • .github/workflows/deploy-preview.yml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/deploy-preview.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (1)
.github/workflows/deploy-preview.yml (1)

20-21: Explicitly checkout the PR head SHA
Specifying

with:
  ref: ${{ github.event.pull_request.head.sha }}

ensures the preview is built from the exact PR commit rather than a merge or default branch. This aligns perfectly with the PR’s goal.
Consider adding fetch-depth: 0 if your build or deployment requires full Git history or tag resolution.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1cecebc and 048a9a1.

📒 Files selected for processing (1)
  • .github/workflows/deploy-preview.yml (2 hunks)

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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)
.github/workflows/deploy-preview.yml (2)

15-17: Checkout uses PR head SHA and disables credentials
Using ref: ${{ github.event.pull_request.head.sha }} ensures we build the exact PR commit, and persist-credentials: false prevents GITHUB_TOKEN from leaking to untrusted code.

Consider adding fetch-depth: 0 to avoid shallow-clone issues when the head SHA isn’t in the default history. Please verify this checkout works on forked‐PRs.


72-72: Add newline at end of file
YAMLLint flagged the missing newline at EOF—append a line break to satisfy the linter.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 72-72: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 94f579f and a28d625.

📒 Files selected for processing (1)
  • .github/workflows/deploy-preview.yml (3 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/deploy-preview.yml

[error] 72-72: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (5)
.github/workflows/deploy-preview.yml (5)

4-4: Restricting trigger events is appropriate
Limiting pull_request_target to only opened, synchronize, and reopened on master reduces unnecessary runs and aligns with the preview checkout intent.


9-10: Build job separation looks good
Splitting the build phase into its own job without secrets access clearly separates concerns and follows best practices.


34-38: Artifact upload correctly configured
Uploading src/dist as dist-files is consistent with downstream download steps.


40-49: Deploy job permissions and dependency are well defined
The deploy job correctly depends on build and only grants necessary rights (contents, deployments, issues, pull-requests).


50-56: Artifact download entry is correct
The deploy job pulling dist-files for deployment aligns perfectly with the upload step; no further changes needed.

Copy link

Copy link
Contributor

Preview URL: https://70853365.betaflight-configurator.pages.dev

@kennyk1011
Copy link

kennyk1011 commented May 15, 2025 via email

Copy link
Member

@haslinghuis haslinghuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nerdCopter is this ready ?

@haslinghuis haslinghuis merged commit 16c3b2e into betaflight:master May 15, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from App to Done in 2025.12.0 May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants