[Projects v2] Show all repositories linked to a project #41797
Replies: 2 comments
-
I would add that this matters because if you have many (like hundreds, if you have many clients you do work for) repositories, a client-wide project encompasses several (but only a small number of the hundreds) of repositories pertaining to that client. A list of linked repositories would provide a useful way to quickly get to repositories of a particular client. In that same vein, presently, you associate a repository with a project. It would be nice to, on the project, select (check) multiple repositories, to associate them with a project all at once. Sometimes, you do one repository here and there, and later decide a project management structure is needed after the fact, and hence create projects after the repositories, leading to this scenario. Now, an ugly and unautomated solution to WesleyBranton's original point would be to, in the project readme, manually list (with hyperlinks) the associated projects. But, it forces a manual update to the readme each time you add a new repository. |
Beta Was this translation helpful? Give feedback.
-
I really wish the GitHub UI listed repos associated with V2 Projects somewhere too, but for now I've discovered you can retrieve a list of repositories associated with project using the GraphQL API. I created a small shell script that uses the GitHub #!/bin/sh
gh api graphql -f query='
query($organization: String! $number: Int! $endCursor: String){
organization(login: $organization){
projectV2(number: $number) {
title # optional, remove --jq below to see the title
repositories(first: 100, after: $endCursor) {
nodes {
nameWithOwner
}
pageInfo{
hasNextPage,
endCursor
}
}
}
}
}' -f "organization=$1" -F "number=$2" --paginate --jq '.data.organization.projectV2.repositories.nodes[].nameWithOwner' |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Product Feedback
Body
I used to love using the legacy projects for planning out software versions. With the new projects, you can still create them under the Project tab in a specific repository, but under my profile tab there is no obvious indication what repositories are linked to a specific project.
The reason this is a huge drawback for me personally, is that if I create a "Version 3.0" project under a repo, it just shows as "Version 3.0" under my Projects tab. So if I have two repos with two different "Version 3.0" projects, it's not obvious which one is which.
This can obviously be solved if I just add the repo name to title of the project, but I hate doing that because it just increases the project tile length. It also doesn't work if I decide to link the same project to multiple repos.
Beta Was this translation helpful? Give feedback.
All reactions