From e67b96370f642f54d22aaa8ba421c16a3bb70701 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 5 Aug 2025 11:27:42 +0200 Subject: [PATCH 1/6] PR template update --- .github/pull_request_template.md | 68 ++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 21 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index bdf3f3801f..a38bcad3a7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,21 +1,18 @@ - +## Purpose of this PR +[//]: # ( +Replace this block with what this PR does and why. Describe what you'd like reviewers to know, how you applied the engineering principles, and any interesting tradeoffs made. +) - +### Jira ticket +_Link to related jira ticket ([Use the smart commits](https://support.atlassian.com/bitbucket-cloud/docs/use-smart-commits/))_ -## Changelog +### Changelog +[//]: # (updated with all public facing changes - API changes, UI/UX changes, behaviour changes, bug fixes. Remove if not relevant.) - Added: The package whose Changelog should be added to should be in the header. Delete the changelog section entirely if it's not needed. -- Fixed: If you update multiple packages, create a new section with a new header for the other package. +- Fixed: If you update multiple packages, create a new section with a new header for the other package. - Removed/Deprecated/Changed: Each bullet should be prefixed with Added, Fixed, Removed, Deprecated, or Changed to indicate where the entry should go. - -## Testing and Documentation - -- No tests have been added. -- Includes unit tests. -- Includes integration tests. -- No documentation changes or additions were necessary. -- Includes documentation for previously-undocumented public API entry points. -- Includes edits to existing public API documentation. +- Documentation: Contains significant docs changes -## Backport +### Documentation +[//]: # ( +This section is REQUIRED and should mention what documentation changes were following the changes in this PR. +We should always evaluate if the changes in this PR require any documentation changes. +) - \ No newline at end of file +- No documentation changes or additions were necessary. +- Includes documentation for previously-undocumented public API entry points. +- Includes edits to existing public API documentation. + +## Testing & QA +[//]: # ( +This section is REQUIRED and should describe how the changes were tested and how should they be tested when Playtesting for the release. +It can range from "edge case covered by unit tests" to "manual testing required and new sample was added". +Expectation is that PR creator does some manual testing and provides a summary of it here.) + +### Functional Testing +[//]: # (If checked, List manual tests that have been performed.) +_Manual testing :_ +- [ ] `Manual testing done` + +_Automated tests:_ +- [ ] `Covered by existing automated tests` +- [ ] `Covered by new automated tests` + +_Does the change require QA team to:_ + +- [ ] `Review automated tests`? +- [ ] `Execute manual tests`? + +If any boxes above are checked, please add QA as a PR reviewer. + +## Backport +[//]: # ( +This section is REQUIRED and should link to the PR that targets other NGO version which is either develop or develop-2.0.0 branch +Add the following to the PR title: "\[Backport\] ..." +If this is not needed, for example feature specific to NGOv2.X, then just mention this fact. +) \ No newline at end of file From 5dac56a061012d1e8bf279f777b566e4f1a3de0f Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 5 Aug 2025 11:28:55 +0200 Subject: [PATCH 2/6] PR sections verification --- .github/workflows/backport-verification.yml | 32 ----------- .github/workflows/pr-verification.yml | 61 +++++++++++++++++++++ 2 files changed, 61 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/backport-verification.yml create mode 100644 .github/workflows/pr-verification.yml diff --git a/.github/workflows/backport-verification.yml b/.github/workflows/backport-verification.yml deleted file mode 100644 index 4e82b13af6..0000000000 --- a/.github/workflows/backport-verification.yml +++ /dev/null @@ -1,32 +0,0 @@ -# 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, synchronize, reopened] - branches: - - develop - - develop-2.0.0 - -jobs: - backport-verification: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Check PR description - uses: actions/github-script@v7 - 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 diff --git a/.github/workflows/pr-verification.yml b/.github/workflows/pr-verification.yml new file mode 100644 index 0000000000..d37a08bd0c --- /dev/null +++ b/.github/workflows/pr-verification.yml @@ -0,0 +1,61 @@ +# This workflow is designed to verify that the pull request description contains a required sections that are important from quality perspective. +# ## Backport section is important as a reminder to account for backports for anyone that works with NGO repository (to 1.X or 2.X branches respectively). +# ## Testing & QA section is important to ensure that the PR has appropriate testing coverage and is important when QA will evaluate PRs before Playtesting for the release. +# ### Documentation section is important to ensure that the documentation is updated with the changes made in the PR. + +# If any of the sections is missing, the workflow will fail and block the PR from merging, prompting the developer to add those sections to the PR description. +# 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 - PR Verification" + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + branches: + - develop + - develop-2.0.0 + +jobs: + pr-verification: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Check PR description + uses: actions/github-script@v7 + with: + script: | + const pr = context.payload.pull_request; + const body = pr.body || ''; + + // List of mandatory PR sections + const requiredSections = [ + { + header: '## Backport', + description: '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.' + }, + { + header: '## Testing & QA', + description: 'PR description must include a "## Testing & QA" section. Please add this section and provide information about the testing performed for this PR. It can range from adding unit tests to full samples and is needed from QA side to analyze PRs while Playtesting for the release.' + }, + { + header: '### Documentation', + description: 'PR description must include a "### Documentation" section. Please add this section and provide information about the documentation changes made in this PR. It is important to keep the documentation up to date with the code changes.' + } + ]; + + const missing = requiredSections.filter(section => !body.includes(section.header)); + + if (missing.length > 0) { + let message = 'PR description is missing the following required section(s):\n'; + + const missingDescriptions = missing.map( + s => `- ${s.header}: ${s.description}` + ); + + message += missingDescriptions.join('\n'); + message += '\n\nPlease add them to your PR description.'; + + core.setFailed(message); + } \ No newline at end of file From a344437b8d63ef685f939dfedad29bae85a3115d Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 5 Aug 2025 12:51:18 +0200 Subject: [PATCH 3/6] Corrected documentation formatting for the ease of read/fixing --- .github/pull_request_template.md | 2 +- .github/workflows/pr-verification.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a38bcad3a7..bd2630dd01 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -22,7 +22,7 @@ _Link to related jira ticket ([Use the smart commits](https://support.atlassian. - [ ] The users can understand why this API was removed and what they should use instead. --> -### Documentation +## Documentation [//]: # ( This section is REQUIRED and should mention what documentation changes were following the changes in this PR. We should always evaluate if the changes in this PR require any documentation changes. diff --git a/.github/workflows/pr-verification.yml b/.github/workflows/pr-verification.yml index d37a08bd0c..d6fde5f551 100644 --- a/.github/workflows/pr-verification.yml +++ b/.github/workflows/pr-verification.yml @@ -40,8 +40,8 @@ jobs: description: 'PR description must include a "## Testing & QA" section. Please add this section and provide information about the testing performed for this PR. It can range from adding unit tests to full samples and is needed from QA side to analyze PRs while Playtesting for the release.' }, { - header: '### Documentation', - description: 'PR description must include a "### Documentation" section. Please add this section and provide information about the documentation changes made in this PR. It is important to keep the documentation up to date with the code changes.' + header: '## Documentation', + description: 'PR description must include a "## Documentation" section. Please add this section and provide information about the documentation changes made in this PR. It is important to keep the documentation up to date with the code changes.' } ]; From 102cc3ba8b617ca86423eae92488b361372dd49e Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 5 Aug 2025 13:02:03 +0200 Subject: [PATCH 4/6] Running PR verification also for release branches --- .github/workflows/pr-verification.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-verification.yml b/.github/workflows/pr-verification.yml index d6fde5f551..f0d04413ea 100644 --- a/.github/workflows/pr-verification.yml +++ b/.github/workflows/pr-verification.yml @@ -12,8 +12,9 @@ on: pull_request: types: [opened, edited, synchronize, reopened] branches: - - develop - - develop-2.0.0 + - "develop" + - "develop-2.0.0" + - "/release\/.*/" jobs: pr-verification: From 20a6a4a13976d90a663b1ae9ab0334dc58c4621a Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 5 Aug 2025 13:28:47 +0200 Subject: [PATCH 5/6] typos --- .github/pull_request_template.md | 3 +-- .github/workflows/pr-verification.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index bd2630dd01..6309b34809 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -11,8 +11,7 @@ _Link to related jira ticket ([Use the smart commits](https://support.atlassian. - Added: The package whose Changelog should be added to should be in the header. Delete the changelog section entirely if it's not needed. - Fixed: If you update multiple packages, create a new section with a new header for the other package. -- Removed/Deprecated/Changed: Each bullet should be prefixed with Added, Fixed, Removed, Deprecated, or Changed to indicate where the entry should go. -- Documentation: Contains significant docs changes +- Removed/Deprecated/Changed: Each bullet should be prefixed with Added, Fixed, Removed, Deprecated, or Changed to indicate where the entry should go