Skip to content

refactor: memoize autotrack probes, dedupe lock policy and logs#389

Merged
ScriptedAlchemy merged 1 commit into
masterfrom
codex/autotrack-hardening-followup
Jul 9, 2026
Merged

refactor: memoize autotrack probes, dedupe lock policy and logs#389
ScriptedAlchemy merged 1 commit into
masterfrom
codex/autotrack-hardening-followup

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Follow-up to #377 (merged): small reviewed cleanups in the PR-autotrack daemon path.

  • Memoize environment probes: gh_available() is now cached process-wide in a OnceLock<bool> and origin_is_github() per repo root in a static Mutex<HashMap<PathBuf, bool>>, instead of re-spawning gh --version / git remote get-url origin every poll cycle to re-decide constants.
  • Drop the unused SyncConfig parameter from poll_project.
  • Extract shared BRANCH_LOCK_RETRY_ATTEMPTS / BRANCH_LOCK_RETRY_INTERVAL consts in src/branch.rs, used by both the async prepare_branch_tracking_in_layout retry loop and the sync acquire_branch_add_lock_blocking (loop bodies stay separate).
  • Extract a log_pr_skip helper for the four duplicated "skipped" log_daemon_event blocks in reconcile_project (field set and ordering unchanged).

Verified: cargo fmt --check, cargo clippy --workspace --all-targets --locked -- -D warnings (0 errors), cargo nextest run --test daemon_suite --no-fail-fast (18 passed), cargo test --lib pr_autotrack (12 passed), cargo test --lib branch (48 passed).

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 67db2e5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy ScriptedAlchemy merged commit cc51ac9 into master Jul 9, 2026
13 of 15 checks passed
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