Skip to content

Fix CI#17

Closed
0xgleb wants to merge 2 commits into
mainfrom
fix/ci-cache
Closed

Fix CI#17
0xgleb wants to merge 2 commits into
mainfrom
fix/ci-cache

Conversation

@0xgleb
Copy link
Copy Markdown
Contributor

@0xgleb 0xgleb commented May 29, 2025

Motivation

Magic Nix Cache is deprecated and makes CI stuck

Solution

Switch to a different Nix setup

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

Summary by CodeRabbit

  • Chores
    • Improved workflow performance and reliability by updating Nix installation and caching steps.
    • Added concurrency control to prevent overlapping workflow runs on non-main branches.
    • Standardized formatting in workflow input descriptions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2025

Walkthrough

The GitHub Actions workflows were updated to standardize Nix installation using nixbuild/nix-quick-install-action@v30 and to add Nix store caching with nix-community/cache-nix-action@v6. The rainix.yaml workflow also introduces concurrency control to cancel redundant runs on non-main branches. Other workflow steps remain unchanged.

Changes

File(s) Change Summary
.github/workflows/publish.yml Replaced Nix installer action, added Nix store caching, standardized input formatting for version-level.
.github/workflows/rainix.yaml Replaced Nix installer and cache actions, added Nix store caching, introduced concurrency control for runs.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Nix Quick Installer
    participant Nix Store Cache
    participant Workflow Steps

    GitHub Actions->>Nix Quick Installer: Install Nix (keep-env-derivations, keep-outputs)
    GitHub Actions->>Nix Store Cache: Restore Nix store cache (keyed on OS and Nix files)
    GitHub Actions->>Workflow Steps: Execute remaining workflow steps
    GitHub Actions->>Nix Store Cache: Save updated Nix store cache (limit GC to 1GB on Linux)
Loading
sequenceDiagram
    participant GitHub Actions
    participant Concurrency Control
    participant Nix Quick Installer
    participant Nix Store Cache
    participant Workflow Steps

    GitHub Actions->>Concurrency Control: Check for concurrent runs (cancel if not main)
    GitHub Actions->>Nix Quick Installer: Install Nix (keep-env-derivations, keep-outputs)
    GitHub Actions->>Nix Store Cache: Restore Nix store cache (keyed on OS and Nix files)
    GitHub Actions->>Workflow Steps: Execute remaining workflow steps
    GitHub Actions->>Nix Store Cache: Save updated Nix store cache (limit GC to 1GB on Linux)
Loading

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.

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
Copy Markdown

@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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fa0cc05 and 2d53edf.

📒 Files selected for processing (2)
  • .github/workflows/publish.yml (2 hunks)
  • .github/workflows/rainix.yaml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: standard-tests (macos-latest, rainix-rs-test)
  • GitHub Check: standard-tests (macos-latest, rainix-rs-artifacts)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-rs-artifacts)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-rs-static)
  • GitHub Check: standard-tests (ubuntu-latest, rainix-rs-test)
🔇 Additional comments (7)
.github/workflows/rainix.yaml (3)

4-6: Verify concurrency for intended events
Concurrency is configured for push events only. Please confirm whether pull_request or other triggers also need redundant-run cancellation to avoid overlapping workflows on PR updates.


29-33: Standardize Nix installation
Replacing the deprecated installer with nixbuild/nix-quick-install-action@v30 and enabling keep-env-derivations/keep-outputs flags aligns with current best practices for reproducible builds.


34-44: Implement Nix store caching
Adding nix-community/cache-nix-action@v6 with a primary key based on OS and your Nix files, and a 1 GB GC limit, will dramatically speed up CI runs by reusing previous store contents.

.github/workflows/publish.yml (4)

6-6: Standardize input description quoting
Switching to double quotes for the description field improves readability and consistency with typical YAML conventions.


10-14: Remove trailing whitespace in options
Cleaning up trailing spaces in the options list prevents potential YAML parsing quirks and keeps formatting tidy.

Also applies to: 16-16


27-31: Unify Nix installer across workflows
Using nixbuild/nix-quick-install-action@v30 here matches the change in rainix.yaml, ensuring both workflows share the same Nix setup.


33-42: Cache Nix store during publishing
Restoring and saving the Nix store with nix-community/cache-nix-action@v6 and a GC threshold will speed up release jobs by reusing previously built derivations.


- name: Build for wasm target
run: nix develop -c cargo build --target wasm32-unknown-unknown No newline at end of file
run: nix develop -c cargo build --target wasm32-unknown-unknown
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 29, 2025

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Ensure consistent Nix CLI options
Other steps use --command, whereas here you’re using -c. For consistency—and to avoid confusion—you may want to switch to the long-form flag:

-run: nix develop -c cargo build --target wasm32-unknown-unknown
+run: nix develop --command cargo build --target wasm32-unknown-unknown
📝 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
run: nix develop -c cargo build --target wasm32-unknown-unknown
run: nix develop --command cargo build --target wasm32-unknown-unknown
🤖 Prompt for AI Agents
In .github/workflows/rainix.yaml at line 54, replace the short-form Nix CLI
option '-c' with the long-form '--command' to maintain consistency with other
steps. Change the command to use '--command' before 'cargo build --target
wasm32-unknown-unknown' to align with the rest of the workflow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Both versions are fine

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@0xgleb, understood! I'll note that both -c and --command are acceptable for Nix CLI options in this codebase.

      (\   /)
     ( ._.)
    o_(")(")

✏️ Learnings added
Learnt from: 0xgleb
PR: rainlanguage/rain.error#17
File: .github/workflows/rainix.yaml:54-54
Timestamp: 2025-05-29T19:50:09.099Z
Learning: In the rainlanguage/rain.error repository, both short-form `-c` and long-form `--command` are acceptable for Nix CLI options in GitHub workflows, and consistency between them is not required.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@0xgleb 0xgleb closed this Jun 2, 2025
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.

1 participant