Skip to content

fix(flake-closure-diff): pass the head profile as an absolute path - #51

Merged
AlexHardAtWork merged 1 commit into
mainfrom
fix/closure-diff-relative-path
Oct 12, 2026
Merged

AlexHardAtWork merged 1 commit into
mainfrom
fix/closure-diff-relative-path

Conversation

@AlexHardAtWork

@AlexHardAtWork AlexHardAtWork commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

flake-closure-diff failed on its first real run. One-line fix: pass the head profile as an
absolute path.

Why it failed

error: path "/nix/store/…-dev-shell-env" is not a flake (because it's not a directory)

nix reads a relative path argument as a flake reference. It resolved the .profile symlink,
found a store path that is a file, and rejected it. The base side was already absolute, from
mktemp -d; only the head side was relative, so every run failed at the report step.

Reproduced locally against Solar's flake — the relative form gives exactly the CI error, the
absolute form prints the diff and exits 0:

$ nix store diff-closures "$W/basep" ".profile"
error: path "/nix/store/8r7yxpkmns7n7vr51xd3lg3lcvqf9kn6-dev-shell-env" is not a flake …

$ nix store diff-closures "$W/basep" "$PWD/.profile"
mdformat: ∅ → ε
python3.14-markdown-it-py: ∅ → 4.2.0, 881.4 KiB
…

Notes

  • Found by opendefensecloud/solution-arsenal#858, the first consumer to call this workflow.
    feat: add check-dev-kit-pins and a flake.lock closure diff #44 said it had not run end to end; this is what that was worth.
  • The job failing rather than warning is kept deliberately. The workflow is advisory about
    differences, but a failure to compute the diff means the tool is broken — and that is the
    only reason this bug was noticed rather than shipped quietly to every consumer.
  • Needs a patch release before Solar's pilot can go green on that check. Until then the stub can
    be dropped from #858 — nothing depends on it.

Checklist

  • Tests added/updated — n/a; verified by simulating all three steps locally
  • No breaking changes (or upgrade path documented above)
  • Readable commit history (squashed and cleaned up as desired)
  • AI code review considered and comments resolved

Summary by CodeRabbit

  • Chores
    • Updated the workflow to use an absolute path for the after-change profile.

nix reads a relative path argument as a flake reference: it resolved the
.profile symlink and then rejected the store path with "is not a flake (because
it's not a directory)", so every run failed at the report step. An absolute path
under the store is recognised as a store path, which is what diff-closures
wants. The base side was already absolute, from mktemp -d.

Found on the first real run — solution-arsenal#858, the first consumer to call
this — and reproduced locally: the relative form gives exactly the CI error, the
absolute form prints the diff and exits 0.
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0319e090-eb94-4917-92c9-cb0b5ef8d772

📥 Commits

Reviewing files that changed from the base of the PR and between 2190eb1 and 6c6d639.


📒 Files selected for processing (1)
  • .github/workflows/flake-closure-diff.yml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Walkthrough
📝 Walkthrough

Walkthrough

The workflow now writes the after-change profile’s absolute path, $PWD/.profile, to $GITHUB_OUTPUT instead of the relative path .profile.

Changes

Profile path output

Layer / File(s) Summary
After-change profile output
.github/workflows/flake-closure-diff.yml
The workflow outputs $PWD/.profile as the after-change profile path.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix


Merge Risk: ⚪ Minimal · up to 6c6d6

The workflow passes the intended absolute head-profile path to the closure-diff command. No merge-blocking issue is supported by the review.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: passing the head profile as an absolute path.
Description check Passed The description explains the change, failure cause, reproduction, testing performed, impact, and checklist status. It does not use the template's exact Testing and Notes for reviewers headings, and it…

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@cbrgm cbrgm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@AlexHardAtWork
AlexHardAtWork merged commit bd72053 into main Oct 12, 2026
12 checks passed
@AlexHardAtWork
AlexHardAtWork deleted the fix/closure-diff-relative-path branch October 12, 2026 14:34
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.

3 participants