static: ban git submodules org-wide (no-submodules check) - #256
Conversation
Root .gitmodules or any committed gitlink (mode 160000) fails sol- and rs-static. Deps come from soldeer/npm/nix. BATS-covered lib script is the single source of truth; the composite sources it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
📝 WalkthroughWalkthroughAdds a ChangesNo-submodules CI Enforcement
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Workflow as rainix-*-static.yaml
participant Action as no-submodules action
participant Script as no-submodules.sh
Workflow->>Action: uses no-submodules@main
Action->>Script: source and call check_no_submodules .
Script-->>Action: exit status (clean or fail)
Action-->>Workflow: step result
Related Issues: None specified Related PRs: None specified Suggested labels: ci, tests Suggested reviewers: None specified 🐰 A gitlink lurking, sly and small, 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
lib/no-submodules.sh (1)
21-22: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueFilenames containing spaces get truncated in the offender list.
awkdefault field splitting treats both spaces and tabs as delimiters, so$4only prints up to the first space in a path with spaces in it — detection (fail=1) still works correctly, only the printed path is garbled. Low-risk edge case given typical dependency paths.♻️ Proposed fix using tab-based field split
- gitlinks=$(git -C "$dir" ls-files -s 2>/dev/null | awk '$1 == "160000" { print " " $4 }') + gitlinks=$(git -C "$dir" ls-files -s 2>/dev/null | awk -F'\t' '$1 ~ /^160000 /{ print " " $2 }')🤖 Prompt for 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. In `@lib/no-submodules.sh` around lines 21 - 22, The offender list in the no-submodules check can truncate paths with spaces because awk is using default whitespace splitting; update the gitlinks pipeline in no-submodules.sh so the path extraction uses tab-based parsing instead of $4 from space-delimited fields. Keep the existing fail detection behavior, but adjust the awk logic in the gitlinks assignment to preserve the full pathname when printing submodule offenders.
🤖 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.
Nitpick comments:
In `@lib/no-submodules.sh`:
- Around line 21-22: The offender list in the no-submodules check can truncate
paths with spaces because awk is using default whitespace splitting; update the
gitlinks pipeline in no-submodules.sh so the path extraction uses tab-based
parsing instead of $4 from space-delimited fields. Keep the existing fail
detection behavior, but adjust the awk logic in the gitlinks assignment to
preserve the full pathname when printing submodule offenders.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 89472221-9fd0-4683-9bb5-de9e94c6980d
📒 Files selected for processing (6)
.github/actions/no-submodules/action.yml.github/workflows/rainix-rs-static.yaml.github/workflows/rainix-sol-static.yamlflake.nixlib/no-submodules.shtest/bats/task/no-submodules.test.bats
Births the rainix-static crate (#255): checks as subcommands, std-only, unit tests mirroring the retired BATS cases (root .gitmodules, ghost gitlink 160000, vendored-inert, non-git file leg), run inside the nix build via doCheck. The composite nix-runs the cachix-cached package at the pinned RAINIX_SHA; bash lib and BATS retired. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The all-files yamlfmt hook reflows one inherited multiline description per run; fold every action.yml description in one pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
@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:
Review Effort: Would have taken 5-10 minutes Examples:
Medium (M)Characteristics:
Review Effort: Would have taken 15-30 minutes Examples:
Large (L)Characteristics:
Review Effort: Would have taken 45+ minutes Examples:
Additional Factors to ConsiderWhen deciding between sizes, also consider:
Notes:
|
|
Tip For best results, initiate chat on the files or code changes. SIZE=M |
Migrates the rain-org-health scan's advisory
submodulessignal into a hard static gate — implemented in Rust as the first subcommand of the #255 binary, not more bash:rainix-static/crate (std-only):rainix-static no-submodules [dir]with two detection legs — ROOT.gitmodules(git only reads the root one; vendored copies are inert and pass) + any committed gitlink entry (git ls-files -smode 160000, catching ghost pointers whose .gitmodules was deleted). Subcommand dispatch is ready for the remaining Convert the static-check shell libraries to Rust #255 migrations (no-ignored-tests, no-custom-natspec, flake-pin guard).doCheck,nativeCheckInputs = git) — a broken check cannot ship as a cached binary.packages.rainix-static(cachix-cached); the composite runsnix run github:rainlanguage/rainix/${RAINIX_SHA:-main}#rainix-static -- no-submodules .per the org flake-pin convention (RAINIX_SHA is exported by the calling reusables).rainix-sol-staticandrainix-rs-static; smoke-verified clean against rainix itself.Blast radius — please confirm before merging. Repos currently carrying
.gitmodulesthat will go static-red on their next CI run: cyclofinance/cyclo.site, cyclofinance/cyclo.sol, cyclofinance/cyclo.subgraph, cyclofinance/rflr-nix, rainlanguage/curve, rainlanguage/flow, rainlanguage/interpreter-subgraph, rainlanguage/orderbook-subgraph. cyclo.site alone has ~27 vetted PRs in flight that would red on retrigger — that pressure is the point of the soldeer migration, but the wave is yours to time.Follow-ups once merged: drop the redundant
submodulessignal from the org-health scan; migrate the three existing bash checks into the binary (#255).🤖 Generated with Claude Code