Add origin/master fallback to ready_to_make_pr upstream ref lookup#597
Add origin/master fallback to ready_to_make_pr upstream ref lookup#597
Conversation
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>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| git("commit", "-m", "add new") | ||
|
|
||
| output = run_py_in_repo(py_code, str(repo)) | ||
| assert output["status"] == "ok" |
There was a problem hiding this comment.
[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.
Summary
ready_to_make_prcould fail to find a valid fork point in repositories that default tomasterwhen local upstream tracking is unset andorigin/HEADis unavailable.Changes
.github/workflows/gh-aw-fragments/safe-output-create-pr.mdto includeorigin/masterafter@{upstream},origin/HEAD, andorigin/main.test_origin_master_fallbackintests/test_safe_input_ready_to_make_pr.pyto cover amaster-default repository with no tracking branch and noorigin/HEAD.Result
ready_to_make_prnow correctly resolvesorigin/masterin this scenario instead of failing early.The body of this PR is automatically managed by the Trigger Update PR Body workflow.