From 46b9ee88c8c2324491948f5c5b274eb9560da1ed Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 15:10:34 +0200 Subject: [PATCH 1/3] Modified the PR template --- .github/pull_request_template.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index efe4270525..4a85a6688a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -2,8 +2,6 @@ - - ## Changelog - Added: The package whose Changelog should be added to should be in the header. Delete the changelog section entirely if it's not needed. @@ -26,3 +24,9 @@ - [ ] Deprecation of the API is explained in the CHANGELOG. - [ ] The users can understand why this API was removed and what they should use instead. --> + +## Backports + +Link to the backport to develop branch (NGOv1.X) if applicable. If this is a backport, please add the following to the PR title: "\[Backport\] ..." . +If the backport is not needed please provide the reason why. +If "Backports" section will not be present it will lead to CI test failure \ No newline at end of file From 448db2a640a5b0c1ed4a954d65785f379d7a2c88 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 8 Apr 2025 15:58:16 +0200 Subject: [PATCH 2/3] Added backport-verification workflow --- .github/pull_request_template.md | 2 +- .github/workflows/backport-verification.yml | 32 +++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/backport-verification.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 4a85a6688a..0845602a9b 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -25,7 +25,7 @@ - [ ] The users can understand why this API was removed and what they should use instead. --> -## Backports +## Backport Link to the backport to develop branch (NGOv1.X) if applicable. If this is a backport, please add the following to the PR title: "\[Backport\] ..." . If the backport is not needed please provide the reason why. diff --git a/.github/workflows/backport-verification.yml b/.github/workflows/backport-verification.yml new file mode 100644 index 0000000000..82176f64bc --- /dev/null +++ b/.github/workflows/backport-verification.yml @@ -0,0 +1,32 @@ +# This workflow is designed to verify that the pull request description contains a "## Backport" section, which is important as a reminder to account for backports for anyone that works with NGO repository. +# We have 2 development branches (develop and develop-2.0.0) and we need to ensure that relevant changes are landing in only one or both of them +# If the "##Backport" section is missing, the workflow will fail and block the PR from merging, prompting the developer to add this section. + +# The workflow is configured to run when PR is created as well as when it is edited which also counts simple description edits. + +name: "NGO - Backport Verification" + +on: + pull_request: + types: [opened, edited] + branches: + - develop + - develop-2.0.0 + +jobs: + backport-verification: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Check PR description + uses: actions/github-script@v6 + with: + script: | + const pr = context.payload.pull_request; + const body = pr.body || ''; + + if (!body.includes('## Backport')) { + core.setFailed('PR description must include a "## Backport" section. Please add this section and provide information about this PR backport to develop or develop-2.0.0 branch respectively or explain why backport is not needed.'); + } \ No newline at end of file From d933c7ae76b9813947e979ce1f0546955962dfb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= <124174716+michalChrobot@users.noreply.github.com> Date: Wed, 9 Apr 2025 10:57:22 +0200 Subject: [PATCH 3/3] Update .github/pull_request_template.md Co-authored-by: Emma --- .github/pull_request_template.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 0845602a9b..bdf3f3801f 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -27,6 +27,10 @@ ## Backport -Link to the backport to develop branch (NGOv1.X) if applicable. If this is a backport, please add the following to the PR title: "\[Backport\] ..." . -If the backport is not needed please provide the reason why. -If "Backports" section will not be present it will lead to CI test failure \ No newline at end of file + \ No newline at end of file