From b12bec94508b1374d52ad441bc64e09b6bcc150e Mon Sep 17 00:00:00 2001 From: Fanit Kolchina Date: Fri, 12 Jul 2024 14:18:46 -0400 Subject: [PATCH 1/7] Add PR checklist workflow Signed-off-by: Fanit Kolchina --- .github/workflows/pr_checklist.yml | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/pr_checklist.yml diff --git a/.github/workflows/pr_checklist.yml b/.github/workflows/pr_checklist.yml new file mode 100644 index 0000000000..b5f63abb27 --- /dev/null +++ b/.github/workflows/pr_checklist.yml @@ -0,0 +1,33 @@ +name: PR Checklist + +on: + pull_request: + types: [opened] + +jobs: + add-checklist: + runs-on: ubuntu-latest + + steps: + - name: Comment PR with checklist + uses: peter-evans/create-or-update-comment@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + Thank you for submitting your PR. The PR states are In progress (or Draft) -> Tech review -> Doc review -> Editorial review -> Merged. + + Before you mark the PR ready for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a [maintainer](https://github.com/opensearch-project/documentation-website/blob/main/MAINTAINERS.md). + + **When you're ready for doc review, tag the assignee of this PR**. The doc reviewer may push edits to the PR directly, or leave comments and editorial suggestions for you to approve, make changes, and commit yourself (let us know in a comment if you have a preference.) The doc reviewer will arrange for an editorial review. + + - name: Auto assign PR to repo owner + uses: actions/github-script@v6 + with: + script: | + github.rest.issues.addAssignees({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + assignees: context.repo.owner + }) \ No newline at end of file From 0a317a221edaf9f7d6f60d3f8484b6fbc26d47b6 Mon Sep 17 00:00:00 2001 From: Fanit Kolchina Date: Fri, 12 Jul 2024 14:25:03 -0400 Subject: [PATCH 2/7] Assign to user instead of owner Signed-off-by: Fanit Kolchina --- .github/workflows/pr_checklist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_checklist.yml b/.github/workflows/pr_checklist.yml index b5f63abb27..3042926909 100644 --- a/.github/workflows/pr_checklist.yml +++ b/.github/workflows/pr_checklist.yml @@ -29,5 +29,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - assignees: context.repo.owner + assignees: 'hdhalter' }) \ No newline at end of file From 56833d6db204d7acce0164349272322ebd4047d4 Mon Sep 17 00:00:00 2001 From: Fanit Kolchina Date: Fri, 12 Jul 2024 14:26:52 -0400 Subject: [PATCH 3/7] Testing Signed-off-by: Fanit Kolchina --- .github/workflows/pr_checklist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_checklist.yml b/.github/workflows/pr_checklist.yml index 3042926909..a7dc664d36 100644 --- a/.github/workflows/pr_checklist.yml +++ b/.github/workflows/pr_checklist.yml @@ -2,7 +2,7 @@ name: PR Checklist on: pull_request: - types: [opened] +# types: [opened] jobs: add-checklist: From 04fba9a16ee29e0f65ecc3b03d82691729d2dc0e Mon Sep 17 00:00:00 2001 From: Fanit Kolchina Date: Fri, 12 Jul 2024 14:28:09 -0400 Subject: [PATCH 4/7] Remove test Signed-off-by: Fanit Kolchina --- .github/workflows/pr_checklist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_checklist.yml b/.github/workflows/pr_checklist.yml index a7dc664d36..3042926909 100644 --- a/.github/workflows/pr_checklist.yml +++ b/.github/workflows/pr_checklist.yml @@ -2,7 +2,7 @@ name: PR Checklist on: pull_request: -# types: [opened] + types: [opened] jobs: add-checklist: From e94a41d632a67c880b728f8e58c3d4eda765f4a2 Mon Sep 17 00:00:00 2001 From: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:14:19 -0400 Subject: [PATCH 5/7] Apply suggestions from code review Co-authored-by: Nathan Bower Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> --- .github/workflows/pr_checklist.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_checklist.yml b/.github/workflows/pr_checklist.yml index 3042926909..c55a80d7f2 100644 --- a/.github/workflows/pr_checklist.yml +++ b/.github/workflows/pr_checklist.yml @@ -17,9 +17,9 @@ jobs: body: | Thank you for submitting your PR. The PR states are In progress (or Draft) -> Tech review -> Doc review -> Editorial review -> Merged. - Before you mark the PR ready for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a [maintainer](https://github.com/opensearch-project/documentation-website/blob/main/MAINTAINERS.md). + Before you submit your PR for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a [maintainer](https://github.com/opensearch-project/documentation-website/blob/main/MAINTAINERS.md). - **When you're ready for doc review, tag the assignee of this PR**. The doc reviewer may push edits to the PR directly, or leave comments and editorial suggestions for you to approve, make changes, and commit yourself (let us know in a comment if you have a preference.) The doc reviewer will arrange for an editorial review. + **When you're ready for doc review, tag the assignee of this PR**. The doc reviewer may push edits to the PR directly or leave comments and editorial suggestions for you to address (let us know in a comment if you have a preference). The doc reviewer will arrange for an editorial review. - name: Auto assign PR to repo owner uses: actions/github-script@v6 From 93f343d83b7f55ec0e534b59046f097b3e32b4de Mon Sep 17 00:00:00 2001 From: Fanit Kolchina Date: Fri, 12 Jul 2024 21:19:08 -0400 Subject: [PATCH 6/7] If a PR is submitted by a doc team member, assign that member Signed-off-by: Fanit Kolchina --- .github/workflows/pr_checklist.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_checklist.yml b/.github/workflows/pr_checklist.yml index c55a80d7f2..fed133103e 100644 --- a/.github/workflows/pr_checklist.yml +++ b/.github/workflows/pr_checklist.yml @@ -2,7 +2,7 @@ name: PR Checklist on: pull_request: - types: [opened] +# types: [opened] jobs: add-checklist: @@ -25,9 +25,16 @@ jobs: uses: actions/github-script@v6 with: script: | + let assignee = context.payload.pull_request.user.login; + const prOwners = ['Naarcha-AWS', 'kolchfa-aws', 'vagimeli', 'natebower']; + + if (!prOwners.includes(assignee)) { + assignee = 'hdhalter' + } + github.rest.issues.addAssignees({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - assignees: 'hdhalter' - }) \ No newline at end of file + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + assignees: [assignee] + }); \ No newline at end of file From c7f8b11bab84b2af681d17668e96f2b444c06df9 Mon Sep 17 00:00:00 2001 From: Fanit Kolchina Date: Fri, 12 Jul 2024 21:24:36 -0400 Subject: [PATCH 7/7] Remove test Signed-off-by: Fanit Kolchina --- .github/workflows/pr_checklist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_checklist.yml b/.github/workflows/pr_checklist.yml index fed133103e..c2c5c6db53 100644 --- a/.github/workflows/pr_checklist.yml +++ b/.github/workflows/pr_checklist.yml @@ -2,7 +2,7 @@ name: PR Checklist on: pull_request: -# types: [opened] + types: [opened] jobs: add-checklist: