Skydio / revup

Effortlessly create and manage pull requests without changing branches. Powers a stacked diffs workflow with python and git "plumbing" commands.
https://github.com/Skydio/revup
MIT License
317 stars 67 forks source link

Fork upload broken on multiple topics #41

Closed gbalke closed 2 years ago

gbalke commented 2 years ago

Describe the bug Revup upload with forks seems to stop working when more than 1 commit/topic deep (relative topics)?

Expected behavior Expected revup upload behavior... See logs below of uploading to my fork.

To Reproduce See commands in logs...

Logs Trying to upload to root project...

:.../revup$ revup --remote-name skydio --fork-name origin upload
Branch master not found, falling back to "main". We recommend you set this in .revupconfig
W: Couldn't find an existing label named main
W: Couldn't find an existing label named test
W: Couldn't find an existing label named github

Topic: cli_unit_test_framework → github_workflow_python_install → origin/main
Reviewers: jerry-skydio
Commits:
  [Test] Initial unit test framework
Github URL:
   (new) (pushed)
Press <Enter> to continue or <Ctrl-C> to quit
Traceback (most recent call last):
  File "/home/greg/.local/bin/revup", line 8, in <module>
    sys.exit(_main())
  File "/home/greg/.local/lib/python3.8/site-packages/revup/__main__.py", line 12, in _main
    sys.exit(asyncio.run(main()))
  File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/home/greg/.local/lib/python3.8/site-packages/revup/revup.py", line 340, in main
    return await upload.main(
  File "/home/greg/.local/lib/python3.8/site-packages/revup/upload.py", line 96, in main
    await topics.update_prs()
  File "/home/greg/.local/lib/python3.8/site-packages/revup/topic_stack.py", line 1181, in update_prs
    await github_utils.update_pull_requests(self.github_ep, prs_to_update)
  File "/home/greg/.local/lib/python3.8/site-packages/revup/github_utils.py", line 660, in update_pull_requests
    await github_ep.graphql(
  File "/home/greg/.local/lib/python3.8/site-packages/revup/github_real.py", line 94, in graphql
    raise RuntimeError(pretty_json)
RuntimeError: {
 "data": {
  "com_out0": null,
  "com_out1": null,
  "pr_out0": {
   "clientMutationId": "revup"
  },
  "pr_out1": null,
  "rev_out0": null,
  "rev_out1": null
 },
 "errors": [
  {
   "type": "NOT_FOUND",
   "path": [
    "com_out0"
   ],
   "locations": [
    {
     "line": 4,
     "column": 13
    }
   ],
   "message": "Could not resolve to a node with the global id of ''"
  },
  {
   "type": "NOT_FOUND",
   "path": [
    "com_out1"
   ],
   "locations": [
    {
     "line": 7,
     "column": 13
    }
   ],
   "message": "Could not resolve to a node with the global id of ''"
  },
  {
   "type": "NOT_FOUND",
   "path": [
    "pr_out1"
   ],
   "locations": [
    {
     "line": 13,
     "column": 13
    }
   ],
   "message": "Could not resolve to a node with the global id of ''"
  },
  {
   "type": "FORBIDDEN",
   "path": [
    "rev_out0"
   ],
   "locations": [
    {
     "line": 16,
     "column": 13
    }
   ],
   "message": "gbalke does not have the correct permissions to execute `RequestReviews`"
  },
  {
   "type": "NOT_FOUND",
   "path": [
    "rev_out1"
   ],
   "locations": [
    {
     "line": 19,
     "column": 13
    }
   ],
   "message": "Could not resolve to a node with the global id of ''"
  }
 ]
}

Uploading directly to my fork...

:.../revup$ revup upload
Branch master not found, falling back to "main". We recommend you set this in .revupconfig
W: No matching user found for jerry-skydio
W: Couldn't find an existing label named main
W: Couldn't find an existing label named github
W: Couldn't find an existing label named test

Topic: cli_unit_test_framework → github_workflow_python_install → origin/main
Commits:
  [Test] Initial unit test framework
Github URL:
   (new) (pushed)
Press <Enter> to continue or <Ctrl-C> to quit

Topic: cli_unit_test_framework → github_workflow_python_install → origin/main
Commits:
  [Test] Initial unit test framework
Github URL:
  https://github.com/gbalke/revup/pull/2 (new) (pushed)

Topic: github_workflow_python_install → origin/main
Commits:
  [Github] Workflow for testing installation
Github URL:
  https://github.com/gbalke/revup/pull/1 (updated)
jerry-skydio commented 2 years ago

Turns out this is an intrinsic github limitation. #43 opened to warn the user clearly