You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web,scripts): address CodeRabbit proactive findings in server.py and signed commit helpers - #98
Pilot fix PR addressing 5 verified findings from coderabbit-steward (see #95):
web/server.py (#297): reject unsupported kind values in /api/release with JSON 400 instead of falling through to generic release.
web/server.py (#295): serialize CLI mutations on a dedicated CLI_LOCK instead of FILE_LOCK so GET /api/data dashboard reads aren't blocked during slow prefetches.
web/server.py (#293): default omitted from to previous for holds (matching nix-detour hold add), keeping current for fix.
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Central YAML; Path: .coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID: eb322c70-665f-4088-88ff-62b6d8bc8fa6
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The signed-commit scripts now prepare encoded file content through temporary files, and the commit script validates repository-relative paths. The web server changes hold defaults and removal commands, and serialises CLI executions with a separate lock.
Both scripts write encoded file content to temporary files for jq and remove the files on exit. The commit script resolves input paths relative to the repository root and rejects paths outside it. Missing paths in the open-PR script remain in the deletions list.
Web server behaviour
Layer / File(s)
Summary
Hold defaults and removal web/server.py
hold_add_argv defaults from to "current" for fix entries and "previous" for other kinds, unless the entry specifies from. Removing a hold or fix now invokes hold remove; invalid kinds still return HTTP 400.
CLI execution serialisation web/server.py
_run_cli uses CLI_LOCK instead of FILE_LOCK around directory creation and the CLI subprocess call. JSON reads continue to use FILE_LOCK.
CodeRabbit findings #95: The PR addresses several findings tracked by this issue, including hold source defaults and repository-relative paths in the signed-commit script.
Possibly related PRs
kleinbem-dev/nix-detour#45: That PR introduced the signed-commit scripts and their jq process-substitution pattern, which this PR changes.
Merge Risk: Minimal · previous review b74df
The change hardens signed-commit file handling and web release or hold handling. No concrete merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the three areas changed (web/server.py, scripts/open-signed-pr.sh, scripts/commit-signed.sh) and the fix type. The objectives confirm the PR addresses five review findings across those…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the three areas changed (web/server.py, scripts/open-signed-pr.sh, scripts/commit-signed.sh) and the fix type. The objectives confirm the PR addresses five review findings across those files: CLI_LOCK for CLI mutations, from-defaults for holds and fixes, unsupported kind rejection, and temp-file handling for jq --rawfile and realpath normalisation. The title is broadly accurate, though it is long at 94 characters and does not name the main behavioural change, such as the CLI_LOCK split or the default source change.
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Central YAML; Path: .coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID: d1528453-818d-4cd2-97c0-900670a4bf45
Commits
Reviewing files that changed from the base of the PR and between 3241adb and b74dffb.
Files selected for processing: 3
scripts/commit-signed.sh
scripts/open-signed-pr.sh
web/server.py
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
web/server.py: rejects unsupported kind values in /api/release with HTTP 400, defaults omitted from to previous for holds, and moves CLI execution to a dedicated CLI_LOCK.
scripts/open-signed-pr.sh & scripts/commit-signed.sh: writes base64 output to a temp file before jq --rawfile so encoding errors are not swallowed, and normalizes paths in commit-signed.sh with realpath --relative-to.
Updates web/server.py to reject unsupported kind values in /api/release with HTTP 400, default omitted from to previous for holds (current for fixes), and serialize CLI mutations on a dedicated CLI_LOCK.
Updates scripts/commit-signed.sh and scripts/open-signed-pr.sh to write base64-encoded file contents to a temporary file instead of process substitution so encoding errors are not swallowed.
Adds repository-relative path normalization and boundary validation in scripts/commit-signed.sh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pilot fix PR addressing 5 verified findings from
coderabbit-steward(see #95):web/server.py(#297): reject unsupportedkindvalues in/api/releasewith JSON 400 instead of falling through to genericrelease.web/server.py(#295): serialize CLI mutations on a dedicatedCLI_LOCKinstead ofFILE_LOCKsoGET /api/datadashboard reads aren't blocked during slow prefetches.web/server.py(#293): default omittedfromtopreviousfor holds (matchingnix-detour hold add), keepingcurrentforfix.scripts/open-signed-pr.sh(ci: Dependabot with auto-merge; build web from package-lock.json #27): encode file contents to a temp file beforejq --rawfilesobase64errors aren't swallowed by process substitution.scripts/commit-signed.sh(fix(update): clone the holds repo at the locked revision; report holds it has by now #21): normalize file paths to repository-relative paths viarealpath --relative-toand avoid process-substitution error swallowing.Verified locally with
nix flake check(all 10 checks pass).Summary by CodeRabbit