fix(stacked-diffs): fix MR creation for forks

Description

#7574 (closed) has shown running stack sync will often create invalid MRs from a fork. This MR should fix it by checking for the head repo like glab create mr does and passing it as TargetProjectID to the create options.

Related Issues

Resolves #7574 (closed)

To test this:

Two scenarios:

  1. Create a new stack in a repo you have access to make MRs in (glab stack new)
  2. Change or add a file, use glab stack save
  3. Run glab stack sync
  4. Confirm an MR was created and has the changes you madde
  5. Make a fork of the project in Step 1 in a new directory
  6. Repeat the process, selecting the base as your original project that was forked
  7. Confirm that makes an MR as well

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap

Merge request reports

Loading