batches: filter github apps for domain#52330
Conversation
Bundle size report 📦
Look at the Statoscope report for a full comparison between the commits b801193 and 60d130d or learn more. Open explanation
|
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 54fb51bffdd0c2776f85033db08ad28b3a8a31f0...b8011939a6c3f5e36ae5591e90e78237c480a224.
|
ed5ba97 to
f1ac900
Compare
courier-new
left a comment
There was a problem hiding this comment.
Looks good to me, just had a couple minor suggestions. 🙂
| query GitHubApps($domain: String) { | ||
| gitHubApps(domain: $domain) { |
There was a problem hiding this comment.
No strong feelings about this, but we could also hardcode in the repos domain for this query string to be clearer about its purpose, since presumably we'll define a separate query with separate fields for the Batch Changes page.
102e7cd to
882f2bd
Compare
c741a7a to
6b201c9
Compare
courier-new
left a comment
There was a problem hiding this comment.
Amazingggg 👏 Just had some minor nits, all of which I tried to provide with suggestions so hopefully you can just commit them and be on your way. 🎉
58b5be5 to
b801193
Compare
| webhookUUID, err := uuid.Parse(stateDeets.WebhookUUID) | ||
| if err != nil { | ||
| http.Error(w, fmt.Sprintf("Bad request, could not parse webhook UUID: %s", err.Error()), http.StatusBadRequest) | ||
| http.Error(w, fmt.Sprintf("Bad request, could not parse webhook UUID: %v", err), http.StatusBadRequest) |
There was a problem hiding this comment.
I changed this so we don't have a lot of err.Error() everywhere, it's basically the same as what we had before.
The %v formatting directive will print the error message.
I added a sample here for you to check @st0nebraker .
| return nil, nil | ||
| } | ||
| switch *s { | ||
| switch strings.ToUpper(*s) { |
There was a problem hiding this comment.
I updated this to convert the domain to a UPPER case string because this method is being used in the route handler for /redirect and in that handler, the domain is lowercased.
Co-authored-by: Becca Steinbrecher <beccasteinbrecher@gmail.com> Co-authored-by: Kelli Rockwell <kelli@sourcegraph.com> Co-authored-by: Becca Steinbrecher <becca.steinbrecher@sourcegraph.com> Closes [#52324](https://github.com/sourcegraph/sourcegraph/issues/52324)
Closes #52324
Now that we have different GitHub apps for different domains, this PR adds a filtering mechanism so we don't get a conflict.
The initial UI work filters non-repos GitHub apps from the GitHub apps section in Site Admin settings
Test plan
We don't yet have a mechanism for creating non-repos GitHub apps for now, so for now, the steps to follow are as follows:
repos