-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Fix: gh pr create
, only fetch teams when reviewers contain a team
#11361
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
Changes from all commits
449920b
df317d4
e5feda3
addee16
5a6cac3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,12 +42,13 @@ func Test_RepoMetadata(t *testing.T) { | |
|
||
repo, _ := ghrepo.FromFullName("OWNER/REPO") | ||
input := RepoMetadataInput{ | ||
Assignees: true, | ||
Reviewers: true, | ||
Labels: true, | ||
ProjectsV1: true, | ||
ProjectsV2: true, | ||
Milestones: true, | ||
Assignees: true, | ||
Reviewers: true, | ||
TeamReviewers: true, | ||
Labels: true, | ||
ProjectsV1: true, | ||
ProjectsV2: true, | ||
Milestones: true, | ||
} | ||
|
||
http.Register( | ||
|
@@ -213,6 +214,43 @@ func Test_RepoMetadata(t *testing.T) { | |
} | ||
} | ||
|
||
// Test that RepoMetadata only fetches teams if the input specifies it | ||
func Test_RepoMetadata_TeamsAreConditionallyFetched(t *testing.T) { | ||
http := &httpmock.Registry{} | ||
client := newTestClient(http) | ||
repo, _ := ghrepo.FromFullName("OWNER/REPO") | ||
input := RepoMetadataInput{ | ||
Reviewers: true, | ||
TeamReviewers: false, // Do not fetch teams | ||
} | ||
|
||
http.Register( | ||
httpmock.GraphQL(`query RepositoryAssignableUsers\b`), | ||
httpmock.StringResponse(` | ||
{ "data": { "repository": { "assignableUsers": { | ||
"nodes": [ | ||
{ "login": "hubot", "id": "HUBOTID" }, | ||
{ "login": "MonaLisa", "id": "MONAID" } | ||
], | ||
"pageInfo": { "hasNextPage": false } | ||
} } } } | ||
`)) | ||
|
||
http.Register( | ||
httpmock.GraphQL(`query UserCurrent\b`), | ||
httpmock.StringResponse(` | ||
{ "data": { "viewer": { "login": "monalisa" } } } | ||
`)) | ||
|
||
http.Exclude( | ||
t, | ||
httpmock.GraphQL(`query OrganizationTeamList\b`), | ||
) | ||
|
||
Comment on lines
+245
to
+249
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. praise: thank you for considering the idea ❤️ |
||
_, err := RepoMetadata(client, repo, input) | ||
require.NoError(t, err) | ||
} | ||
|
||
func Test_ProjectNamesToPaths(t *testing.T) { | ||
t.Run("when projectsV1 is supported, requests them", func(t *testing.T) { | ||
http := &httpmock.Registry{} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1314,14 +1314,6 @@ func Test_createRun(t *testing.T) { | |
"pageInfo": { "hasNextPage": false } | ||
} } } } | ||
`)) | ||
reg.Register( | ||
httpmock.GraphQL(`query OrganizationTeamList\b`), | ||
httpmock.StringResponse(` | ||
{ "data": { "organization": { "teams": { | ||
"nodes": [], | ||
"pageInfo": { "hasNextPage": false } | ||
} } } } | ||
`)) | ||
reg.Register( | ||
httpmock.GraphQL(`mutation PullRequestCreateRequestReviews\b`), | ||
httpmock.GraphQLMutation(` | ||
|
@@ -1662,6 +1654,125 @@ func Test_createRun(t *testing.T) { | |
}, | ||
expectedOut: "https://github.com/OWNER/REPO/pull/12\n", | ||
}, | ||
{ | ||
name: "if reviewer contains any team, fetch teams", | ||
setup: func(opts *CreateOptions, t *testing.T) func() { | ||
opts.TitleProvided = true | ||
opts.BodyProvided = true | ||
opts.Title = "my title" | ||
opts.Body = "my body" | ||
opts.Reviewers = []string{"hubot", "monalisa", "org/core", "org/robots"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. praise: I appreciate having the org added rather than leaving it clipped as in other tests |
||
opts.HeadBranch = "feature" | ||
return func() {} | ||
}, | ||
httpStubs: func(reg *httpmock.Registry, t *testing.T) { | ||
reg.Register( | ||
httpmock.GraphQL(`mutation PullRequestCreate\b`), | ||
httpmock.GraphQLMutation(` | ||
{ "data": { "createPullRequest": { "pullRequest": { | ||
"URL": "https://github.com/OWNER/REPO/pull/12", | ||
"id": "NEWPULLID" | ||
} } } }`, | ||
func(input map[string]interface{}) {})) | ||
reg.Register( | ||
httpmock.GraphQL(`query RepositoryAssignableUsers\b`), | ||
httpmock.StringResponse(` | ||
{ "data": { "repository": { "assignableUsers": { | ||
"nodes": [ | ||
{ "login": "hubot", "id": "HUBOTID" }, | ||
{ "login": "MonaLisa", "id": "MONAID" } | ||
], | ||
"pageInfo": { "hasNextPage": false } | ||
} } } } | ||
`)) | ||
reg.Register( | ||
httpmock.GraphQL(`query UserCurrent\b`), | ||
httpmock.StringResponse(` | ||
{ "data": { "viewer": { "login": "monalisa" } } } | ||
`)) | ||
reg.Register( | ||
httpmock.GraphQL(`query OrganizationTeamList\b`), | ||
httpmock.StringResponse(` | ||
{ "data": { "organization": { "teams": { | ||
"nodes": [ | ||
{ "slug": "core", "id": "COREID" }, | ||
{ "slug": "robots", "id": "ROBOTID" } | ||
], | ||
"pageInfo": { "hasNextPage": false } | ||
} } } } | ||
`)) | ||
reg.Register( | ||
httpmock.GraphQL(`mutation PullRequestCreateRequestReviews\b`), | ||
httpmock.GraphQLMutation(` | ||
{ "data": { "requestReviews": { | ||
"clientMutationId": "" | ||
} } } | ||
`, func(inputs map[string]interface{}) { | ||
assert.Equal(t, "NEWPULLID", inputs["pullRequestId"]) | ||
assert.Equal(t, []interface{}{"HUBOTID", "MONAID"}, inputs["userIds"]) | ||
assert.Equal(t, []interface{}{"COREID", "ROBOTID"}, inputs["teamIds"]) | ||
assert.Equal(t, true, inputs["union"]) | ||
})) | ||
}, | ||
expectedOut: "https://github.com/OWNER/REPO/pull/12\n", | ||
expectedErrOut: "", | ||
}, | ||
{ | ||
name: "if reviewer does NOT contain any team, do NOT fetch teams", | ||
setup: func(opts *CreateOptions, t *testing.T) func() { | ||
opts.TitleProvided = true | ||
opts.BodyProvided = true | ||
opts.Title = "my title" | ||
opts.Body = "my body" | ||
opts.Reviewers = []string{"hubot", "monalisa"} | ||
opts.HeadBranch = "feature" | ||
return func() {} | ||
}, | ||
httpStubs: func(reg *httpmock.Registry, t *testing.T) { | ||
reg.Register( | ||
httpmock.GraphQL(`mutation PullRequestCreate\b`), | ||
httpmock.GraphQLMutation(` | ||
{ "data": { "createPullRequest": { "pullRequest": { | ||
"URL": "https://github.com/OWNER/REPO/pull/12", | ||
"id": "NEWPULLID" | ||
} } } }`, | ||
func(input map[string]interface{}) {})) | ||
reg.Register( | ||
httpmock.GraphQL(`query RepositoryAssignableUsers\b`), | ||
httpmock.StringResponse(` | ||
{ "data": { "repository": { "assignableUsers": { | ||
"nodes": [ | ||
{ "login": "hubot", "id": "HUBOTID" }, | ||
{ "login": "MonaLisa", "id": "MONAID" } | ||
], | ||
"pageInfo": { "hasNextPage": false } | ||
} } } } | ||
`)) | ||
reg.Register( | ||
httpmock.GraphQL(`query UserCurrent\b`), | ||
httpmock.StringResponse(` | ||
{ "data": { "viewer": { "login": "monalisa" } } } | ||
`)) | ||
reg.Exclude( | ||
t, | ||
httpmock.GraphQL(`query OrganizationTeamList\b`), | ||
) | ||
reg.Register( | ||
httpmock.GraphQL(`mutation PullRequestCreateRequestReviews\b`), | ||
httpmock.GraphQLMutation(` | ||
{ "data": { "requestReviews": { | ||
"clientMutationId": "" | ||
} } } | ||
`, func(inputs map[string]interface{}) { | ||
assert.Equal(t, "NEWPULLID", inputs["pullRequestId"]) | ||
assert.Equal(t, []interface{}{"HUBOTID", "MONAID"}, inputs["userIds"]) | ||
assert.NotEqual(t, []interface{}{"COREID", "ROBOTID"}, inputs["teamIds"]) | ||
assert.Equal(t, true, inputs["union"]) | ||
})) | ||
}, | ||
expectedOut: "https://github.com/OWNER/REPO/pull/12\n", | ||
expectedErrOut: "", | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3,6 +3,7 @@ package shared | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
import ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"fmt" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"net/url" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"slices" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"strings" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"github.com/cli/cli/v2/api" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -63,7 +64,10 @@ func AddMetadataToIssueParams(client *api.Client, baseRepo ghrepo.Interface, par | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
// Retrieve minimal information needed to resolve metadata if this was not previously cached from additional metadata survey. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
if tb.MetadataResult == nil { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
input := api.RepoMetadataInput{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reviewers: len(tb.Reviewers) > 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Reviewers: len(tb.Reviewers) > 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TeamReviewers: len(tb.Reviewers) > 0 && slices.ContainsFunc(tb.Reviewers, func(r string) bool { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return strings.ContainsRune(r, '/') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+67
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: do we have any tests that should make sure that I see tests like this that include teams: cli/pkg/cmd/pr/create/create_test.go Lines 412 to 479 in e5feda3
I only see 1 test that has only human users: cli/pkg/cmd/pr/create/create_test.go Lines 1300 to 1382 in e5feda3
If so, then maybe we There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test added in the PR removes the Lines 217 to 247 in e5feda3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks 🤔 I guess I was thinking we have a stronger assertion setup to ensure the query was explicitly not called at all close to the Lines 287 to 300 in b2348f8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Assignees: len(tb.Assignees) > 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ActorAssignees: tb.ActorAssignees, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Labels: len(tb.Labels) > 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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.
question:
what conditions will users still encounter the
GraphQL: Resource not accessible by integration (organization.teams)
error?why is it important for both
Reviewers
andTeamReviewers
to be set for retrieving organization teams?Uh oh!
There was an error while loading. Please reload this page.
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.
I think it'll happen when someone gives us a team (contains a slash), but their auth token does not have perms to fetch teams.
It's technically not important to make this function but it eliminates a situation where the caller might set
TeamReviewers
to true whileReviewers
is false, causing only teams to be fetched and populated into the reviewer metadata. I don't know of a case where we actually want that to happen, so I figure we should guard against callers misusing this field until we know that to be a valid use case by coupling the two fields together.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.
Thanks for the insight!
For my first question, I was unsure which
gh
authentication methods include organization team permissions, so I reset mygh auth
session and confirmed theread:org
scope associated with GitHub CLI OAuth app is good: