0

I have a URL for accessing all open PRs for my team. URL: https://github.com/pulls?q=is%3Aopen+is%3Apr+archived%3Afalse+team%3Acorp-name%2Fteam-name

Query: is:open is:pr archived:false team:corp-name/team-name

This has always worked fine but the last few repos I created are not found by this query and I can't tell why. The team has the same write access on all repos and if I go to github.com/orgs/corp-name/teams/team-name/repositories they are all listed there. I don't see anything in the settings to determine which team is the owner. All settings are the same as other repos that do show up in the search results.

An alternative would be to use repo: but I don't think wildcards are an option and there's too many repos to list separately.

Jeremy Schultz
  • 579
  • 1
  • 6
  • 26
  • Are there open PRs against the new repos? – JohnLBevan Jan 23 '23 at 16:18
  • 1
    @JohnLBevan Yes – Jeremy Schultz Jan 23 '23 at 16:31
  • Ps. This seems to imply that you can only filter on `team-review-requested` rather than having it show all PRs across all repos to which a team has access... I've not played with filtering by team before, so can't speak from experience... Could that explain the results you've seen previously; or does that still not fit with those repos for which your query currently works? https://stackoverflow.com/questions/62192262/is-it-possible-to-filter-github-pull-requests-that-were-authored-by-members-of-a – JohnLBevan Jan 23 '23 at 16:33
  • 1
    I did try the same query but with "team-review-requested" instead of "team," and it returned no results. I'd think this would work because I can see this team is automatically made reviewers of PRs on these repos. – Jeremy Schultz Jan 23 '23 at 18:36

1 Answers1

0

I think I unexpectedly stumbled across the answer to this. For GitHub to consider a PR to be under a team, the team needs to be referenced in a comment on the PR. Our old repos had a template that included ###### @corp-name/team-name on the bottom of the PR description. New repos don't have that.

The other strange thing: if you add it and then edit/remove it, GitHub has it cached somewhere because the search results retain it. You can't remove it as far as I can tell.

GitHub will link a PR to a team mentioned in the initial description or any comment, prepended with a "@".

Jeremy Schultz
  • 579
  • 1
  • 6
  • 26