Conversation
WalkthroughThe GitHub Actions workflow for manual subgraph deployment is restructured to replace a single deployment step with multiple granular steps: explicit dependency installation, npm ci, graph code generation, and a per-network deployment loop that checks for existing deployments before building and deploying to each network from networks.json. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can use OpenGrep to find security vulnerabilities and bugs across 17+ programming languages.OpenGrep is compatible with Semgrep configurations. Add an |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/manual-subgraph-deploy.yml:
- Around line 31-37: The workflow currently runs raw graph tool commands (nix
develop -c graph codegen / graph build) which bypass the repo’s canonical
subgraph pipeline; replace those steps so the job uses the repository wrappers:
run nix develop -c subgraph-build (which performs codegen and build) instead of
nix develop -c graph codegen/graph build, and add a step to run nix develop -c
subgraph-test before the deploy step; update the corresponding occurrences (the
step invoking "nix develop -c graph codegen" and the build step around lines
referenced, and also the steps at the other occurrence noted for lines 50-51) to
ensure the manual deploy gates on subgraph-build and subgraph-test.
- Around line 44-52: The current deployment existence check uses a substring
grep on the summary output (the "DEPLOY_NAME" variable tested via `goldsky
subgraph list --filter deployments --summary | grep -q "${DEPLOY_NAME}"`),
causing collisions like "rain-metaboard-base" matching
"rain-metaboard-base-sepolia"; change this to an exact lookup by replacing the
grep with an exact-match test (e.g., `grep -xF "${DEPLOY_NAME}"`), or better,
call the goldsky CLI with its exact-name filter/flag if available (use `goldsky
subgraph list` with a name filter or `--name "${DEPLOY_NAME}"`) so the check
only returns true for that exact DEPLOY_NAME.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 01f73f8e-ffa9-486b-ad94-f9abb7de105a
📒 Files selected for processing (1)
.github/workflows/manual-subgraph-deploy.yml
| - run: nix develop -c rainix-sol-prelude | ||
|
|
||
| - run: nix develop -c npm ci | ||
| working-directory: subgraph | ||
|
|
||
| - run: nix develop -c graph codegen | ||
| working-directory: subgraph |
There was a problem hiding this comment.
Gate this workflow on the repo’s canonical subgraph build/test commands.
This path now deploys artifacts built with raw graph codegen/graph build commands and never runs subgraph-test, so the manual deploy workflow can publish a subgraph that has not gone through the repo’s required build/test path. Please switch this workflow to subgraph-build and run subgraph-test before deploy. Based on learnings, Subgraph must be built using nix develop -c subgraph-build and tested using nix develop -c subgraph-test.
Also applies to: 50-51
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/manual-subgraph-deploy.yml around lines 31 - 37, The
workflow currently runs raw graph tool commands (nix develop -c graph codegen /
graph build) which bypass the repo’s canonical subgraph pipeline; replace those
steps so the job uses the repository wrappers: run nix develop -c subgraph-build
(which performs codegen and build) instead of nix develop -c graph codegen/graph
build, and add a step to run nix develop -c subgraph-test before the deploy
step; update the corresponding occurrences (the step invoking "nix develop -c
graph codegen" and the build step around lines referenced, and also the steps at
the other occurrence noted for lines 50-51) to ensure the manual deploy gates on
subgraph-build and subgraph-test.
| for NETWORK in $(nix develop -c jq -r 'keys[]' networks.json); do | ||
| DEPLOY_NAME="rain-metaboard-${NETWORK}" | ||
| if nix develop -c goldsky subgraph list --filter deployments --summary 2>&1 | grep -q "${DEPLOY_NAME}"; then | ||
| echo "Skipping ${DEPLOY_NAME} - already deployed" | ||
| else | ||
| echo "Deploying ${DEPLOY_NAME}..." | ||
| nix develop -c graph build --network "${NETWORK}" | ||
| nix develop -c goldsky subgraph deploy "${DEPLOY_NAME}/$(date -Idate)" | ||
| fi |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the overlapping network names from the repo data.
jq -r 'keys[]' subgraph/networks.json | sort
# Reproduce the current grep behavior against a plausible Goldsky summary line.
deploy_name="rain-metaboard-base"
simulated_summary=$'rain-metaboard-base-sepolia/2026-03-12'
if printf '%s\n' "$simulated_summary" | grep -q "${deploy_name}"; then
echo "BUG reproduced: ${deploy_name} is reported as existing when only base-sepolia is present."
else
echo "No collision reproduced."
fiRepository: rainlanguage/rain.metadata
Length of output: 207
🏁 Script executed:
sed -n '25,55p' .github/workflows/manual-subgraph-deploy.ymlRepository: rainlanguage/rain.metadata
Length of output: 1259
🏁 Script executed:
# Search for subgraph-build and subgraph-test definitions
rg -i "subgraph-build|subgraph-test" --type json --type sh --type yml
# Also check package.json in subgraph directory
cat subgraph/package.json | grep -A 20 '"scripts"'Repository: rainlanguage/rain.metadata
Length of output: 596
🏁 Script executed:
# Search for Nix files and check for subgraph-build/subgraph-test definitions
find . -name "flake.nix" -o -name "default.nix" -o -name "shell.nix" | head -20
# Search for these commands in Nix files
rg "subgraph-build|subgraph-test" -g "*.nix"Repository: rainlanguage/rain.metadata
Length of output: 81
🏁 Script executed:
cat flake.nixRepository: rainlanguage/rain.metadata
Length of output: 1725
Use an exact deployment lookup here instead of grepping summary text.
Line 46 uses grep -q "${DEPLOY_NAME}" as a substring match against summary output. With the current network set (base and base-sepolia), this creates a collision: rain-metaboard-base will match both rain-metaboard-base and rain-metaboard-base-sepolia deployments, causing the base network to be incorrectly skipped when only base-sepolia is deployed. Additionally, this guard prevents redeploys of any network once any version is deployed, since the substring will always match. Query the exact deployment name instead of grepping summary text.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/manual-subgraph-deploy.yml around lines 44 - 52, The
current deployment existence check uses a substring grep on the summary output
(the "DEPLOY_NAME" variable tested via `goldsky subgraph list --filter
deployments --summary | grep -q "${DEPLOY_NAME}"`), causing collisions like
"rain-metaboard-base" matching "rain-metaboard-base-sepolia"; change this to an
exact lookup by replacing the grep with an exact-match test (e.g., `grep -xF
"${DEPLOY_NAME}"`), or better, call the goldsky CLI with its exact-name
filter/flag if available (use `goldsky subgraph list` with a name filter or
`--name "${DEPLOY_NAME}"`) so the check only returns true for that exact
DEPLOY_NAME.
Motivation
Checks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit