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 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-keyword-check.yml b/.github/workflows/pr-keyword-check.yml new file mode 100644 index 0000000000..4b58d79741 --- /dev/null +++ b/.github/workflows/pr-keyword-check.yml @@ -0,0 +1,10 @@ +name: PR keyword check +on: + workflow_dispatch: + +# This workflow deliberately does nothing of value. The branch rules require the associated "Check PR issue comments for trigger keywords" job to have run before the PR being merged +jobs: + pr-keyword-check: + runs-on: unity-linux-runner + steps: + - run: ls 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 diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index 0b651dfe66..b0e7d3bb82 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -15,6 +15,9 @@ # Focuses on critical validation paths that we should validate before merging PRs # Cancels previous runs on new commits # Excludes draft PRs +# Excludes running when changes ONLY touching documentation files +# Requires `/ci ngo` or `/ci ignore` comment to trigger the job. This was implemented and explained in https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/pull/3577 + # Nightly: # This test validates same subset as pull_request_trigger with addition of mobile/console tests and webgl builds @@ -38,6 +41,18 @@ #----------------------------------------------------------------------------------- +# Gates the merger of PRs as a pre-requisite. Runs when `/ci ngo` or `/ci ignore` is present as an issue comment +check_pr_issue_comments_for_trigger_keywords: + name: Check PR for trigger comments of ngo or ignore. For example /ci ngo + agent: + type: Unity::github::action + action_source: pr-keyword-check.yml + triggers: + expression: |- + pull_request.comment eq "ngo" OR + pull_request.comment eq "ignore" + + # Run all relevant tasks when a pull request targeting the develop or release branch is created or updated. # In order to have better coverage we run desktop standalone tests with different configurations which allows to mostly cover for different platforms, scripting backends and editor versions. # This job will FIRST run "run_quick_checks" jobs (defined in _run-all.yml) since it's the dependency of project pack jobs which is on the lowest dependency tier. This runs the fastest checks (like PVP or code standards) and ONLY IF those pass it will run the rest of the tests. @@ -60,15 +75,10 @@ pull_request_trigger: - .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_win_il2cpp_6000.0 - .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_trunk triggers: + expression: |- + pull_request.comment eq "ngo" AND + NOT pull_request.changes.all match "**/Documentation~/**" cancel_old_ci: true - pull_requests: - - targets: - only: - - "develop" - - "develop-2.0.0" - - "/release\/.*/" - - drafts: false - # Run all tests on trunk on nightly basis. # Same subset as pull_request_trigger with addition of mobile/desktop/console tests and webgl builds diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index 489af4f446..fe185b51cb 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -25,6 +25,8 @@ Additional documentation and release notes are available at [Multiplayer Documen ### Changed +### Documentation + ## [2.4.4] - 2025-07-07 ### Added