Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
2023-09-14 Implementation plan: Project automations
Author: @dhruvkb
Reviewers
Project links
Overview
This is the implementation plan describing new automations for the project board. More information about the project board and existing automations can be found in our documentation.
Historical context
The new project board was created as a successor to our original project boards, that were "classic" GitHub Projects.
These classic project boards have been closed. They are no longer updated, nor
referred to in any discussions.
These boards were highly automated. A number of automations related to these boards were deleted (PR) when they were closed. Those automations can serve as inspiration for their reboots for the new project board.
To-do
The complete work of automating our boards can be broadly classified under three categories.
General improvements to boards
Normalise emoji usage
The backlog board uses an emoji for each column. None of the other boards do. Personally I appreciate them and would like all boards to use them but wouldn't mind dropping them from the backlog board for consistency's sake.
For emoji:
- @dhruvkb
- @AetherUnbound
- <add your name here>
Against emoji:
- <add your name here>
Column changes
- Issues
- Create new column "ποΈ Discarded" for issues that were closed without resolution (like label "βοΈ status: discarded").
- PRs
- Split "Needs Review" into two columns based on their number of existing
reviews.
- 2οΈβ£ Needs 2 Reviews (no reviews yet)
- 1οΈβ£ Needs 1 Review (one approval, near finish line)
- Create new column "ποΈ Discarded" for PRs that were closed without merge.
- Rename "Merged" to "β Done" for consistency with issues board.
- Split "Needs Review" into two columns based on their number of existing
reviews.
- Issues
Improvements to existing automations
Issues/Issue is created and Issues/Issue is added to the project
The issue should be added to the project board under the appropriate column, "π Backlog" or "β Blocked" depending on the issue labels.
-
The issue should be moved to the "β Done" column only if it was resolved. If it was closed as discarded, it should be moved to a new "ποΈ Discarded" column.
The built-in workflow will have to be replaced by a custom one that looks at the
state_reasonfield inside the issue payload of theclosedactivity of theissuesevent. Issues/Issue is closed and inactive
The current system means that issues are archived one by one as they become inactive and with an 8 day cadence, this will slowly drift out of sync with the weekly development chat.
Archiving should be performed by a custom scheduled workflow that archives all items in the "β Done" and "ποΈ Discarded" columns weekly (preferably immediately after the chat).
PRs/PR is created and PRs/PR is added to project
The PR should be added to the project board under the appropriate column, "In Progress" or "Needs <x> Review(s)" depending on the PR's draft or ready-for-review state and the number of existing reviews.
-
The PR should be moved to the "β Done" column only if it was merged. If it was closed without merge, it should be moved to a new "ποΈ Discarded" column.
This can be implemented by updating built-in workflows.
Restoration of previous automations
Issues/Issue is connected to PR
When an issue is connected to a PR, the issue should move from "π Backlog" or "π To do" to the "π In Progress" column. If the issue is labeled as "β status: blocked", that label should be dropped.
Unfortunately, the
connectedevent does not trigger workflows. So this can be implemented using a combination of multiple workflows.- scheduled workflow
pull_requestevent- created
- edited
Issues/PR linked to issue is closed without merge
When the PR for an issue in "ποΈ In Progress" is closed without merge, the issue should go back to the "π To do" column.
The
closedactivity in thepull_requestevent can trigger workflows to do this.
Creation of new automations
Issues/Issue is relabeled
When an issue's labels change, it should automatically move to the right column.
- issues labeled as "β status: blocked" βΉ Move into "β Blocked" column
- issues unlabeled as "β status: blocked" βΉ Move into "π Backlog" column
Both
labeledandunlabeledactivities in theissuesevent can trigger workflows to do this.The priority field in the project board issues should also be synced to the priority label using the same workflow. Additionally, critical issues can directly be added to the "π To do" column instead of the "π Backlog" column to prioritise their resolution.
Issues/Issue is assigned
An assigned issue in "π Backlog" must be moved into "π To do". The opposite event, i.e. moving unassigned issues from "π To do" to "π Backlog" should not happen.
The
assignedactivity in theissuesevent can trigger workflows to do this.PRs/PR state is changed
When a PR is drafted or made ready for review, it should be relocated to the right column.
- PR is converted to draft βΉ Move into "In Progress" column
- PR is ready for review βΉ Move into the "Needs <x> Review(s)" column
Both
converted_to_draftandready_for_reviewactivities in thepull_requestevent can trigger workflows to do this.
Modifications
Each of these automations performs one of these modifications to the cards.
- add cards
- move cards between columns
- archive cards
Plan
Here we define workflows based on the above-mentioned improvements. Each
workflow should have multiple steps that are controlled based on two params
github.event_name and github.event.action.
Issues (issues)
Activity types:
openedAdd to project board. Perform same label-related steps as the
labeledactivity.closedCheck
state_reasonfield in payload and move to "β Done" or "ποΈ Discarded" column.assignedIf in "π Backlog", move to "π To do". Else leave as is.
labeledIf "βοΈ status:blocked" in existing labels, move to ββ Blockedβ column. Else if "π₯ priority: critical" in existing labels, move to "π To do" column. Else move to "π Backlog" column. Sync priority label to priority field.
unlabeledIf the "βοΈ status:blocked" label is removed, move to "π Backlog" column.
PR (pull_request)
Activity types:
openedAdd to the project board. Perform the same state related steps as the
converted_to_draftandready_for_reviewactivities.editedWhen a PR is edited, it can be linked to an issue via the description. If the PR is linked to an issue, move the issue to "ποΈ In Progress" column.
closedCheck
github.event.pull_request.mergedfield in payload and move to "β Done" or "ποΈ Discarded" column.converted_to_draftMove to the "π In Progress" column.
ready_for_reviewPerform the same state related steps as the
pull_request_reviewevent.
PR review (pull_request_review)
Check all submitted reviews. If a PR has at least one "CHANGES_REQUESTED" review, do nothing (the built-in action will handle this). If the PR has one approval, move to the "1οΈβ£ Needs 1 review" column. If the PR has no approvals yet, move to the "2οΈβ£ Needs 2 reviews" column.
Scheduled
Schedules:
weekly
Archive "β Done" and "ποΈ Discarded" columns.
daily
Identify linked issues and move them to "ποΈ In Progress" column.