Skip to content

fix(web,scripts): address CodeRabbit proactive findings in server.py and signed commit helpers - #98

Merged
kleinbem merged 2 commits into
mainfrom
fix/cr-findings-pilot
Nov 27, 2026
Merged

kleinbem merged 2 commits into
mainfrom
fix/cr-findings-pilot

Conversation

@kleinbem

@kleinbem kleinbem commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

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.
  • scripts/open-signed-pr.sh (ci: Dependabot with auto-merge; build web from package-lock.json #27): encode file contents to a temp file before jq --rawfile so base64 errors 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 via realpath --relative-to and avoid process-substitution error swallowing.

Verified locally with nix flake check (all 10 checks pass).

Summary by CodeRabbit

  • Bug Fixes
    • Removing a hold or fix now follows the same removal flow, with invalid removal requests continuing to return an error.
    • Fix entries now default to the current version, while other entries default to the previous version, unless a source is specified.
    • Concurrent command-line operations are now handled one at a time.
    • File changes submitted through the signed workflows now use repository-relative paths; paths outside the repository are rejected.

@kleinbem kleinbem added the cr-review Ask CodeRabbit to review this PR label Nov 27, 2026
@kleinbem
kleinbem enabled auto-merge (squash) November 27, 2026 10:11
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

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.

Changes: Signed file handling

Layer / File(s) Summary
Signed-file payload preparation
scripts/commit-signed.sh, scripts/open-signed-pr.sh
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.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related issues

  • 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: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 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.
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.

Share

Recent review info

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: 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.

@kleinbem-bot kleinbem-bot Bot 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.

🔍 Revue Code Analysis (Google Gemini (Antigravity)) — kleinbem-dev/nix-detour #98

  • 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.

📋 Verification & Review Details
  • Repository: kleinbem-dev/nix-detour
  • Pull Request: #98
  • Base Branch: main
  • Source Branch: fix/cr-findings-pilot
  • Target Head: b74dffb6
  • Inspected Files: 3
  • Actionable Issues Flagged: 1
  • Review Pipeline: Pass 0 (Semgrep AST) → Pass 1 (Detective) → Pass 2 (Judge)
  • Engine: Revue v0.1.0

Comment thread scripts/commit-signed.sh Resolved

@kleinbem-bot kleinbem-bot Bot 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.

🔍 Revue Code Analysis (Google Gemini (Antigravity)) — kleinbem-dev/nix-detour #98

  • 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.

📋 Verification & Review Details
  • Repository: kleinbem-dev/nix-detour
  • Pull Request: #98
  • Base Branch: main
  • Source Branch: fix/cr-findings-pilot
  • Target Head: 8d5b8c49
  • Inspected Files: 3
  • Actionable Issues Flagged: 0
  • Review Pipeline: Pass 0 (Semgrep AST) → Pass 1 (Detective) → Pass 2 (Judge)
  • Engine: Revue v0.1.0

@kleinbem
kleinbem merged commit e5116c8 into main Nov 27, 2026
6 checks passed
@kleinbem
kleinbem deleted the fix/cr-findings-pilot branch November 27, 2026 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cr-review Ask CodeRabbit to review this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant