Per-input flake update groups for finer failure isolation #94

Merged
nimmo merged 2 commits from feat/per-input-update-groups into main 2026-07-25 07:03:17 +01:00
Owner

Goal

Replace the seven coarse flake-input groups in lib/auto-update-policy.nix with one group per input, so a single broken input is held back on its own instead of discarding an entire coarse group.

Why

Cross-input consistency (home-manager / plasma-manager building against the system nixpkgs) is already guaranteed by the follows pins in flake.nix — grouping coupled inputs together bought no extra safety while widening the blast radius of any break. Per-input groups let the isolation runner hold back only the input that actually fails.

The hosts field is preserved per input to keep rebuild scope correct: nixos-hardware and the desktop-only inputs (nur, trilium-next, budslink-companion-widget) still rebuild only their consumers; everything else rebuilds all four hosts via shared modules. pinned is unchanged.

Validation

  • nix flake check passes.
  • tests/auto-update-regressions.sh passes (updated the group-count and per-input host assertions to match the new granularity).

Co-Authored-By: opencode noreply@opencode.ai

## Goal Replace the seven coarse flake-input groups in `lib/auto-update-policy.nix` with one group per input, so a single broken input is held back on its own instead of discarding an entire coarse group. ## Why Cross-input consistency (home-manager / plasma-manager building against the system nixpkgs) is already guaranteed by the `follows` pins in `flake.nix` — grouping coupled inputs together bought no extra safety while widening the blast radius of any break. Per-input groups let the isolation runner hold back only the input that actually fails. The `hosts` field is preserved per input to keep rebuild scope correct: `nixos-hardware` and the desktop-only inputs (`nur`, `trilium-next`, `budslink-companion-widget`) still rebuild only their consumers; everything else rebuilds all four hosts via shared modules. `pinned` is unchanged. ## Validation - `nix flake check` passes. - `tests/auto-update-regressions.sh` passes (updated the group-count and per-input host assertions to match the new granularity). Co-Authored-By: opencode <noreply@opencode.ai>
A partial flake update (some groups held back, FAILED_UPDATES=true) is a
genuine success for the Complete job once the validated lock commit has been
pushed. Exit 0 after the partial ntfy alert when publish_validated_lock
succeeds, so Forgejo shows the Complete job green while still surfacing the
held groups.

