Skip to content

CopyArtifacts: write trailing newline to match prettier (fix copy-artifacts CI) - #518

Merged
thedavidmeister merged 7 commits into
mainfrom
2026-05-27-regen-artifacts
May 27, 2026
Merged

CopyArtifacts: write trailing newline to match prettier (fix copy-artifacts CI)#518
thedavidmeister merged 7 commits into
mainfrom
2026-05-27-regen-artifacts

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented May 27, 2026

Copy link
Copy Markdown
Contributor

The copy-artifacts determinism check has been failing on main. Root cause: a conflict between two CI checks over crates/bindings/abi/*.json:

  • CopyArtifacts.sol wrote each abi JSON with no trailing newline
  • prettier-rainix (now enforced in CI via rainix#195) adds a trailing newline to JSON

The committed files have newlines (prettier-happy), so the determinism check (git diff --exit-code after regenerating) failed because CopyArtifacts stripped them.

Fix: append a newline in vm.writeFile so the generated artifact matches both the committed file and prettier. Re-running CopyArtifacts.sol --ffi now produces a no-op diff against the committed abis (verified locally) — the determinism check passes, prettier stays happy, and no committed artifact changes.

This unblocks all rainlang PRs (incl. #516 parser publish), which were red on the pre-existing copy-artifacts failure.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Fixed artifact formatting to ensure committed files include a trailing newline, avoiding formatting hook mismatches.
  • Chores

    • Improved CI workflow caching to use a prebuilt cache for faster builds, increased cache size limits, and made cache retrieval tolerant of failures.

Review Change Stack

The copy-artifacts determinism check has been failing on main: CopyArtifacts.sol
wrote each abi JSON without a trailing newline, but the committed files (and the
prettier-rainix pre-commit hook, now enforced in CI via rainix#195) expect a
final newline on JSON. The two checks fought over crates/bindings/abi/*.json.

Append a newline in vm.writeFile so the generated artifact matches both the
committed file and prettier. Re-running CopyArtifacts now produces a no-op diff
against the committed abis (verified), so the determinism check passes without
changing any committed artifact.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this May 27, 2026
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@thedavidmeister, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 39 minutes and 10 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d6971eb4-22af-49a5-a5d6-a10cb8679510

📥 Commits

Reviewing files that changed from the base of the PR and between 2a047a7 and 5c29b7f.

📒 Files selected for processing (1)
  • .github/workflows/copy-artifacts.yaml
📝 Walkthrough

Walkthrough

Append a trailing newline when writing committed artifact files in script/CopyArtifacts.sol, and add a Cachix fetch step plus increase the Nix cache GC limit in .github/workflows/copy-artifacts.yaml.

Changes

Artifact & Workflow Updates

Layer / File(s) Summary
Trailing newline for artifact files
script/CopyArtifacts.sol
_copyAbi now appends "\n" when calling vm.writeFile and includes comments explaining the newline is required to match prettier-formatted committed artifacts and avoid determinism/prettier hook mismatches.
Cachix fetch step and Nix cache size update
.github/workflows/copy-artifacts.yaml
Adds a Cachix step that fetches Nix store paths from the rainlanguage Cachix cache (uses secrets.CACHIX_AUTH_TOKEN if present) with continue-on-error: true, and increases gc-max-store-size-linux from 1G to 8G in the Nix cache action.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Poem

🐰 A tiny hop, a newline bright,
Keeps artifacts tidy, snug, and right.
CI fetches caches with a cheerful cheer,
Builds run faster, the path is clear. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: appending a trailing newline to CopyArtifacts.sol to match prettier formatting and fix the copy-artifacts CI determinism check.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-05-27-regen-artifacts

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

Comment @coderabbitai help to get the list of available commands and usage tips.

thedavidmeister and others added 5 commits May 27, 2026 15:53
rainlang-prelude builds the rain CLI via nix buildRustPackage, which fetches
each crate dep through nix builtin fetcher from crates.io — whose download
endpoint 403s nix UAs for crates not mirrored on cache.nixos.org (e.g.
alloy-json-abi). Add cachix-action so those derivations substitute from the
rainlanguage cache instead, and raise the store GC cap 1G->8G so the toolchain
survives between runs (matches rainlanguage/rainix#196/#197).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/copy-artifacts.yaml:
- Around line 18-22: Replace the mutable tag cachix/cachix-action@v15 with the
exact commit SHA to pin the action (use
cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc) so the workflow
cannot change unexpectedly; update the uses entry in the workflow to reference
that SHA, keep continue-on-error and with: blocks unchanged, and commit the
change to lock the action to the specified revision.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 197a2d48-2df1-48bd-a6cf-e53665c50d94

📥 Commits

Reviewing files that changed from the base of the PR and between c29619a and 2a047a7.

📒 Files selected for processing (1)
  • .github/workflows/copy-artifacts.yaml

Comment thread .github/workflows/copy-artifacts.yaml Outdated
Replace the whole local workflow with a thin caller of
rainix-copy-artifacts.yaml (rainix#201): centralizes the build-and-assert-clean
logic + the Cachix/GC-cap resilience, and drops the rainlang-prelude step —
committing the generated artifacts is what removes the need for a prelude.
CopyArtifacts.sol still emits the trailing newline so the abis match.
@thedavidmeister
thedavidmeister merged commit 0960daa into main May 27, 2026
8 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@coderabbitai assess this PR size classification for the totality of the PR with the following criterias and report it in your comment:

S/M/L PR Classification Guidelines:

This guide helps classify merged pull requests by effort and complexity rather than just line count. The goal is to assess the difficulty and scope of changes after they have been completed.

Small (S)

Characteristics:

  • Simple bug fixes, typos, or minor refactoring
  • Single-purpose changes affecting 1-2 files
  • Documentation updates
  • Configuration tweaks
  • Changes that require minimal context to review

Review Effort: Would have taken 5-10 minutes

Examples:

  • Fix typo in variable name
  • Update README with new instructions
  • Adjust configuration values
  • Simple one-line bug fixes
  • Import statement cleanup

Medium (M)

Characteristics:

  • Feature additions or enhancements
  • Refactoring that touches multiple files but maintains existing behavior
  • Breaking changes with backward compatibility
  • Changes requiring some domain knowledge to review

Review Effort: Would have taken 15-30 minutes

Examples:

  • Add new feature or component
  • Refactor common utility functions
  • Update dependencies with minor breaking changes
  • Add new component with tests
  • Performance optimizations
  • More complex bug fixes

Large (L)

Characteristics:

  • Major feature implementations
  • Breaking changes or API redesigns
  • Complex refactoring across multiple modules
  • New architectural patterns or significant design changes
  • Changes requiring deep context and multiple review rounds

Review Effort: Would have taken 45+ minutes

Examples:

  • Complete new feature with frontend/backend changes
  • Protocol upgrades or breaking changes
  • Major architectural refactoring
  • Framework or technology upgrades

Additional Factors to Consider

When deciding between sizes, also consider:

  • Test coverage impact: More comprehensive test changes lean toward larger classification
  • Risk level: Changes to critical systems bump up a size category
  • Team familiarity: Novel patterns or technologies increase complexity

Notes:

  • the assessment must be for the totality of the PR, that means comparing the base branch to the last commit of the PR
  • the assessment output must be exactly one of: S, M or L (single-line comment) in format of: SIZE={S/M/L}
  • do not include any additional text, only the size classification
  • your assessment comment must not include tips or additional sections
  • do NOT tag me or anyone else on your comment

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

SIZE=S

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