Skip to content

bug(pr): sl pr submit creates unnecessary issues when fork is behind upstream #492

Description

@vegerot

Steps to reproduce:

  1. fork repo, and clone the forked repo as default
  2. add upstream path to point to upstream
  3. create commit and open PR
  4. wait until upstream/main has added a few more commits
  5. run sl pull upstream--rebase --dest upstream/main
  6. run sl pr submit

Expected: Your open PR should be updated to use the rebased commit

Actual:

sl pr s
#478 is up-to-date
pushing 9 to ssh://git@github.com/vegerot/sapling.git
abort: error creating pull request for 2ab1a0931d959e5156f9887accec0a41f71453cc: {
 "message": "Validation Failed",
 "errors": [
  {
   "resource": "PullRequest",
   "code": "custom",
   "message": "No commits between facebook:main and vegerot:pr489"
  }
 ],
 "documentation_url": "https://docs.github.com/rest/reference/pulls#create-a-pull-request"
}
Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that handles pid 789 is closed

and then placeholder issues are opened.

Investigation:

This is the stack after step 5 that's causing the problems

sl ssl

  @  6d18a  67 minutes ago  mchcopl  #478 Unreviewed ✓
  │  Back out "vendor abomonation with smallvec support"
  │
  o  d0a9b  9 minutes ago  liubovd  upstream/main
  │  enable test test-edenapi-mutation.t for commitgraph v2
  │
  o  4a8e6  45 minutes ago  zhaolong
  │  util: delete unused puredirs
  │
  o  2ab1a  52 minutes ago  zhaolong
  │  doctor: skip None remotenames
  │
  o  12768  56 minutes ago  49699333+dependabot[bot]  #380 Closed ✗
  │  build(deps): bump json5 from 1.0.1 to 1.0.2 in /addons (#380)
  │
  o  0fbb  57 minutes ago  liubovd
  │  use phases information returned from the server to speed up
  │
  o  d837  58 minutes ago  strager.nds  #462 Closed ✗
  │  config: delete unused convert.* settings (#462)
  │
  o  32691  65 minutes ago  strager.nds  #461 Closed ✗
  │  phases: Delete dead code (#461)
  │
  o  b3ec16  Today at 10:21  49699333+dependabot[bot]  #381 Closed ✗
  │  build(deps): bump json5 from 1.0.1 to 1.0.2 in /website (#381)
  │
  o  c0bcb  Today at 10:11  kurtz.brandon  #454 Closed ✗
╭─╯  fix windows install codeblocks (#454)
│
│ o  611a  Today at 09:42  mchcopl  #349 Unreviewed ✓
│ │  util: show all dirty status indicators
│ │

(remote/main isn't visible here but it's a bit lower down)

I believe what is going on is that sl pr submit is trying to make PRs for every commit between remote/main::.. However, I want PRs for every commit between upstream/main::.! I confirmed my guess by looking at the branch in the error message "No commits between facebook:main and vegerot:pr489". https://github.com/vegerot/sapling/tree/pr489 is a commit between upstream/main::remote/main, which is why the PR submission is failing

sl paths

default = ssh://git@github.com/vegerot/sapling.git
upstream = ssh://git@github.com/facebook/sapling.git

Version: (this would be easier with #440 😁)
6d18ab9, but should be reproducible in d0a9bf5 too
macOS: 13.1
gh: 2.21.2 (2023-01-03)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions