Repository navigation
Make tests flake multi system - #47
Conversation
WalkthroughRefactors Changes
Sequence Diagram(s)sequenceDiagram
participant CI as CI / Caller
participant Flake as tests/flake.nix (old)
participant FlakeNew as tests/flake.nix (new)
Note over Flake: Single-system (x86_64-linux)
CI->>Flake: request devShells / checks
Flake-->>CI: devShells.x86_64-linux, checks.x86_64-linux.{formatting,checkSchemas}
Note over FlakeNew: Multi-system data-driven
CI->>FlakeNew: request devShells / checks
FlakeNew->>FlakeNew: supportedSystems = [x86_64-linux, aarch64-linux, aarch64-darwin]
loop per system
FlakeNew-->>CI: devShells.${system}.default -> self.checks.${system}.formatting
FlakeNew-->>CI: checks.${system}.{formatting, checkSchemas} (system-scoped pkgs/buildInputs)
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
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.
Actionable comments posted: 3
🧹 Nitpick comments (1)
tests/flake.nix (1)
13-17: Avoid hard-coding systems; derive from a single source of truth.Hard-coded lists drift. Prefer a derived set (e.g., from a constant used elsewhere or via lib helpers).
Example:
- supportedSystems = [ - "x86_64-linux" - "aarch64-linux" - "aarch64-darwin" - ]; + supportedSystems = + # Keep explicit, but centralize: + # inputs.nixpkgs.lib.platforms defaults are broad; enumerate intentionally here or read from a repo-level file. + [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];Optionally consider exposing
supportedSystemsat the repo root and importing it here to avoid duplication.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/flake.nix(1 hunks)
🔇 Additional comments (3)
tests/flake.nix (3)
69-69: Path verified — no issues found.The relative path
./nixos/flake.lockin tests/flake.nix resolves totests/nixos/flake.lock, which exists in the repository. The file will be available at eval time.
81-88: wdiff is available for aarch64-darwin in nixpkgs.The verification confirms your code changes are sound. The concern about
wdiffavailability for aarch64-darwin has been resolved—it's available in nixpkgs for that system. The fallback suggestion remains reasonable as a defensive practice, but is not necessary.
71-78: Clarify semantics of second positional argument and document custom flag dependency.The pinned
inputs.nixpoints to a custom fork (github:DeterminateSystems/nix-src/flake-schemas-detsys), not official Nix. This fork introduces non-standard extensions:
--default-flake-schemasis custom to this fork and does not appear in official Nix documentation- The command passes two positional arguments (
"$src"and"$src/tests/$flake"), whereas officialnix flake showsyntax accepts only a single[FLAKE-URL]The FIXME comment on line 3 acknowledges this is a temporary workaround. Add a comment in the test code explaining what the second positional argument does and document the dependency on this specific Nix fork to prevent accidental "simplification" by future maintainers.
Summary by CodeRabbit
New Features
Chores