Skip to content

test(discovery): cover skipping a PR whose base repo is not the scanned repo (#364) - #909

Merged
getappz merged 2 commits into
masterfrom
fix/364-base-repo-discovery-test
Oct 16, 2026
Merged

getappz merged 2 commits into
masterfrom
fix/364-base-repo-discovery-test

Conversation

@getappz

@getappz getappz commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Adds the unit test for the base-repo guard that landed in #905 (item #364). The test was staged but uncommitted in the task/364 worktree when #905 merged; salvaged during branch cleanup.

Verified: cargo test -p agentflare discover_skips_a_pr_whose_base_repo_is_not_the_scanned_repo passes (1 passed, binary target).

Summary by CodeRabbit

  • Tests
    • Added coverage to verify that pull request discovery only includes requests targeting the scanned repository, including those submitted from a fork.
    • No user-facing functionality changed.

…ed repo (#364)

Agentflare-Agent: claude-code
Agentflare-Branch: fix/364-base-repo-discovery-test
Agentflare-Session: a0b8d371-2751-4c9f-98f6-017eeff433ea
@getappz

getappz commented Oct 16, 2026

Copy link
Copy Markdown
Owner Author

Tracking this PR for automated review (flared:51bb8de6c33b).

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Repository: getappz/agentflare/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 732ac403-567c-420e-8cbc-dcd9081816c6
📥 Commits

Reviewing files that changed from the base of the PR and between 50625b3 and e3e8c20.

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

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: getappz/agentflare/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 6941e1f1-9975-4bea-86dc-0ada9fd02073
📥 Commits

Reviewing files that changed from the base of the PR and between 7920d40 and 50625b3.

📒 Files selected for processing: 1
  • src/worktree/discovery.rs

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

Adds a PR JSON fixture helper with configurable base and head repository names. Adds discovery tests for a PR with a mismatched base repository and a fork-head PR whose base matches the scanned repository.

Changes: PR repository matching

Layer / File(s) Summary
Discovery repository matching tests
src/worktree/discovery.rs
Adds a helper to generate PR-list responses with configurable base and head repository names. Tests specify that discovery skips a PR with a mismatched base repository and adopts a fork-head PR when the base repository matches.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 50625

This change adds test coverage for the base-repository guard in PR discovery. It does not alter runtime behavior, and no merge-blocking risk was identified.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description explains the test change and reports one targeted test, but it omits the required Summary, Test plan, and Notes for reviewers sections. It also does not address the clippy and formatti… Add the required template sections. Include the change and rationale under Summary, list the status of cargo test, cargo clippy --all-targets --all-features -- -D warnings, and cargo fmt --check under Test plan, and document risk areas and …
Passed Passed checks: 3 passed
Check name Status Explanation
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.
Title check Passed The title clearly identifies the main change: adding discovery coverage for a pull request whose base repository differs from the scanned repository.
Full details: Description check

Explanation

The description explains the test change and reports one targeted test, but it omits the required Summary, Test plan, and Notes for reviewers sections. It also does not address the clippy and formatting checks, risk areas, or backwards compatibility.

Resolution

Add the required template sections. Include the change and rationale under Summary, list the status of cargo test, cargo clippy --all-targets --all-features -- -D warnings, and cargo fmt --check under Test plan, and document risk areas and backwards compatibility under Notes for reviewers.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@getappz
getappz enabled auto-merge (squash) October 16, 2026 12:51
@getappz
getappz merged commit f8ca3ee into master Oct 16, 2026
16 checks passed
@getappz
getappz deleted the fix/364-base-repo-discovery-test branch October 16, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant