-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix and re-enable automated prebuilds for GitHub Enterprise #8757
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
Conversation
@andrew-farries @AlexTugarev What do you think about this approach, i.e. ensuring at least Also, now I wonder whether the default GitLab scopes are actually sufficient to install a webhook on GitLab. 🤔 Maybe this authorize flow should always request more than just default scope. EDIT: Seems like the default GitLab scopes read_user + api are actually sufficient to install GitLab webhooks. Hint: One commit contains auto-format changes from our pre-commit hook. Please feel free to ignore it to limit noise. Relevant commit. |
Codecov Report
@@ Coverage Diff @@
## main #8757 +/- ##
=======================================
Coverage 11.17% 11.17%
=======================================
Files 18 18
Lines 993 993
=======================================
Hits 111 111
Misses 880 880
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. 📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
Amended the related issue to #8756 |
I saw 😂 thanks! (When I noticed the new issue, I started editing my PR description, then wondered "wait this is the same number?!" -- so I cancelled my edit and saw the "edited by jldec" 😁 🙌) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default oauth scope shows list of public repos only in /new, and adding a project for a public repo does not appear to configure the webhook properly for triggering prebiulds (even though I see the webhook on the public repo). There is no indicator in the /new project flow to suggest adding repo scope.
Opening a workspace on a private repo DOES ask for repo scope, and then the /new project page shows both public and private repos, and the private repo project appears to receive webhooks properly.
I think it would be better for /new to ask for repo scope before listing repos.
Many thanks for your feedback @jldec!
Yes, that's expected (if you don't grant
That's unexpected. Testing my PR, I was able to successfully:
Are you saying that for your public repo, my PR did not trigger new prebuilds?
That's indeed a product choice we can make. I believe our options are:
EDIT: We decided to go with 2. because using only |
b9fd06e
to
0a1ca0c
Compare
0a1ca0c
to
b2b57f1
Compare
b2b57f1
to
0c333b0
Compare
0c333b0
to
6c89311
Compare
6c89311
to
fdc323a
Compare
Description
Okay, here is my theory on why project creation sometimes failed with
404
errors when webhooks were enabled. The short version is: We never ensured that the user's GHE token is actually allowed to install a webhook./new
to create a new Project, and sees all their repositories as available, because gh.repos.listForAuthenticatedUser works without special scopesa. canInstallAutomatedPrebuilds returns
true
, because the user has indeedADMIN
permission on the repo (and GraphQL tells you that without special scopes)b. However, installAutomatedPrebuilds then fails, presumably with a
404
error (to not leak the existence of a repo you shouldn't be able to access?), because you do need at leastpublic_repo
orrepo
scope to actually install a webhookRelated Issue(s)
Fixes #8756
How to test
Release Notes
Documentation