Skip to content

Make tests flake multi system - #47

Merged
lucperkins merged 2 commits into
mainfrom
multi-system-dev-shell
Oct 27, 2025
Merged

lucperkins merged 2 commits into
mainfrom
multi-system-dev-shell

Conversation

@lucperkins

@lucperkins lucperkins commented Oct 25, 2025 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added official support for Apple Silicon (aarch64-darwin) and ARM64 Linux (aarch64-linux).
  • Chores

    • Restructured configuration to a data-driven, per-platform setup so dev shells and checks are generated consistently for each supported system.
    • Removed the separate README link-check job from CI.

@coderabbitai

coderabbitai Bot commented Oct 25, 2025 •

Copy link
Copy Markdown

Walkthrough

Refactors tests/flake.nix from a static, x86_64-linux–specific outputs layout to a data-driven, multi-system generation supporting x86_64-linux, aarch64-linux, and aarch64-darwin via a new forEachSupportedSystem helper producing per-system devShells and checks.

Changes

Cohort / File(s) Summary
Multi-system flake refactoring
tests/flake.nix
Add supportedSystems and forEachSupportedSystem; generate devShells and checks per-system instead of hard-coded x86_64-linux. Convert formatting and checkSchemas to per-system runCommand/buildInputs using system-scoped pkgs. Replace static flake show/flake check invocations with per-system iterations and remove legacy legacyPackages.x86_64-linux references.
CI workflow removal
.github/workflows/check.yml
Remove README link-check step (lychee via nix shell); keep other CI steps (checkout, determinates, cache, tests) unchanged.

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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas to focus on:
    • Correctness of forEachSupportedSystem attribute generation and naming collisions.
    • Proper scoping of pkgs, system, and buildInputs per generated system.
    • Validation that flake show / flake check iteration preserves previous behavior and error handling.

Possibly related PRs

Suggested reviewers

  • cole-h

Poem

🐰 I hopped from single to trio delight,
Systems aligned in a loop through the night,
ForEachSupportedSystem hums soft and spry,
Shells and checks now leap, reach, and fly. ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Make tests flake multi system" directly and clearly summarizes the primary change in this pull request. The main modification is to tests/flake.nix, where a single-system (x86_64-linux) configuration has been refactored into a multi-system, data-driven approach supporting three systems (x86_64-linux, aarch64-linux, aarch64-darwin). The title accurately captures this core objective using concise and specific language. While the PR also includes a secondary change to remove a link-check step from the GitHub Actions workflow, this is a minor modification that doesn't detract from the title's relevance to the primary changeset, consistent with the expectation that PR titles need not cover every detail.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch multi-system-dev-shell

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e4c68b0 and 2f87a6a.

📒 Files selected for processing (1)
  • .github/workflows/check.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/check.yml

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.

@lucperkins
lucperkins requested a review from edolstra October 25, 2025 19:39

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 supportedSystems at the repo root and importing it here to avoid duplication.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0e29c74 and e4c68b0.

📒 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.lock in tests/flake.nix resolves to tests/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 wdiff availability 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.nix points to a custom fork (github:DeterminateSystems/nix-src/flake-schemas-detsys), not official Nix. This fork introduces non-standard extensions:

  • --default-flake-schemas is custom to this fork and does not appear in official Nix documentation
  • The command passes two positional arguments ("$src" and "$src/tests/$flake"), whereas official nix flake show syntax 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.

Comment thread tests/flake.nix Resolved
Comment thread tests/flake.nix Resolved
Comment thread tests/flake.nix Resolved
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.

2 participants