Skip to content
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

[cicd] publish nightly #2550

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

[cicd] publish nightly #2550

wants to merge 8 commits into from

Conversation

mikeland73
Copy link
Contributor

@mikeland73 mikeland73 commented Mar 4, 2025

Summary

Upload nightly ubuntu build so we can use it devbox install action.

Available at nightly-ubuntu.dev-jetify.com

How was it tested?

Community Contribution License

All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.

By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
Community Contribution License.

Summary by CodeRabbit

  • New Features
    • Introduced an automated deployment step that updates the public DNS record with the endpoint of the latest nightly build. This enhancement ensures that users are consistently routed to the most recent version via a stable and secure domain. By streamlining the DNS update process, nightly releases become more reliable and immediately accessible.

Copy link

coderabbitai bot commented Mar 4, 2025

📝 Walkthrough

Walkthrough

The changes introduce a new job step named "Publish to Cloudflare DNS" in the GitHub Actions workflow file .github/workflows/cli-tests.yaml. This step is designed to publish a DNS record to Cloudflare after the devbox artifact is uploaded. It utilizes environment variables for Cloudflare API authentication and zone identification, and includes a curl command to send a PATCH request to the Cloudflare API for updating a ruleset with a redirect action. A commented-out condition indicates that this step is intended for scheduled builds on Ubuntu.

Changes

File(s) Change Summary
.github/.../cli-tests.yaml Added a new job step ("Publish to Cloudflare DNS") that uses a curl command to send a PATCH request to update a ruleset in Cloudflare after artifact upload.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow as GitHub Workflow
    participant API as Cloudflare API
    Workflow->>Workflow: Upload devbox artifact
    Workflow->>API: PATCH request to update ruleset with redirect
    API-->>Workflow: Response confirming ruleset update
Loading

Poem

Hoppity, hoppity, I scurry with glee,
A DNS record now dances in the DNS sea.
Cloudflare’s magic in a single curl command,
Enhances our workflow as it takes the stand.
With secrets and records, our code hops high—
A nifty update beneath the big, blue sky!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f114bb and 2460f63.

📒 Files selected for processing (1)
  • .github/workflows/cli-tests.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/cli-tests.yaml
⏰ Context from checks skipped due to timeout of 90000ms (25)
  • GitHub Check: test-nix-versions (macos-13, 2.24.7)
  • GitHub Check: test-nix-versions (macos-13, 2.19.2)
  • GitHub Check: test-nix-versions (macos-13, 2.18.0)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-off, 2.20.1)
  • GitHub Check: test-nix-versions (macos-13, 2.17.0)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-off, 2.19.2)
  • GitHub Check: test-nix-versions (macos-13, 2.16.1)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-off, 2.12.0)
  • GitHub Check: test-nix-versions (macos-13, 2.15.1)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-only, 2.20.1)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.24.7)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-only, 2.19.2)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.19.2)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-only, 2.12.0)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.18.0)
  • GitHub Check: auto-nix-install (macos-13, false)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.17.0)
  • GitHub Check: auto-nix-install (macos-13, true)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.16.1)
  • GitHub Check: auto-nix-install (ubuntu-latest, false)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.15.1)
  • GitHub Check: auto-nix-install (ubuntu-latest, true)
  • GitHub Check: Test Flake Build
  • GitHub Check: golangci-lint (macos-13)
  • GitHub Check: golangci-lint (ubuntu-latest)

🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

@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/cli-tests.yaml (2)

70-72: Step Initialization - Conditional Execution:
The new job step "Publish to Cloudflare DNS" is clearly introduced. However, the conditional line (if: github.event_name == 'schedule') is currently commented out. Please confirm whether you intend this step to run only on scheduled (nightly) builds, and if so, consider uncommenting or parameterizing this condition to avoid accidental execution during non-scheduled events.


76-87: DNS Record API Invocation:
The curl command initiates a POST request to Cloudflare to create a CNAME record with the constructed artifact URL. Consider the following enhancements:

  • Error Handling: Adding the -f flag (or similar error checks) to the curl command can help fail fast if the HTTP request doesn’t succeed.
  • Payload Clarity: The current construction of the JSON payload (using single quotes with embedded variable expansion) works, but using a HEREDOC or another clearer syntax might improve readability and reduce potential quoting pitfalls.
  • URL Validation: Verify that the constructed ARTIFACT_URL is formatted as intended and points to a valid target for a CNAME record.
    Example diff for adding an error flag:
-          curl -X POST "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/dns_records" \
+          curl -f -X POST "https://api.cloudflare.com/client/v4/zones/$CLOUDFLARE_ZONE_ID/dns_records" \
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 643a3c4 and 02b648d.

📒 Files selected for processing (1)
  • .github/workflows/cli-tests.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (23)
  • GitHub Check: test-nix-versions (macos-13, 2.24.7)
  • GitHub Check: test-nix-versions (macos-13, 2.19.2)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-off, 2.20.1)
  • GitHub Check: test-nix-versions (macos-13, 2.18.0)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-off, 2.19.2)
  • GitHub Check: test-nix-versions (macos-13, 2.17.0)
  • GitHub Check: test-nix-versions (macos-13, 2.16.1)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-off, 2.12.0)
  • GitHub Check: test-nix-versions (macos-13, 2.15.1)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-only, 2.20.1)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.24.7)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-only, 2.19.2)
  • GitHub Check: auto-nix-install (macos-13, false)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.19.2)
  • GitHub Check: test (not-main, ubuntu-latest, project-tests-only, 2.12.0)
  • GitHub Check: auto-nix-install (macos-13, true)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.18.0)
  • GitHub Check: auto-nix-install (ubuntu-latest, false)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.17.0)
  • GitHub Check: auto-nix-install (ubuntu-latest, true)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.16.1)
  • GitHub Check: test-nix-versions (ubuntu-latest, 2.15.1)
  • GitHub Check: golangci-lint (macos-13)
🔇 Additional comments (1)
.github/workflows/cli-tests.yaml (1)

73-75: Environment Variable Configuration:
The Cloudflare API token and zone ID are properly sourced from GitHub secrets. Please ensure that the secrets CLOUDFLARE_API_TOKEN and CLOUDFLARE_ZONE_ID are configured in your repository settings and are kept secure.

@mikeland73 mikeland73 requested review from loreto and Lagoja March 5, 2025 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants