Skip to content

chore: Update infrastructure, dev scripts, and documentation#5

Open
nkissick-del wants to merge 3 commits intojmagar:mainfrom
nkissick-del:feature/infrastructure-cleanup
Open

chore: Update infrastructure, dev scripts, and documentation#5
nkissick-del wants to merge 3 commits intojmagar:mainfrom
nkissick-del:feature/infrastructure-cleanup

Conversation

@nkissick-del
Copy link
Copy Markdown

@nkissick-del nkissick-del commented Feb 4, 2026

Overview

This PR improves the project structure and developer experience without changing core application logic. It addresses some technical debt in the development scripts and Docker configuration.

Changes

  • Dev Scripts: Moved and renamed development scripts to a dedicated scripts/ directory and improved process management (PID tracking, log rotation).
  • Docker: Pinned the exact version of the dependency manager in the Dockerfile to ensure reproducible builds.
  • Git: Added .gitignore to properly exclude local environment configuration files.
  • Docs: Updated documentation to reflect the new script locations and setup instructions.

Verification

  • Validated that the development scripts correctly start and stop the server in a clean environment.
  • Verified that the Docker build completes successfully.

Summary by cubic

Streamlines dev tooling and Docker builds for consistency and reliability. Moves the dev script, pins uv, improves logging and process handling, and updates docs.

  • Refactors

    • Move dev.sh to scripts/ with reliable PID tracking, lsof fallback, and 10MB log rotation; safer logging via env vars.
    • Dockerfile: pin uv to 0.5.29 in /bin and remove unused UNRAID_API_KEY for reproducible builds.
    • .gitignore: ignore scripts/publish_dev_image.sh; add local tooling config for development.
    • README: update script paths, fix list_notifications parameter name, and document scripts/ and tests/ structure.
  • Migration

    • Use ./scripts/dev.sh (update any scripts/CI that referenced ./dev.sh).

Written for commit cc11180. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added configuration settings for operational permissions.
  • Documentation

    • Updated development workflow and setup instructions in README.
    • Corrected API documentation: list_notifications() parameter renamed for clarity.
  • Chores

    • Updated Docker base image to version 0.5.24.
    • Enhanced development script reliability and logging mechanisms.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

This PR reorganizes development infrastructure by relocating the dev script to a dedicated scripts directory, pinning the UV base image version to 0.5.24, adding Claude-specific permissions configuration, updating documentation with new paths, and enhancing the dev script with improved logging, process discovery, and server lifecycle management.

Changes

Cohort / File(s) Summary
Configuration & Infrastructure
.claude/settings.local.json, Dockerfile, .gitignore
Added Claude permissions config file defining allowed Bash/web operations; pinned UV base image to version 0.5.24 and changed binary destination from /usr/local/bin/ to /bin/; removed UNRAID_API_KEY environment variable; added ignore entry for publish_dev_image.sh script.
Documentation & API
README.md
Updated script path references from ./dev.sh to ./scripts/dev.sh across Quick Start and Development Workflow sections; updated public API function signature parameter name from type to notification_type in list_notifications().
Development Script Enhancement
scripts/dev.sh
Refactored logging to use environment variables (LOG_MESSAGE, LOG_LEVEL, LOG_INDENT) instead of quote escaping; added log rotation when file exceeds 10MB; enhanced process discovery with safer PID array handling; added conditional lsof availability checks; improved server startup with setsid/nohup detachment and process identification by searching for unraid_mcp.main; applied enhancements consistently to both original and modular server startup paths.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 Scripts hop to their new home,
Where permissions whisper and UV's pinned,
Logs rotate like carrots on a wheel,
Development blooms in organized warren bliss! 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: infrastructure updates (Dockerfile), dev scripts improvements (scripts/dev.sh refactoring), and documentation updates (README modifications). It's clear, concise, and directly related to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 5 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="scripts/dev.sh">

<violation number="1" location="scripts/dev.sh:333">
P2: PID selection uses unconstrained `pgrep -f`, which can match unrelated/stale processes, causing the PID file to point at the wrong process and potentially killing the wrong server.</violation>

<violation number="2" location="scripts/dev.sh:418">
P2: PID selection uses unconstrained `pgrep -f`, which can match unrelated/stale processes, causing the PID file to point at the wrong process and potentially killing the wrong server.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/dev.sh (1)

565-566: ⚠️ Potential issue | 🟡 Minor

Inconsistent script path in interrupt handler.

The help text references ./dev.sh but should use ./scripts/dev.sh to match the updated location.

Proposed fix
 handle_log_interrupt() {
     echo ""
     log_info "📄 Stopped following logs. Server continues running in background."
-    log_info "💡 Use './dev.sh --status' to check server status" 1
-    log_info "💡 Use './dev.sh --tail' to resume following logs" 1
+    log_info "💡 Use './scripts/dev.sh --status' to check server status" 1
+    log_info "💡 Use './scripts/dev.sh --tail' to resume following logs" 1
     exit 0
 }
🤖 Fix all issues with AI agents
In `@Dockerfile`:
- Line 8: The Dockerfile COPY instruction references an outdated pinned UV image
tag "ghcr.io/astral-sh/uv:0.5.24"; update that tag to a more recent stable
release (for example "0.9.29" or whichever latest tested version) in the COPY
--from=... /uv /uvx /bin/ line to keep reproducible builds while getting fixes,
then rebuild and smoke-test the image to ensure no breaking changes; keep the
explicit tag pinning rather than using a floating "latest" tag.

In `@scripts/dev.sh`:
- Line 300: Split the combined declaration+assignment to avoid masking the
command substitution exit status: replace occurrences like the declaration of
variable fsize where you currently do local fsize=$(stat -f%z "$LOG_FILE"
2>/dev/null || echo 0) with a separate local declaration (local fsize) followed
by an assignment (fsize=$(stat -f%z "$LOG_FILE" 2>/dev/null || echo 0)); apply
the same change for the second occurrence at the other location (the other local
fsize usage), and if you rely on the command's exit status, capture and check
the substitution's exit code after the assignment.
- Around line 298-304: The file-size check using macOS-only stat syntax (stat
-f%z) breaks Linux; update the rotation logic around LOG_FILE/fsize to use a
portable fallback: detect which stat flavor is available (BSD vs GNU) or fall
back to a POSIX-safe method (e.g., wc -c) to compute file size, then assign that
to fsize and compare to 10485760 as before; apply the same change to the other
occurrence noted (the block around lines 393-399) so both rotations work on
Linux and macOS.
- Around line 119-121: Replace the fragile regex array-membership check with a
simple helper function: add a function (e.g., contains_elem) that accepts a
value and an array and iterates over the array comparing elements to the value,
returning success if found; then change the membership test around the pids
array to call that helper (e.g., if ! contains_elem "$pid" "${pids[@]}"; then
pids+=("$pid") ) and apply the same replacement to the other occurrence
referenced (the block around lines 131-133). Ensure the helper uses exact string
comparison (not regex) and preserves exit codes for use in the if tests.

@nkissick-del
Copy link
Copy Markdown
Author

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)

🤖 Fix all issues with AI agents

This has been actioned.

@nkissick-del
Copy link
Copy Markdown
Author

2 issues found across 5 files
Prompt for AI agents (all issues)

Since this is your first cubic review, here's how it works:

* **cubic automatically reviews your code** and comments on bugs and improvements

* **Teach cubic by replying to its comments**. cubic learns from your replies and gets better over time

* **Ask questions** if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

This has been actioned

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.

1 participant