Skip to content

Vendor test_fixtures ABIs so the crate publishes standalone#533

Merged
thedavidmeister merged 1 commit into
mainfrom
2026-06-12-testfixtures-self-contained
Jun 12, 2026
Merged

Vendor test_fixtures ABIs so the crate publishes standalone#533
thedavidmeister merged 1 commit into
mainfrom
2026-06-12-testfixtures-self-contained

Conversation

@thedavidmeister

Copy link
Copy Markdown
Contributor

Problem

rainlang_test_fixtures could not be published standalone. Its crates/test_fixtures/src/lib.rs has 6 alloy::sol!(...) blocks that read ABI JSON via "../bindings/abi/<Name>.json" — paths outside the crate's own directory, in the sibling bindings crate.

cargo publish packages only the crate's own directory, so those JSON files are absent from the tarball. The generated types (ERC20, Interpreter, Store, Parser, Deployer, RainlangContract) then fail to generate, producing ~28 compile errors and failed to verify package tarball. This silently failed the Package Release autopublish: the cargo step aborts before soldeer publishes.

rainlang_test_fixtures has external downstream consumers on crates.io, so it must stay published. This PR replaces the closed #532, which wrongly used publish = false (that would break those consumers).

Fix: vendor the ABIs into the crate

  • Move the 5 ABIs read only by test_fixtures out of bindings into crates/test_fixtures/abi/: TestERC20, RainlangInterpreter, RainlangStore, RainlangParser, RainlangExpressionDeployer.
  • Copy Rainlang.json (read by both crates) into crates/test_fixtures/abi/ so the crate carries its own packaged copy; bindings keeps its copy unchanged.
  • Repoint the 6 sol! paths in lib.rs from "../bindings/abi/<Name>.json" to "abi/<Name>.json".
  • Update the ABI generator so regeneration writes every committed copy: LibCopyArtifacts.committedPath becomes committedPaths(name) -> string[] returning all destinations for a contract (interfaces → bindings, Rainlang → both, the concrete contracts + TestERC20test_fixtures); CopyArtifacts.sol loops over them.
  • Grant foundry fs read-write on the new crates/test_fixtures/abi directory so the writer script can manage it.

No publish = false. package-release.yaml is untouched.

Verification

  • Regenerate, no drift: forge script script/CopyArtifacts.sol --ffi writes the ABIs to the new locations with zero git drift (the moves are recorded as 100% renames; the generator and committed files agree). This is the freshness gate the copy-artifacts CI job enforces via git diff --exit-code.
  • Standalone tarball builds — the gate that was failing: cargo publish --dry-run -p rainlang_test_fixtures succeeds.
  • Consumers still build: cargo test -p rainlang-eval --no-run and cargo test -p rainlang_cli --no-run compile clean (both dev-dep test_fixtures).
  • Sol build clean: forge build produces no errors.

This unblocks the rainlang autopublish (cargo → soldeer).

🤖 Generated with Claude Code

`rainlang_test_fixtures` read its 6 alloy `sol!` ABI JSONs from the
sibling `bindings` crate via `../bindings/abi/<Name>.json`. `cargo
publish` packages only the crate's own directory, so those JSONs were
absent from the tarball and the generated types failed to build,
breaking `cargo publish` (and the autopublish that runs cargo before
soldeer). The crate has external downstream consumers on crates.io, so
it must stay published; `publish = false` is not an option.

Vendor the ABIs the crate reads into `crates/test_fixtures/abi/` and
repoint the `sol!` paths to `abi/<Name>.json`:

- Move the 5 ABIs read only by `test_fixtures` out of `bindings`:
  TestERC20, RainlangInterpreter, RainlangStore, RainlangParser,
  RainlangExpressionDeployer.
- Copy `Rainlang.json` (read by both crates) so each carries its own
  packaged copy; `bindings` keeps its copy unchanged.

Update the artifact generator so regeneration writes every committed
copy: `LibCopyArtifacts.committedPath` becomes `committedPaths` returning
all destinations for a contract (interfaces -> bindings, Rainlang ->
both, the concrete contracts + TestERC20 -> test_fixtures), and
`CopyArtifacts.sol` loops over them. Grant foundry fs read-write on the
new `crates/test_fixtures/abi` dir so the writer can manage it.

Regenerating via `forge script CopyArtifacts.sol --ffi` produces the
committed files with zero drift.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@thedavidmeister thedavidmeister self-assigned this Jun 12, 2026
@coderabbitai

coderabbitai Bot commented Jun 12, 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 8 minutes and 22 seconds. Learn how PR review limits work.

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

⌛ 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: 3c890b55-a074-4f83-8cd0-5810c292046d

📥 Commits

Reviewing files that changed from the base of the PR and between 44bfa2c and 274bce7.

📒 Files selected for processing (10)
  • crates/test_fixtures/abi/Rainlang.json
  • crates/test_fixtures/abi/RainlangExpressionDeployer.json
  • crates/test_fixtures/abi/RainlangInterpreter.json
  • crates/test_fixtures/abi/RainlangParser.json
  • crates/test_fixtures/abi/RainlangStore.json
  • crates/test_fixtures/abi/TestERC20.json
  • crates/test_fixtures/src/lib.rs
  • foundry.toml
  • script/CopyArtifacts.sol
  • script/lib/LibCopyArtifacts.sol
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-06-12-testfixtures-self-contained

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

Copy link
Copy Markdown
Contributor Author

Reviewed 274bce7: Makes rainlang_test_fixtures build standalone in its published tarball — vendors the 6 ABIs it reads into crates/test_fixtures/abi/, repoints the sol! paths, and routes the CopyArtifacts generator (committedPaths multi-dest) so regeneration has zero drift. cargo publish --dry-run -p rainlang_test_fixtures now passes (the exact step that was aborting the autopublish before soldeer); eval/cli still compile; copy-artifacts + rs-test green. Keeps the crate published for its downstream consumers (no publish=false). Unblocks the rainlang autopublish.

@thedavidmeister

Copy link
Copy Markdown
Contributor Author

Reviewed 274bce7: Approved by repo owner. Vendors test_fixtures' 6 ABIs into crates/test_fixtures/abi/ + repoints sol! paths + routes the CopyArtifacts generator (committedPaths multi-dest) — copy-artifacts regenerates them at the new path and the whole-tree git diff guards drift. cargo publish --dry-run -p rainlang_test_fixtures passes (the step that was aborting the autopublish); eval/cli compile; CI green. Keeps the crate published for downstream consumers.

@thedavidmeister thedavidmeister merged commit 3122f3d into main Jun 12, 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

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