Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

stathis-alexander
Copy link
Contributor

@changeset-bot
Copy link

changeset-bot bot commented Aug 15, 2025

⚠️ No Changeset found

Latest commit: 86e5353

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 15, 2025

Walkthrough

Adds a global env var BIOME_DOCKER_REPO=biomejs/docker. In the release workflow, renames the website dispatch step to “Codegen website schema” without changing its dispatch details. Introduces a new “Generate docker images” step that triggers a repository_dispatch to BIOME_DOCKER_REPO with the same event-type and payload as the website dispatch. The Docker dispatch runs after the website schema step within the publish-cli sections. No changes to payload format, event-type, error handling, or other steps.

Possibly related PRs

Suggested reviewers

  • ematipico
  • dyc3

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@stathis-alexander
Copy link
Contributor Author

Hi @siketyan , I apologize if this is incorrect, I am not very familiar with Github actions or this API. I believe this does the correct thing.

@stathis-alexander stathis-alexander changed the title add repository dispatch to kick off docker image build on release chore: add repository dispatch to kick off docker image build on release Aug 15, 2025
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 (4)
.github/workflows/release_cli.yml (4)

277-283: Gate on real releases and pass context as client-payload.

If the intent is to build images only for actual releases (not nightly), add an if condition. Also pass useful metadata (version, tag, prerelease) so the docker workflow can deterministically build the right images without guessing latest release.

Proposed change:

-      - name: Generate docker images
-        uses: peter-evans/repository-dispatch@v3
+      - name: Generate docker images
+        if: needs.build.outputs.prerelease != 'true'
+        uses: peter-evans/repository-dispatch@v3
         with:
-          token: ${{ secrets.GITHUB_TOKEN }}
+          token: ${{ secrets.DOCKER_DISPATCH_TOKEN }}
           repository: biomejs/docker
           event-type: build_images
+          client-payload: |
+            {
+              "version": "v${{ needs.build.outputs.version }}",
+              "tag": "cli/v${{ needs.build.outputs.version }}",
+              "prerelease": ${{ needs.build.outputs.prerelease == 'true' }}
+            }

278-278: Pin action to a commit SHA to match your supply-chain policy.

All other actions here are pinned to SHAs; this one should be too (peter-evans/repository-dispatch@). Please replace @V3 with the corresponding commit SHA.

If you want, I can fetch the exact commit SHA for v3 and propose the precise edit.


277-277: Tweak the step name for clarity.

This step triggers a build elsewhere rather than building here.

-      - name: Generate docker images
+      - name: Trigger Docker image build

277-283: Non-blocking dispatch (optional).

If you don’t want a transient failure in the docker repo to block the CLI release, consider allowing this step to be non-fatal.

-      - name: Trigger Docker image build
+      - name: Trigger Docker image build
+        continue-on-error: true
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8d5ed69 and 54dc30c.

📒 Files selected for processing (1)
  • .github/workflows/release_cli.yml (1 hunks)
🔇 Additional comments (1)
.github/workflows/release_cli.yml (1)

282-282: Confirm the event-type matches the target workflow.

Ensure the workflow in biomejs/docker listens for repository_dispatch with type build_images (not e.g. build-images). Mismatch will silently no-op.

Would you like me to double-check the target workflow event type against biomejs/docker#8?

Comment on lines 279 to 282
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: biomejs/docker
event-type: build_images
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Cross-repo dispatch will fail with GITHUB_TOKEN; use a PAT secret scoped to biomejs/docker.

GitHub’s GITHUB_TOKEN doesn’t have cross-repository rights for repository_dispatch. This will 403/404. Use a fine-grained PAT limited to biomejs/docker with the minimum necessary permissions (Contents: Read/Write), store it as a secret (e.g. DOCKER_DISPATCH_TOKEN), and reference it here.

Apply this diff:

       with:
-          token: ${{ secrets.GITHUB_TOKEN }}
+          token: ${{ secrets.DOCKER_DISPATCH_TOKEN }}
           repository: biomejs/docker
           event-type: build_images
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: biomejs/docker
event-type: build_images
with:
token: ${{ secrets.DOCKER_DISPATCH_TOKEN }}
repository: biomejs/docker
event-type: build_images
🤖 Prompt for AI Agents
.github/workflows/release_cli.yml around lines 279 to 282, the workflow uses
GITHUB_TOKEN for a cross-repo repository_dispatch which will be rejected; create
a fine-grained PAT scoped to the biomejs/docker repo with minimal permissions
(Contents: Read/Write), store it as a secret (e.g. DOCKER_DISPATCH_TOKEN) in
this repo, and update the workflow to reference that secret instead of
GITHUB_TOKEN (i.e. replace the token reference with the new secret name).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am likely unable to accomplish this without help. 🙇

@siketyan
Copy link
Member

  • We usually use release.yml, not release_cli.yml
  • We already have a bot token for using repository_dispatch. See
    - name: Dispatch event on release
    uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
    with:
    token: ${{ secrets.BIOME_REPOSITORY_DISPATCH }}
    repository: ${{ env.BIOME_WEBSITE_REPO }}
    event-type: ${{ env.BIOME_RELEASE_CLI_EVENT }}
    client-payload: |
    { "sha": "${{ github.sha }}", "tag": "@biomejs/biome@${{ needs.build-binaries.outputs.version }}", "version": "${{ needs.build-binaries.outputs.version }}" }
    for an example

@stathis-alexander
Copy link
Contributor Author

stathis-alexander commented Aug 15, 2025

Hi @siketyan , thank you for the code pointer! Very helpful.

I have moved the action to the release.yml and also consolidated on the token and event type from the other one. I have also updated the PR in the docker repo.

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 (1)
.github/workflows/release.yml (1)

386-392: Docker dispatch missing client-payload (likely needed to build the right tag)

Unlike the website dispatch above, this step doesn’t pass a client-payload (sha, tag, version). If the docker workflow expects these (very likely), this will trigger, but the build won’t know which release to build.

Proposed fix (mirror the website payload):

       - name: Generate docker images
         uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # v3
         with:
           token: ${{ secrets.BIOME_REPOSITORY_DISPATCH }}
           repository: ${{ env.BIOME_DOCKER_REPO }}
           event-type: ${{ env.BIOME_RELEASE_CLI_EVENT }}
+          client-payload: |
+            { "sha": "${{ github.sha }}", "tag": "@biomejs/biome@${{ needs.build-binaries.outputs.version }}", "version": "${{ needs.build-binaries.outputs.version }}" }

Follow-up:

  • Please confirm the docker repo’s on: repository_dispatch config matches event-type biome-release-cli-event and whether it requires the same payload keys (sha, tag, version). If it uses different names, we should align here.
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 54dc30c and 86e5353.

📒 Files selected for processing (1)
  • .github/workflows/release.yml (2 hunks)
🔇 Additional comments (2)
.github/workflows/release.yml (2)

18-18: Env var for Docker repo looks good

Introducing BIOME_DOCKER_REPO keeps things configurable and consistent with BIOME_WEBSITE_REPO.


378-385: Rename clarifies the step’s purpose

“Codegen website schema” is clearer than the previous generic label. No functional change spotted.

@siketyan siketyan merged commit c63026e into biomejs:main Aug 15, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants