Skip to content

subgraph-shell + rainix-subgraph-test reusable + build-subgraph.sh hook - #210

Merged
thedavidmeister merged 1 commit into
mainfrom
2026-05-30-subgraph-shell
May 30, 2026
Merged

thedavidmeister merged 1 commit into
mainfrom
2026-05-30-subgraph-shell

Conversation

@thedavidmeister

@thedavidmeister thedavidmeister commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Resolves #209.

  • Add devShells.subgraph-shell: node + the-graph + goldsky + subgraph-tasks. No rust, no foundry, no sqlite/yq/age.
  • Add rainix-subgraph-test.yaml: thin reusable that runs subgraph-test in the slim shell. End-state CI for subgraph repos with committed subgraph/abis/ + subgraph/generated/.
  • Extend rainix-copy-artifacts.yaml with an optional script/build-subgraph.sh hook (between CopyArtifacts.sol and forge fmt, run in #subgraph-shell). Consumers put their graph codegen there and the existing git diff --exit-code gate catches drift.

Test plan

  • Rainix's existing CI green (the fixture doesn't ship a subgraph, so the new reusable + hook are no-op for fixture; the flake-eval change is the main thing to verify).
  • Once merged, raindex#2605 wires up subgraph/abis/ + subgraph/generated/ + script/build-subgraph.sh + flips test-subgraph.yml to this reusable.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added new reusable testing workflow for comprehensive subgraph functionality validation
    • Enhanced CI/CD pipeline with automatic subgraph artifact regeneration during deployment
    • Improved error messages to guide developers when artifact drift is detected
    • Updated development environment setup with specialized tools for subgraph development

Review Change Stack

…sh hook

Resolves #209.

- devShells.subgraph-shell: node + the-graph + goldsky + subgraph-tasks.
  No rust, no foundry, no sqlite/yq/age — lets consumers avoid the
  heavy default closure when CI is just subgraph-test.
- rainix-subgraph-test.yaml: thin reusable that runs subgraph-test
  (matchstick) in the slim shell. Consumers commit subgraph/abis/ and
  subgraph/generated/ so the test path carries no forge build or graph
  codegen.
- rainix-copy-artifacts.yaml: optional script/build-subgraph.sh hook
  between CopyArtifacts.sol and forge fmt, run in subgraph-shell. The
  existing git diff --exit-code gate then catches stale committed
  subgraph artifacts.

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

coderabbitai Bot commented May 30, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 949501bb-3b17-4793-b4b8-fb725f267f82

📥 Commits

Reviewing files that changed from the base of the PR and between ae2b77d and 8e2547a.

📒 Files selected for processing (3)
  • .github/workflows/rainix-copy-artifacts.yaml
  • .github/workflows/rainix-subgraph-test.yaml
  • flake.nix

📝 Walkthrough

Walkthrough

This PR introduces subgraph-specific CI infrastructure by adding a lightweight dev shell in Nix, a reusable GitHub Actions workflow for running subgraph tests, and integrating subgraph artifact regeneration into the artifact consistency gate.

Changes

Subgraph CI Infrastructure

Layer / File(s) Summary
Subgraph dev shell definition
flake.nix
New devShells.subgraph-shell provides minimal tooling: node, the-graph, goldsky, and subgraph build/test/deploy tasks, with pre-commit hook and .env setup.
Subgraph test reusable workflow
.github/workflows/rainix-subgraph-test.yaml
Reusable workflow that runs on ubuntu-latest with Nix, Cachix, and Nix store caching, executing subgraph-test inside the subgraph-shell.
Subgraph artifact regeneration integration
.github/workflows/rainix-copy-artifacts.yaml
Adds conditional step to regenerate subgraph artifacts via script/build-subgraph.sh and updates consistency-check error message to include that script.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

  • rainlanguage/rainix#208: Follows the same pattern of adding a regenerate-artifacts hook (for script/build-meta.sh) and updating the copy-artifacts workflow error message.

Poem

🐰 The subgraph shell is slim and neat,
No rust or wasm to clutter the feet!
Reusable workflows now take their bow,
Artifacts built and committed—how!
CI gates keep the generated files true,
A lighter-weight path for testing through. 🎯

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 2026-05-30-subgraph-shell

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
thedavidmeister merged commit 6ffb492 into main May 30, 2026
12 of 13 checks passed
@github-actions

Copy link
Copy Markdown

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

subgraph: slim shell + reusable that runs matchstick over committed generated/

1 participant