Skip to content

Add origin/master fallback to ready_to_make_pr upstream ref lookup#597

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-ready-to-make-pr-issue-again
Open

Add origin/master fallback to ready_to_make_pr upstream ref lookup#597
Copilot wants to merge 2 commits intomainfrom
copilot/fix-ready-to-make-pr-issue-again

Conversation

Copy link
Contributor

Copilot AI commented Mar 8, 2026

Summary

ready_to_make_pr could fail to find a valid fork point in repositories that default to master when local upstream tracking is unset and origin/HEAD is unavailable.

Changes

  • Updated the upstream ref fallback chain in .github/workflows/gh-aw-fragments/safe-output-create-pr.md to include origin/master after @{upstream}, origin/HEAD, and origin/main.
  • Added test_origin_master_fallback in tests/test_safe_input_ready_to_make_pr.py to cover a master-default repository with no tracking branch and no origin/HEAD.

Result

ready_to_make_pr now correctly resolves origin/master in this scenario instead of failing early.


The body of this PR is automatically managed by the Trigger Update PR Body workflow.

The upstream fork point detection in safe-output-create-pr.md only
checked @{upstream}, origin/HEAD, and origin/main. Repos with master
as the default branch would fail when local tracking was unset and
origin/HEAD was unavailable.

Add origin/master to the fallback list and add a test for this scenario.

Co-authored-by: strawgate <6384545+strawgate@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix ready_to_make_pr behavior for master-default repos Add origin/master fallback to ready_to_make_pr upstream ref lookup Mar 8, 2026
@strawgate strawgate marked this pull request as ready for review March 8, 2026 01:34
@coderabbitai
Copy link

coderabbitai bot commented Mar 8, 2026

Warning

Rate limit exceeded

@strawgate has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 58 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2d4efa0b-f537-488e-bb0d-91f4f35d2d2d

📥 Commits

Reviewing files that changed from the base of the PR and between 5fed4a0 and 3ae1d28.

📒 Files selected for processing (2)
  • .github/workflows/gh-aw-fragments/safe-output-create-pr.md
  • tests/test_safe_input_ready_to_make_pr.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/fix-ready-to-make-pr-issue-again
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

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

@github-actions github-actions bot added the small_boom Small PR blast radius; usually low human-review need label Mar 8, 2026
git("commit", "-m", "add new")

output = run_py_in_repo(py_code, str(repo))
assert output["status"] == "ok"
Copy link
Contributor

Choose a reason for hiding this comment

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

[LOW] Test does not verify the origin/master path is actually exercised

This assertion only checks for status == "ok", so the test can pass even if origin/HEAD remains available and the new fallback branch (origin/master) is never used. Because the remote set-head --delete call above ignores its return code, a failure there would make this test a false positive.

Please add an assertion that origin/HEAD is unavailable (or that merge-base HEAD origin/HEAD fails) and that merge-base HEAD origin/master succeeds, so this test proves the intended fallback behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small_boom Small PR blast radius; usually low human-review need

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug-hunter] ready_to_make_pr fails on master-default repos without upstream tracking

2 participants