-
Notifications
You must be signed in to change notification settings - Fork 8
Auto-update README when supported branches list changes #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds a conditional CI step to regenerate README when the ref-statuses step fails and updates the PR commit message; refactors Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor GH as GitHub Actions
participant WF as ref-statuses workflow
participant NIX as nix develop
participant GEN as update-readme
GH->>WF: trigger workflow
WF->>WF: run ref-statuses update step
alt ref-statuses step failed
WF->>NIX: run `nix develop --command update-readme`
NIX->>GEN: execute update-readme (uses inputs.easy-template + jq)
GEN-->>WF: README.md updated
WF->>GH: create PR (commit message mentions ref-statuses and README)
else ref-statuses step succeeded
WF-->>GH: continue without README update
end
sequenceDiagram
autonumber
actor Dev as Developer
participant DevShell as per-system devShell
participant Gen as update-readme
participant ET as inputs.easy-template
participant JQ as jq
participant Repo as README.md
Dev->>DevShell: enter devShell (per-system)
Dev->>Gen: run update-readme
Gen->>ET: render README template
Gen->>JQ: process ref-statuses JSON
Gen->>Repo: write README.md
Repo-->>Dev: README updated locally
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
🔇 Additional comments (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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
templates/README.md.tpl (1)
31-33
: Consider displaying branch statuses.The template iterates over branches but only displays keys. Since ref-statuses.json contains status values (rolling, beta, stable, deprecated, unmaintained) and the template documents these in the
refStatuses
variable description (Line 69), consider enhancing the display to show statuses alongside branch names.For example:
{{#each supported}} -- `{{@key}}` +- `{{@key}}` ({{this}}) {{/each}}This would output entries like:
nixos-24.11
(stable)nixos-unstable
(rolling)flake.nix (1)
133-146
: ref-statuses.json format verifiedIt’s a valid JSON object and yields the expected supported keys; no functional changes required. Optional: add a file-existence/JSON-validation check in the update-readme script for clearer errors.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
flake.lock
is excluded by!**/*.lock
📒 Files selected for processing (4)
.github/workflows/ref-statuses.yaml
(1 hunks)README.md
(1 hunks)flake.nix
(2 hunks)templates/README.md.tpl
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Check flake.lock test (clean 👼)
- GitHub Check: Check flake.lock test (dirty 😈)
- GitHub Check: Check flake.lock test (CEL condition)
- GitHub Check: Nix and Rust checks
- GitHub Check: Test Rust
🔇 Additional comments (6)
templates/README.md.tpl (1)
1-158
: LGTM!The template is comprehensive and well-structured, covering all essential documentation sections for the Nix Flake Checker. The Handlebars syntax is correct and aligns with the easy-template tool being used.
flake.nix (2)
15-18
: LGTM!The easy-template input is correctly declared with proper nixpkgs follows to avoid duplicate dependencies.
21-179
: LGTM!The per-system refactoring and new devShells structure are well-organized. The forSystems function is now more explicit and maintainable.
README.md (1)
165-165
: LGTM!Trivial formatting change adding a trailing newline, which is a common convention.
.github/workflows/ref-statuses.yaml (2)
27-30
: LGTM!The new README update step is correctly positioned after the ref-statuses.json update and before creating the PR. The
if: failure()
condition ensures it only runs when the ref-statuses check detects changes.
36-36
: LGTM!The commit message accurately reflects that both ref-statuses.json and README.md are being updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
flake.nix (1)
140-147
: Add a trap to clean up the temp dir on failure.Line 140 creates a temp directory but the cleanup on Line 146 only runs if the script finishes successfully; any earlier failure leaves the directory behind. Install a trap right after
mktemp
so the directory is removed no matter how the script exits, and you can drop the final manualrm -rf
.tmp=$(mktemp -d) -inputs="''${tmp}/template-inputs.json" +trap 'rm -rf "''${tmp}"' EXIT +inputs="''${tmp}/template-inputs.json" ... -easy-template ./templates/README.md.handlebars "''${inputs}" > README.md - -rm -rf "''${tmp}" +easy-template ./templates/README.md.handlebars "''${inputs}" > README.md
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
flake.nix
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Check flake.lock test (dirty 😈)
- GitHub Check: Check flake.lock test (clean 👼)
- GitHub Check: Check flake.lock test (CEL condition)
- GitHub Check: Test Rust
- GitHub Check: Nix and Rust checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
templates/README.md.handlebars (1)
155-155
: Use absolute URL for pull requests link.The relative path
/pulls
may not resolve correctly when the README is viewed outside of the GitHub repository context (e.g., in package documentation, mirrors, or local clones).Apply this diff to use the full GitHub URL:
-[prs]: /pulls +[prs]: https://github.com/DeterminateSystems/flake-checker/pulls
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
templates/README.md.handlebars
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Check flake.lock test (dirty 😈)
- GitHub Check: Check flake.lock test (clean 👼)
- GitHub Check: Check flake.lock test (CEL condition)
- GitHub Check: Nix and Rust checks
- GitHub Check: Test Rust
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/build.yaml
(1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/build.yaml
43-43: if: condition "${{ matrix.systems.nix-system }} != 'x86_64-darwin'" is always evaluated to true because extra characters are around ${{ }}
(if-cond)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Check flake.lock test (clean 👼)
- GitHub Check: Check flake.lock test (CEL condition)
- GitHub Check: Check flake.lock test (dirty 😈)
- GitHub Check: Test Rust
- GitHub Check: Nix and Rust checks
The README provides a list of supported Nixpkgs branches:
Thus far I've been updating this manually but far better to automate.
Summary by CodeRabbit
New Features
Documentation
Chores