Skip to content

v0.3.0: Interactive wizard, parallel reviews, BitBucket API tokens, V…#2

Merged
simion merged 13 commits intomainfrom
feature/v0.3.0-wizard-parallel-vps
Mar 7, 2026
Merged

v0.3.0: Interactive wizard, parallel reviews, BitBucket API tokens, V…#2
simion merged 13 commits intomainfrom
feature/v0.3.0-wizard-parallel-vps

Conversation

@simion
Copy link
Owner

@simion simion commented Mar 7, 2026

…PS support

Features:

  • Interactive setup wizard (questionary) with repo detection, token validation
  • reviewd init --sample for non-interactive VPS/CI setup
  • Parallel PR processing with ThreadPoolExecutor (configurable concurrency)
  • Thread-safe SQLite (WAL mode) with per-repo git locks
  • Graceful shutdown with subprocess tracking and SIGTERM handling
  • BitBucket API tokens with Basic auth (email:token), replacing App Passwords
  • GIT_TERMINAL_PROMPT=0 on all git operations for headless environments
  • Auto-launch wizard when config missing from any command

Fixes:

  • BitBucket null source commit crash on deleted branches
  • GitHub slug regex not matching dots in repo names (e.g. simion.cv)
  • BitBucket approve_pr now uses shared client instead of standalone request
  • Directory names used as repo display names instead of remote slug

Tests:

  • BitBucket Basic auth and null commit handling
  • JSON extraction edge cases (multiple blocks, malformed, unknown severity)
  • Config env var substitution and max_concurrent_reviews parsing
  • Concurrent StateDB access (20 threads)
  • GIT_TERMINAL_PROMPT=0 verification

Docs:

  • README: VPS/headless deployment guide with systemd example
  • README: Updated GitHub/BitBucket setup instructions
  • README: Parallel reviews documented, roadmap updated

simion added 13 commits March 7, 2026 12:29
…PS support

Features:
- Interactive setup wizard (questionary) with repo detection, token validation
- reviewd init --sample for non-interactive VPS/CI setup
- Parallel PR processing with ThreadPoolExecutor (configurable concurrency)
- Thread-safe SQLite (WAL mode) with per-repo git locks
- Graceful shutdown with subprocess tracking and SIGTERM handling
- BitBucket API tokens with Basic auth (email:token), replacing App Passwords
- GIT_TERMINAL_PROMPT=0 on all git operations for headless environments
- Auto-launch wizard when config missing from any command

Fixes:
- BitBucket null source commit crash on deleted branches
- GitHub slug regex not matching dots in repo names (e.g. simion.cv)
- BitBucket approve_pr now uses shared client instead of standalone request
- Directory names used as repo display names instead of remote slug

Tests:
- BitBucket Basic auth and null commit handling
- JSON extraction edge cases (multiple blocks, malformed, unknown severity)
- Config env var substitution and max_concurrent_reviews parsing
- Concurrent StateDB access (20 threads)
- GIT_TERMINAL_PROMPT=0 verification

Docs:
- README: VPS/headless deployment guide with systemd example
- README: Updated GitHub/BitBucket setup instructions
- README: Parallel reviews documented, roadmap updated
- Use email regex instead of fragile @/: heuristic for BB Basic auth detection
- Clear _shutdown_event at start of run_poll_loop() so it resets between calls
- Add cooldown check to _collect_eligible_prs() to avoid wasting thread slots
- Wrap wizard in try/except KeyboardInterrupt for clean exit on Ctrl+C
- Quote GitHub token and BitBucket credentials in generated YAML to prevent
  malformed config from special characters (#, :, {, etc.)
- Harvest completed futures during the sleep loop for prompt error logging
- Wizard respects XDG_CONFIG_HOME instead of hardcoding ~/.config
- Each _process_pr creates its own provider instance to avoid sharing
  httpx.Client across threads
Always use cli.value.capitalize() (e.g. "Claude", "Gemini") for the
review title instead of the full model ID which produced awkward titles
like "Claude-sonnet-4-5-20250514". Removed unused model parameter from
comment formatting functions.
Strip trailing commas before } or ] in extracted JSON, a common LLM
output error that caused JSONDecodeError.
@simion
Copy link
Owner Author

simion commented Mar 7, 2026

review'd by Claude

🟡 Suggestion (1)

  • Manual YAML builder produces unquoted values that can break with special characterssrc/reviewd/wizard.py (line 256)
    Repo paths are interpolated into YAML without quoting. Paths containing #, :, {, [, or other YAML-significant characters would produce an invalid or incorrectly parsed config file. For example, /home/user/my#project would be truncated at the # (treated as a comment). Same applies to repo names on line 255.

🟢 Good (4)

  • Thread-safe SQLite with WAL mode and per-method lockingsrc/reviewd/state.py (line 12)
    Using check_same_thread=False, WAL journal mode for concurrent readers/writers, and a threading.Lock around every method is the correct approach for multi-threaded SQLite access. The added indexes on (repo_slug, pr_id) will help query performance as the review history grows.
  • Per-repo git locks prevent concurrent git operations from corrupting statesrc/reviewd/reviewer.py (line 32)
    Using defaultdict(threading.Lock) keyed by repo path ensures that git fetch/worktree operations on the same repo are serialized while different repos can proceed in parallel. Combined with _active_procs tracking for graceful termination, this is a clean concurrency design.
  • Defensive double-check of PR eligibility in worker threadsrc/reviewd/daemon.py (line 130)
    Re-checking _should_skip, has_review, and cooldown inside _process_pr (after the initial check in _collect_eligible_prs) is good practice for concurrent systems — state may have changed between collection and execution.
  • BitBucket approve_pr fixed to use self.client instead of raw httpxsrc/reviewd/providers/bitbucket.py (line 129)
    Previously approve_pr created a standalone httpx.post() call, bypassing the client's auth configuration. Now correctly uses self.client.post(), ensuring both Basic and Bearer auth work consistently.

Bottom line: Clean, well-architected release. The one actionable item is quoting values in the wizard's YAML builder to handle edge-case paths. The concurrency design (locks, WAL, shutdown coordination) is solid.

Automated review by reviewd. Findings are AI-generated — use your judgment.
Replies to this comment are not monitored.

@simion simion merged commit 53d67e0 into main Mar 7, 2026
1 check passed
@simion simion deleted the feature/v0.3.0-wizard-parallel-vps branch March 7, 2026 14:15
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