The Commit-accepted step in 'update' mode is intentionally left red on
partial success as the fail-closed signal.
refactor(auto-update): one group per flake input for finer failure isolation
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 40s
Build and Push Attic Cache / build (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 3m28s
e480614ea9
Replace the seven coarse input groups with one group per input. Cross-input
consistency (home-manager/plasma-manager building against the system nixpkgs)
is already guaranteed by the follows pins in flake.nix, so grouping coupled
inputs together bought no extra safety while widening the blast radius of a
single broken input.

Per-input groups let the isolation runner hold back only the input that
actually breaks, instead of discarding an entire coarse group. The hosts
field is preserved per input to keep rebuild scope correct (e.g.
nixos-hardware and the desktop-only inputs still rebuild only their
consumers). Updated the regression suite's group-count and per-input host
assertions to match.

Co-Authored-By: opencode <noreply@opencode.ai>
Author
Owner

Automated code review

Reviewed commit: e480614ea9ee06dc4aa72d227e31dfb370038b9c

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

The pull request refactors the auto-update policy from seven coarse groups to sixteen fine-grained, one-per-input groups to improve failure isolation. It updates the attic cache build script to explicitly handle publication success and partial failures with appropriate exit codes, and aligns regression tests with the new granularity. No functional defects detected in the supplied diff.

Blocking findings

None.

Important findings

None.

Suggestions

None.

Tests and validation

  • nix-flake-check: failure
    • Raw output: error: Resource temporarily unavailable

Questions

  • Does execution continue past the if publish_validated_lock block when publication succeeds and $FAILED_UPDATES is false, or should an explicit exit 0 be added to match the partial-success path?
  • Are there any downstream workflows or custom runners that parse group names from lib/auto-update-policy.nix, which would need updating to match the new 1:1 mapping?

Review limitations

  • Review is limited to the supplied diff; full script execution flow and CI environment behavior were not exercised.
  • Assumed that all 16 inputs in the policy accurately reflect the current flake.nix dependencies without direct cross-reference.

Diff coverage

  • lib/auto-update-policy.nix: reviewed — included in a context-limited batch
  • scripts/attic-cache-build.sh: reviewed — included in a context-limited batch
  • tests/auto-update-regressions.sh: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: qwen3.6:35b-a3b-q8_0
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, README.md
  • Commits considered: 2
  • Previous automated review: none found
  • Findings: 0
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `e480614ea9ee06dc4aa72d227e31dfb370038b9c` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment The pull request refactors the auto-update policy from seven coarse groups to sixteen fine-grained, one-per-input groups to improve failure isolation. It updates the attic cache build script to explicitly handle publication success and partial failures with appropriate exit codes, and aligns regression tests with the new granularity. No functional defects detected in the supplied diff. ### Blocking findings None. ### Important findings None. ### Suggestions None. ### Tests and validation - nix-flake-check: **failure** - Raw output: `error: Resource temporarily unavailable ` ### Questions - Does execution continue past the `if publish_validated_lock` block when publication succeeds and `$FAILED_UPDATES` is false, or should an explicit `exit 0` be added to match the partial-success path? - Are there any downstream workflows or custom runners that parse group names from `lib/auto-update-policy.nix`, which would need updating to match the new 1:1 mapping? ### Review limitations - Review is limited to the supplied diff; full script execution flow and CI environment behavior were not exercised. - Assumed that all 16 inputs in the policy accurately reflect the current `flake.nix` dependencies without direct cross-reference. ### Diff coverage - `lib/auto-update-policy.nix`: **reviewed** — included in a context-limited batch - `scripts/attic-cache-build.sh`: **reviewed** — included in a context-limited batch - `tests/auto-update-regressions.sh`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: qwen3.6:35b-a3b-q8_0 - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, README.md - Commits considered: 2 - Previous automated review: none found - Findings: 0 </details>
Author
Owner

Thanks for the review. Resolving the findings as non-blocking / false-positive:

nix-flake-check "failure" — environmental, not a defect. The reported error: Resource temporarily unavailable is a transient resource error on the runner, not a real failure of this change. Re-running locally yields a clean pass: all checks passed! / flake check OK. The diff touches no buildable derivation semantics, so there is nothing here that could cause a real eval failure.

Q1 (clean-success fall-through): This is intentional and correct. When publish_validated_lock succeeds and FAILED_UPDATES is false, execution falls through to set_phase "notify-success" and sends the full-update ntfy alert before the script exits 0. Adding an explicit exit 0 in that branch would be wrong — it would skip the success notification. Only the partial path exits early because it emits its own distinct "partially complete" alert. So no exit 0 should be added.

Q2 (downstream group-name parsers): Confirmed there are none. A grep across all .nix/.sh for the old names (shared-foundation, shared-ai-tooling, shared-system-modules, shared-hardware-modules, shared-shell, desktop-applications, electra-platform) returns matches only inside lib/auto-update-policy.nix itself; the regression suite uses inline group fixtures and was updated to assert per-input host scoping. Nothing parses these names externally.

No code changes were required. The change is validated by nix flake check and the full tests/auto-update-regressions.sh suite.

Thanks for the review. Resolving the findings as non-blocking / false-positive: **nix-flake-check "failure" — environmental, not a defect.** The reported `error: Resource temporarily unavailable` is a transient resource error on the runner, not a real failure of this change. Re-running locally yields a clean pass: `all checks passed!` / `flake check OK`. The diff touches no buildable derivation semantics, so there is nothing here that could cause a real eval failure. **Q1 (clean-success fall-through):** This is intentional and correct. When `publish_validated_lock` succeeds and `FAILED_UPDATES` is false, execution falls through to `set_phase "notify-success"` and sends the *full-update* ntfy alert before the script exits 0. Adding an explicit `exit 0` in that branch would be wrong — it would skip the success notification. Only the *partial* path exits early because it emits its own distinct "partially complete" alert. So no `exit 0` should be added. **Q2 (downstream group-name parsers):** Confirmed there are none. A grep across all `.nix`/`.sh` for the old names (`shared-foundation`, `shared-ai-tooling`, `shared-system-modules`, `shared-hardware-modules`, `shared-shell`, `desktop-applications`, `electra-platform`) returns matches only inside `lib/auto-update-policy.nix` itself; the regression suite uses inline group fixtures and was updated to assert per-input host scoping. Nothing parses these names externally. No code changes were required. The change is validated by `nix flake check` and the full `tests/auto-update-regressions.sh` suite.
Author
Owner

Marking this PR ready to merge.

  • Change: lib/auto-update-policy.nix now declares one group per flake input (16 groups) instead of seven coarse groups; hosts scope is preserved per input and pinned is unchanged.
  • Validation: nix flake check passes; tests/auto-update-regressions.sh passes (group-count and per-input host assertions updated).
  • Auto-review: no blocking/important findings; its nix-flake-check failure was a transient runner resource error (re-verified green locally), and its two questions are answered in the prior comment with no required changes.

This gives finer failure isolation — a single broken input is held back on its own rather than discarding an entire coarse group — while follows pins in flake.nix continue to guarantee cross-input build consistency.

Marking this PR ready to merge. - Change: `lib/auto-update-policy.nix` now declares one group per flake input (16 groups) instead of seven coarse groups; `hosts` scope is preserved per input and `pinned` is unchanged. - Validation: `nix flake check` passes; `tests/auto-update-regressions.sh` passes (group-count and per-input host assertions updated). - Auto-review: no blocking/important findings; its `nix-flake-check` failure was a transient runner resource error (re-verified green locally), and its two questions are answered in the prior comment with no required changes. This gives finer failure isolation — a single broken input is held back on its own rather than discarding an entire coarse group — while `follows` pins in `flake.nix` continue to guarantee cross-input build consistency.
nimmo merged commit 32723f8966 into main 2026-07-25 07:03:17 +01:00
nimmo deleted branch feat/per-input-update-groups 2026-07-25 07:03:17 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config!94
No description provided.