Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghstack land doesn't work on private non-pro repositories #249

Open
Artamus opened this issue Apr 30, 2024 · 2 comments
Open

ghstack land doesn't work on private non-pro repositories #249

Artamus opened this issue Apr 30, 2024 · 2 comments

Comments

@Artamus
Copy link

Artamus commented Apr 30, 2024

Hi ghstack team,

During my playing around with ghstack in a private repository I found that ghstack land won't work on private repositories that don't have GitHub Pro.

This is the error message I'm receiving when trying to land a PR:

ghstack land https://github.com/Artamus/stacked-diff-test/pull/10
ERROR: Fatal exception
Traceback (most recent call last):
  File "/home/artamus/.local/lib/python3.10/site-packages/ghstack/github_real.py", line 198, in rest
    resp.raise_for_status()
  File "/home/artamus/.local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://api.github.com/repos/Artamus/stacked-diff-test/branches/main/protection

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/artamus/.local/lib/python3.10/site-packages/ghstack/logs.py", line 105, in manager
    yield
  File "/home/artamus/.local/lib/python3.10/site-packages/ghstack/cli.py", line 46, in cli_context
    yield shell, config, github
  File "/home/artamus/.local/lib/python3.10/site-packages/ghstack/cli.py", line 135, in land
    ghstack.land.main(
  File "/home/artamus/.local/lib/python3.10/site-packages/ghstack/land.py", line 72, in main
    protection = github.get(
  File "/home/artamus/.local/lib/python3.10/site-packages/ghstack/github.py", line 67, in get
    return self.rest("get", path, **kwargs)
  File "/home/artamus/.local/lib/python3.10/site-packages/ghstack/github_real.py", line 200, in rest
    raise RuntimeError(pretty_json)
RuntimeError: {
 "message": "Upgrade to GitHub Pro or make this repository public to enable this feature.",
 "documentation_url": "https://docs.github.com/rest/branches/branch-protection#get-branch-protection"
}

To reproduce, simply create a private repository and try to create a stack of 2 commits and land them with ghstack.

@ezyang
Copy link
Owner

ezyang commented May 1, 2024

lol. you can comment out the protection test and it won't affect anything else haha

@Artamus
Copy link
Author

Artamus commented May 2, 2024

Thanks, that definitely works when running it for my own uses :D.

As far as I can tell ghstack is used as part of the Sapling tooling? Also, is there some sort of publicly available roadmap / design doc for ghstack (I'm interested in where you'd like this project to end up)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants