Repo Gardening: introduce new task to triage to projects
Changes proposed in this Pull Request:
This should allow us to add issues to specific GitHub Project boards based on the labels used in the issue.
It relies on two new inputs to be added in each repo wanting to use the new task, addIssueToBoard:
project_automation_tokenis a personal access token withrepoandprojectscopes. On our end, it can be handled via a token created via Matticbot. It is needed because traditional GitHub API requests made via the repo gardening action are done with a default set of permissions, which do not include permissions to manage projects, or projects in your organization.project_automation_block_projectis the ID of the project that is used to triage block-related issues. The value should be stored in a secret.
I've also taken the opportunity to update the GitHub dependencies used by the action, to benefit from the latest options.
Note
This works in my tests, but with 2 important caveats.
It will only work with the new GitHub projects, currently in Beta. The "classic projects" seem to be on their way to being deprecated, and will be migrated to the new GitHub projects, either manually by their admins for now, or automatically in the future. I have not been able to find documentation on a timeline for that though. We only know that the API for the "classic projects" will stop working on October 1, 2022.
Supporting both types of projects at the same time may not be useful, and will require a lot of logic to support both types since the graphQL queries are different for each project type.
As is, this won't work for us since the board we would use is still a classic project, it would need to be migrated. I do not have the permission to do that as I am not a GitHub owner, and I would want to warn the folks using the project board first.
Furthermore, this task can only be used in repos within an organization, since it looks for projects within an organization, not an individual user's account.
To do
- [ ] Document the new inputs in the existing Jetpack Monorepo FG page.
Other information:
- [ ] Have you written new tests for your changes, if applicable?
- [ ] Have you checked the E2E test CI results, and verified that your changes do not break them?
Jetpack product discussion
Internal references:
- pciE2j-18N-p2
- p3topS-193-p2
Does this pull request change what data or activity we track or use?
- No
Testing instructions:
- This will need to be tested in a separate test repo, since the code needs to be merged so one can add labels to an issue and see that the issue is properly added to a board.
- I've already added the necessary new inputs to this repository as well as Calypso.
Thank you for your PR!
When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
- :white_check_mark: Include a description of your PR changes.
- :white_check_mark: All commits were linted before commit.
- :white_check_mark: Add a "[Status]" label (In Progress, Needs Team Review, ...).
- :white_check_mark: Add testing instructions.
- :white_check_mark: Specify whether this PR includes any changes to data or privacy.
- :white_check_mark: Add changelog entries to affected projects
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation :robot:
The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.
Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Then, add the "[Status] Needs Team review" label and ask someone from your team review the code. Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.
Closing this for now because of the lack of activity on this. We can always reopen in the future if needed.