Skip to content

Infer base repository from parent branch in retarget/restack - #1749

Open
PawelLipski wants to merge 1 commit into
developfrom
fix/infer-base-repo-in-retarget-restack
Open

Infer base repository from parent branch in retarget/restack#1749
PawelLipski wants to merge 1 commit into
developfrom
fix/infer-base-repo-in-retarget-restack

Conversation

@PawelLipski

@PawelLipski PawelLipski commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

In a fork workflow the PR/MR is hosted by the base (upstream) repository, not the head (fork) repository that holds the branches.

retarget-pr/restack-pr (and their GitLab retarget-mr/restack-mr counterparts) now resolve the code hosting client against the base repository inferred from the parent branch's tracking remote - exactly like create-pr already does - so they query the repository that actually hosts the PR even when no machete.{github,gitlab}.base* config keys are set.

Resolution is best-effort: if the base repository cannot be determined unambiguously and no base* keys are set, it falls back to the head repository, preserving the previous behavior.

@PawelLipski PawelLipski self-assigned this Jul 8, 2026
@PawelLipski PawelLipski added github Relates to integration with GitHub gitlab Relates to integration with GitLab labels Jul 8, 2026
@PawelLipski
PawelLipski force-pushed the fix/infer-base-repo-in-retarget-restack branch from 3f18f16 to b1a2603 Compare July 28, 2026 14:09
@codecov-commenter

codecov-commenter commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.75%. Comparing base (12eb29b) to head (85fbde1).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1749   +/-   ##
========================================
  Coverage    98.75%   98.75%           
========================================
  Files           45       45           
  Lines         5379     5388    +9     
  Branches       980      982    +2     
========================================
+ Hits          5312     5321    +9     
  Misses          41       41           
  Partials        26       26           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PawelLipski
PawelLipski force-pushed the fix/infer-base-repo-in-retarget-restack branch from b1a2603 to 5f49498 Compare July 28, 2026 14:25
In a fork workflow the PR/MR is hosted by the base (upstream) repository, not the head (fork) repository that holds the branches.
retarget-pr/restack-pr (and their GitLab retarget-mr/restack-mr counterparts) now resolve the code hosting client against the base repository
inferred from the parent branch's tracking remote - exactly like create-pr already does - so they query the repository that actually hosts the PR
even when no machete.{github,gitlab}.base* config keys are set.
Resolution is best-effort: if the base repository cannot be determined unambiguously and no base* keys are set, it falls back to the head repository,
preserving the previous behavior.
@PawelLipski
PawelLipski force-pushed the fix/infer-base-repo-in-retarget-restack branch from 5f49498 to 85fbde1 Compare July 28, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github Relates to integration with GitHub gitlab Relates to integration with GitLab

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants