core-workflow
core-workflow copied to clipboard
Add a GitHub action to automatically update projects
This is a meta issue about a newly added GitHub action that automatically updates projects:
- [x] https://github.com/python/cpython/pull/94447
- [x] backport to 3.11: https://github.com/python/cpython/pull/94477
- [x] backport to 3.10: https://github.com/python/cpython/pull/94475
- [x] https://github.com/python/cpython/pull/94483
- [ ] Add more jobs for other labels/projects
- [x] https://github.com/python/cpython/pull/94921
- [x] https://github.com/python/cpython/pull/97788
- [ ] Backport to 3.11/3.10
https://github.com/python/cpython/pull/94447 added a first version of the workflow that updates the Release and Deferred blockers project, and:
- I tested that the issue is added to the project when:
- the
release-blockerlabel is applied - the
deferred-blockerlabel is applied
- the
- removing the label doesn't remove the issue from the project
- there doesn't seem to be a way to set the type automatically from the action
- it can be set manually either in the issue or in the project
- it takes about 10-15s before the issue (dis)appears in the project
- a manual refresh on the issue is needed before the project (dis)appears in the sidebar
After attempting backports in https://github.com/python/cpython/pull/94477 and https://github.com/python/cpython/pull/94475, the check failed because it couldn't access the secret. After some investigation it turns out that PRs created from forks can't access secrets. In addition, this action would add a check for each job in the PR (currently only one, but I'm planning to add more for the other labels/projects):
Click to see screenshot of the job in the PR checks list

Therefore, I submitted https://github.com/python/cpython/pull/94483 to remove the pull_request trigger and only run the action for issues, solving the issue with the secret and the extra checks in PRs.
- See also https://github.com/github/roadmap/issues/576
pull_request trigger
Would using the pull_request_target trigger work instead?
Even if it does, I'm not sure we want to add PRs to the projects anymore.
Projects now support a workflow to automatically add issues/PRs to projects, even though it seems to have some limitations (e.g. can't set custom fields based on a label, and also limitations based on the account type). For now I enabled it as a test to the Release and deferred blockers project -- if it works well we could enable it on more projects and get rid of the workflow added in https://github.com/python/cpython/pull/94447.
See:
- https://github.blog/changelog/2023-03-09-github-issues-projects-march-9th-update/#robot-automatically-add-and-archive-project-items
- https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/adding-items-automatically
Also, Triagers can now add issues/PRs to projects directly due to the changes in #460 , as far as I'm aware, so anyone who can add a label can also add directly to the project.