diff --git a/packages/project-management-automation/README.md b/packages/project-management-automation/README.md index 17726771d94e66..2172305882eb36 100644 --- a/packages/project-management-automation/README.md +++ b/packages/project-management-automation/README.md @@ -2,9 +2,9 @@ This is a [GitHub Action](https://help.github.com/en/categories/automating-your-workflow-with-github-actions) which contains various automation to assist with managing the Gutenberg GitHub repository: -- `first-time-contributor`: Adds the 'First Time Contributor' label to PRs merged on behalf of contributors that have not previously made a contribution, and prompts the user to link their GitHub account to their WordPress.org profile if neccessary for props credit. -- `add-milestone`: Assigns the correct milestone to PRs once merged. -- `assign-fixed-issues`: Assigns any issues 'fixed' by a newly opened PR to the author of that PR. +- [First Time Contributor](https://github.com/WordPress/gutenberg/tree/master/packages/project-management-automation/lib/tasks/first-time-contributor): Adds the "First Time Contributor" label to pull requests merged on behalf of contributors that have not previously made a contribution, and prompts the user to link their GitHub account to their WordPress.org profile if necessary for release notes credit. +- [Add Milestone](https://github.com/WordPress/gutenberg/tree/master/packages/project-management-automation/lib/tasks/add-milestone): Assigns the plugin release milestone to a pull request once it is merged. +- [Assign Fixed Issues](https://github.com/WordPress/gutenberg/tree/master/packages/project-management-automation/lib/tasks/assign-fixed-issues): Adds assignee for issues which are marked to be "Fixed" by a pull request, and adds the "In Progress" label. # Installation and usage diff --git a/packages/project-management-automation/lib/index.js b/packages/project-management-automation/lib/index.js index f7c05dd593cd56..37d83953b5af9c 100644 --- a/packages/project-management-automation/lib/index.js +++ b/packages/project-management-automation/lib/index.js @@ -7,9 +7,9 @@ const { context, GitHub } = require( '@actions/github' ); /** * Internal dependencies */ -const assignFixedIssues = require( './assign-fixed-issues' ); -const firstTimeContributor = require( './first-time-contributor' ); -const addMilestone = require( './add-milestone' ); +const assignFixedIssues = require( './tasks/assign-fixed-issues' ); +const firstTimeContributor = require( './tasks/first-time-contributor' ); +const addMilestone = require( './tasks/add-milestone' ); const debug = require( './debug' ); const ifNotFork = require( './if-not-fork' ); diff --git a/packages/project-management-automation/lib/tasks/add-milestone/README.md b/packages/project-management-automation/lib/tasks/add-milestone/README.md new file mode 100644 index 00000000000000..0865313203843b --- /dev/null +++ b/packages/project-management-automation/lib/tasks/add-milestone/README.md @@ -0,0 +1,12 @@ +Add Milestone +=== + +Assigns the plugin release milestone to a pull request once it is merged. + +Creates the milestone if it does not yet exist. + +## Rationale + +If a pull request is merged, it can be difficult to know which upcoming or past plugin version that change would be included within. This is useful for debugging if a change should be expected to be available for testing, and to know if a change should be anticipated to be released within an upcoming release of the plugin. + +It is also used in automation associated with [release changelogs](https://github.com/WordPress/gutenberg/blob/master/docs/contributors/release.md#writing-the-release-post-and-changelog), which aggregate pull requests based on the assigned milestone. diff --git a/packages/project-management-automation/lib/add-milestone.js b/packages/project-management-automation/lib/tasks/add-milestone/index.js similarity index 97% rename from packages/project-management-automation/lib/add-milestone.js rename to packages/project-management-automation/lib/tasks/add-milestone/index.js index 35c60f2ffdc274..4d35d10943a990 100644 --- a/packages/project-management-automation/lib/add-milestone.js +++ b/packages/project-management-automation/lib/tasks/add-milestone/index.js @@ -1,8 +1,8 @@ /** * Internal dependencies */ -const debug = require( './debug' ); -const getAssociatedPullRequest = require( './get-associated-pull-request' ); +const debug = require( '../../debug' ); +const getAssociatedPullRequest = require( '../../get-associated-pull-request' ); /** @typedef {import('@octokit/rest').HookError} HookError */ /** @typedef {import('@actions/github').GitHub} GitHub */ diff --git a/packages/project-management-automation/lib/test/add-milestone.js b/packages/project-management-automation/lib/tasks/add-milestone/test/index.js similarity index 99% rename from packages/project-management-automation/lib/test/add-milestone.js rename to packages/project-management-automation/lib/tasks/add-milestone/test/index.js index 4d5c96ca4c293c..cf9f185ef3ff6a 100644 --- a/packages/project-management-automation/lib/test/add-milestone.js +++ b/packages/project-management-automation/lib/tasks/add-milestone/test/index.js @@ -1,7 +1,7 @@ /** * Internal dependencies */ -import addMilestone from '../add-milestone'; +import addMilestone from '../'; describe( 'addMilestone', () => { it( 'does nothing if base is not master', async () => { diff --git a/packages/project-management-automation/lib/tasks/assign-fixed-issues/README.md b/packages/project-management-automation/lib/tasks/assign-fixed-issues/README.md new file mode 100644 index 00000000000000..b354a80fcd8627 --- /dev/null +++ b/packages/project-management-automation/lib/tasks/assign-fixed-issues/README.md @@ -0,0 +1,10 @@ +Assign Fixed Issues +=== + +Adds assignee for issues which are marked to be "Fixed" by a pull request, and adds the "In Progress" label. + +## Rationale + +For users who would be affected by an issue (including the issue's creator), it is useful to receive progress updates once efforts have begun to address the issue. + +[Issue assignment](https://help.github.com/en/github/managing-your-work-on-github/assigning-issues-and-pull-requests-to-other-github-users) is a useful GitHub feature for developers, as it can avoid a scenario where multiple developers spend effort toward resolving the same issue due to the fact that progress was not clearly communicated. diff --git a/packages/project-management-automation/lib/assign-fixed-issues.js b/packages/project-management-automation/lib/tasks/assign-fixed-issues/index.js similarity index 97% rename from packages/project-management-automation/lib/assign-fixed-issues.js rename to packages/project-management-automation/lib/tasks/assign-fixed-issues/index.js index 391184cbdf8439..c5f52e13775dac 100644 --- a/packages/project-management-automation/lib/assign-fixed-issues.js +++ b/packages/project-management-automation/lib/tasks/assign-fixed-issues/index.js @@ -1,7 +1,7 @@ /** * Internal dependencies */ -const debug = require( './debug' ); +const debug = require( '../../debug' ); /** @typedef {import('@actions/github').GitHub} GitHub */ /** @typedef {import('@octokit/webhooks').WebhookPayloadPullRequest} WebhookPayloadPullRequest */ diff --git a/packages/project-management-automation/lib/test/assign-fixed-issues.js b/packages/project-management-automation/lib/tasks/assign-fixed-issues/test/index.js similarity index 96% rename from packages/project-management-automation/lib/test/assign-fixed-issues.js rename to packages/project-management-automation/lib/tasks/assign-fixed-issues/test/index.js index 32356463626b9f..407f9c5e97b786 100644 --- a/packages/project-management-automation/lib/test/assign-fixed-issues.js +++ b/packages/project-management-automation/lib/tasks/assign-fixed-issues/test/index.js @@ -1,7 +1,7 @@ /** * Internal dependencies */ -import assignFixedIssues from '../assign-fixed-issues'; +import assignFixedIssues from '../'; describe( 'assignFixedIssues', () => { it( 'does nothing if there are no fixed issues', async () => { diff --git a/packages/project-management-automation/lib/tasks/first-time-contributor/README.md b/packages/project-management-automation/lib/tasks/first-time-contributor/README.md new file mode 100644 index 00000000000000..700fea1d201bca --- /dev/null +++ b/packages/project-management-automation/lib/tasks/first-time-contributor/README.md @@ -0,0 +1,12 @@ +First Time Contributor +=== + +Adds the "First Time Contributor" label to pull requests merged on behalf of contributors that have not previously made a contribution, and prompts the user to link their GitHub account to their WordPress.org profile if necessary for release notes credit. + +## Rationale + +A person's first contribution to the project is an exciting moment worth celebrating. + +Rate of new contributorship can be a potential metric of a project's open-source health. + +Compiling credits for release notes of a WordPress release [requires that a person's WordPress.org profile can be associated with a GitHub account](https://make.wordpress.org/core/2020/03/19/associating-github-accounts-with-wordpress-org-profiles/). This is not an obvious requirement for new contributors, and it should be brought to their attention at the earliest opportunity in their contributing journey. diff --git a/packages/project-management-automation/lib/first-time-contributor.js b/packages/project-management-automation/lib/tasks/first-time-contributor/index.js similarity index 91% rename from packages/project-management-automation/lib/first-time-contributor.js rename to packages/project-management-automation/lib/tasks/first-time-contributor/index.js index 901b9df361e04f..57169524a15028 100644 --- a/packages/project-management-automation/lib/first-time-contributor.js +++ b/packages/project-management-automation/lib/tasks/first-time-contributor/index.js @@ -1,13 +1,13 @@ /** * Internal dependencies */ -const debug = require( './debug' ); -const getAssociatedPullRequest = require( './get-associated-pull-request' ); -const hasWordPressProfile = require( './has-wordpress-profile' ); +const debug = require( '../../debug' ); +const getAssociatedPullRequest = require( '../../get-associated-pull-request' ); +const hasWordPressProfile = require( '../../has-wordpress-profile' ); /** @typedef {import('@actions/github').GitHub} GitHub */ /** @typedef {import('@octokit/webhooks').WebhookPayloadPush} WebhookPayloadPush */ -/** @typedef {import('./get-associated-pull-request').WebhookPayloadPushCommit} WebhookPayloadPushCommit */ +/** @typedef {import('../../get-associated-pull-request').WebhookPayloadPushCommit} WebhookPayloadPushCommit */ /** * Returns the message text to be used for the comment prompting contributor to diff --git a/packages/project-management-automation/lib/test/first-time-contributor.js b/packages/project-management-automation/lib/tasks/first-time-contributor/test/index.js similarity index 96% rename from packages/project-management-automation/lib/test/first-time-contributor.js rename to packages/project-management-automation/lib/tasks/first-time-contributor/test/index.js index 27a328c2b5948e..e419f961be217b 100644 --- a/packages/project-management-automation/lib/test/first-time-contributor.js +++ b/packages/project-management-automation/lib/tasks/first-time-contributor/test/index.js @@ -1,10 +1,10 @@ /** * Internal dependencies */ -import firstTimeContributor from '../first-time-contributor'; -import hasWordPressProfile from '../has-wordpress-profile'; +import firstTimeContributor from '../'; +import hasWordPressProfile from '../../../has-wordpress-profile'; -jest.mock( '../has-wordpress-profile', () => jest.fn() ); +jest.mock( '../../../has-wordpress-profile', () => jest.fn() ); describe( 'firstTimeContributor', () => { beforeEach( () => {