Open kranurag7 opened 7 months ago
Hi @kranurag7, thank you for this idea and implementation!
You are right, the issues in those repos must be labeled with Container
.
Let me explain why: The only reason is the GitHub Projects board. This tracks the whole organization (and even external repos), which obviously would be a mess if not filtered. For this filtering we use the different labels for the teams (Container, IaaS, IAM and Ops) to create the views.
Since all Cluster Stack related repos (as of today CSO, CSPO and csctl) are Container related per se I could also just filter by repo:
, then we could avoid having the label there.
To also show Container
related issues from other (org wide) repositories we need a way to get them and this is the label.
The annoying thing now it that GitHub Projects does not currently support logical OR filters across multiple fields. Means I can't to "Give me that full repo and from the other repo only issues labeled with XYZ".
And this is actually the reason why we use the label everywhere :see_no_evil:
In fact, this should be done for every issue:
Container
and this for every PR:
Container
-linked:issue
for this in the GH search syntax)As you are already on it, could you have a look how to realize the other cases as well?
Thank you for clearing the scope.
Please check the commit here https://github.com/SovereignCloudStack/cluster-stack-operator/pull/94/commits/727144ac3d235ff7a5a51e16f533a8b266bbf064
I was not able to find a way to automate this. add to Project "Sovereign Cloud Stack" ONLY if there is no linked issue (I used -linked:issue for this in the GH search syntax)
I tried getting linked request using gh
but there is not nice way to get it using gh pr view
command not even if I use --json
flag.
I attempted to get it by directly invoking the API using the following command.
$ gh api /repos/SovereignCloudStack/cluster-stack-operator/pulls/94 --jq '._links.issue'
{
"href": "https://api.github.com/repos/SovereignCloudStack/cluster-stack-operator/issues/94"
}
But this is not correct URL.
I was not able to complete the last part where we filter the PR using -linked:issue
For the moment, the latest commit fixes the first three sections. For adding issues to project board, we will need to add a token in settings/actions
No worries, it's not urgent. We never used the automation before so it's still a pretty good enhancement, thank you!
The ADD_TO_PROJECT_PAT should now be available
Thanks for adding the token and the fix in the project URL.
After review this will get merged and after tracking it for a day or two, I'll propagate the same in cspo and csctl repo.
From what I understand, I think we need
Container
label on this repo, CSPO and csctl.pull request
I think we can automate it for pull requests using actions/labeler and for renovate PRs, we can use renovate itself.
issues
For issues, I think we can use the following: https://docs.github.com/en/actions/managing-issues-and-pull-requests/adding-labels-to-issues#creating-the-workflow
This runs on every issue open and reopen which might be too much to we will never notice it, Given it runs in ground. If it sounds too much then we can use a cron workflow for the same.
/kind feature
// cc @janiskemper @jschoone