From e14de9a485d6b87927e4e908ef9400a6ddee841a Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 5 Aug 2025 10:28:52 +0200 Subject: [PATCH 01/12] removed disable-burst file --- .yamato/disable-burst-if-requested.py | 97 --------------------------- 1 file changed, 97 deletions(-) delete mode 100644 .yamato/disable-burst-if-requested.py diff --git a/.yamato/disable-burst-if-requested.py b/.yamato/disable-burst-if-requested.py deleted file mode 100644 index edf84d3f26..0000000000 --- a/.yamato/disable-burst-if-requested.py +++ /dev/null @@ -1,97 +0,0 @@ -# This file was used before for mobiles and Webgl but was removed (around end of January 2025). The file itself was left here for now in case we would need to use it. -# This Python script is used to manage Burst AOT (Ahead-Of-Time) compilation settings for Unity builds. -# An example usage would be "- python .yamato/disable-burst-if-requested.py --project-path {{ project.path }} --platform WebGL" - -import argparse -import json -import os - - -args = None -platform_plugin_definition = None - - -def resolve_target(platform): - resolved_target = platform - if 'StandaloneWindows' in platform: - resolved_target = 'StandaloneWindows' - elif 'StandaloneLinux' in platform: - resolved_target = 'StandaloneLinux64' - - return resolved_target - - -def create_config(settings_path, platform): - config_name = os.path.join(settings_path, 'BurstAotSettings_{}.json'.format(resolve_target(platform))) - monobehaviour = { - 'm_Enabled': True, - 'm_EditorHideFlags': 0, - 'm_Name': "", - 'm_EditorClassIdentifier': 'Unity.Burst.Editor:Unity.Burst.Editor:BurstPlatformAotSettings', - 'DisableOptimisations': False, - 'DisableSafetyChecks': True, - 'DisableBurstCompilation': False - } - - data = {'MonoBehaviour': monobehaviour} - with open(config_name, 'w') as f: - json.dump(data, f) - return config_name - - -def get_or_create_AOT_config(project_path, platform): - settings_path = os.path.join(project_path, 'ProjectSettings') - if not os.path.isdir(settings_path): - os.mkdir(settings_path) - config_names = [os.path.join(settings_path, filename) for filename in os.listdir(settings_path) if filename.startswith("BurstAotSettings_{}".format(resolve_target(platform)))] - if not config_names: - return [create_config(settings_path, platform)] - return config_names - - -def disable_AOT(project_path, platform): - config_names = get_or_create_AOT_config(project_path, platform) - for config_name in config_names: - set_AOT(config_name, True) - - -def enable_AOT(project_path, platform): - config_names = get_or_create_AOT_config(project_path, platform) - for config_name in config_names: - set_AOT(config_name, False) - - -def set_AOT(config_file, status): - config = None - with open(config_file, 'r') as f: - config = json.load(f) - - assert config is not None, 'AOT settings not found; did the burst-enabled build finish successfully?' - - config['MonoBehaviour']['DisableBurstCompilation'] = status - with open(config_file, 'w') as f: - json.dump(config, f) - - -def main(): - enable_burst = os.environ.get('ENABLE_BURST_COMPILATION', 'true').strip().lower() - if enable_burst == 'true': - print('BURST COMPILATION: ENABLED') - elif enable_burst == 'false': - print('BURST COMPILATION: DISABLED') - disable_AOT(args.project_path, args.platform) - else: - sys.exit('BURST COMPILATION: unexpected value: {}'.format(enable_burst)) - - -def parse_args(): - global args - parser = argparse.ArgumentParser(description='This tool disables burst AOT compilation') - parser.add_argument('--project-path', help='Specify the location of the unity project.') - parser.add_argument('--platform', help="Platform to be used to run the build.") - args = parser.parse_args() - - -if __name__ == '__main__': - parse_args() - main() \ No newline at end of file From c4184e57a87af77a80372ad592ab18bd67655379 Mon Sep 17 00:00:00 2001 From: michalChrobot Date: Tue, 5 Aug 2025 10:29:19 +0200 Subject: [PATCH 02/12] Running CI only on comment trigger --- .github/workflows/pr-keyword-check.yml | 10 +++++++++ .yamato/_triggers.yml | 28 ++++++++++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/pr-keyword-check.yml 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/.yamato/_triggers.yml b/.yamato/_triggers.yml index 0b651dfe66..9264d5f456 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,20 @@ #----------------------------------------------------------------------------------- +# Gates the merger of PRs as a pre-requisite. Runs when `/ci ngo` or `/ci ignore` is present as an issue comment +# Notice that I needed this job to do "something" and that's why there is a placeholder GitHub action used +# TODO: In the future we could have comment like "docs" or "project" to run a specific subset of tests +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 +77,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 From 5a50c31014b38825fa90e3f85396606164daeed0 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Fri, 29 Aug 2025 15:05:22 +0200 Subject: [PATCH 03/12] modify trigger to match against ONLY package or testproject changes --- .yamato/_triggers.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index 9264d5f456..556c04848a 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -77,9 +77,13 @@ 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: + # Note that PR tests will run ONLY if we are changing package/sample code. If changes are let's say docs only no tests will be triggered + # TODO: consider setting up and running tests from Examples/ + # TODO: or docs only changes are spelling/link check expression: |- pull_request.comment eq "ngo" AND - NOT pull_request.changes.all match "**/Documentation~/**" + (pull_request.changes.any match "com.unity.netcode.gameobjects/**" OR + pull_request.changes.any match "testproject/**") cancel_old_ci: true # Run all tests on trunk on nightly basis. From 163102a2aad942e39621ab0bfd2b687ef0f43ac9 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Tue, 2 Sep 2025 15:13:56 +0200 Subject: [PATCH 04/12] changed runner test --- .github/workflows/pr-keyword-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-keyword-check.yml b/.github/workflows/pr-keyword-check.yml index 4b58d79741..e08a538d61 100644 --- a/.github/workflows/pr-keyword-check.yml +++ b/.github/workflows/pr-keyword-check.yml @@ -5,6 +5,6 @@ on: # 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 + runs-on: ubuntu-latest steps: - run: ls From d0ba8425683b94b326867dd095c738d6a3cd3f59 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Tue, 2 Sep 2025 15:19:46 +0200 Subject: [PATCH 05/12] Removed gihub action check since we can't trigger it from public repo --- .github/workflows/pr-keyword-check.yml | 10 ---------- .yamato/_triggers.yml | 5 +++-- 2 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 .github/workflows/pr-keyword-check.yml diff --git a/.github/workflows/pr-keyword-check.yml b/.github/workflows/pr-keyword-check.yml deleted file mode 100644 index e08a538d61..0000000000 --- a/.github/workflows/pr-keyword-check.yml +++ /dev/null @@ -1,10 +0,0 @@ -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: ubuntu-latest - steps: - - run: ls diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index 556c04848a..95e2bd531a 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -47,8 +47,9 @@ 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 + type: shell + commands: + - echo "This is a placeholder job. It exists only to gate PR merges based on issue comments" triggers: expression: |- pull_request.comment eq "ngo" OR From 802fdb2fb90394f619f443463f6aa6db9fabed97 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Tue, 2 Sep 2025 15:34:45 +0200 Subject: [PATCH 06/12] Updated PR trigger to not need comment trigger keyword --- .yamato/_triggers.yml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index 95e2bd531a..344c65bb19 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -41,20 +41,6 @@ #----------------------------------------------------------------------------------- -# Gates the merger of PRs as a pre-requisite. Runs when `/ci ngo` or `/ci ignore` is present as an issue comment -# Notice that I needed this job to do "something" and that's why there is a placeholder GitHub action used -# TODO: In the future we could have comment like "docs" or "project" to run a specific subset of tests -check_pr_issue_comments_for_trigger_keywords: - name: Check PR for trigger comments of ngo or ignore. For example /ci ngo - agent: - type: shell - commands: - - echo "This is a placeholder job. It exists only to gate PR merges based on issue comments" - 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. @@ -82,9 +68,8 @@ pull_request_trigger: # TODO: consider setting up and running tests from Examples/ # TODO: or docs only changes are spelling/link check expression: |- - pull_request.comment eq "ngo" AND - (pull_request.changes.any match "com.unity.netcode.gameobjects/**" OR - pull_request.changes.any match "testproject/**") + pull_request.changes.any match "com.unity.netcode.gameobjects/**" OR + pull_request.changes.any match "testproject/**" cancel_old_ci: true # Run all tests on trunk on nightly basis. From eb0f26687d996f20a1d959be91af7153d6fbb66c Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Tue, 2 Sep 2025 15:35:46 +0200 Subject: [PATCH 07/12] Modified part of the package to see if PR trigger will run --- com.unity.netcode.gameobjects/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index 82bb8d4830..e2d4d7a36e 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -24,7 +24,6 @@ Additional documentation and release notes are available at [Multiplayer Documen - Fixed issue where a client, under above average latency and packet loss conditions, could receive multiple NetworkTransform state updates in one frame and when processing the state updates only the last state update would be applied to the transform if interpolation was disabled. (#3614) - ### Security From 9473b7d8ab4923431ded0ef28d08b6c1a4da1fb4 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Tue, 2 Sep 2025 15:50:30 +0200 Subject: [PATCH 08/12] comment correction --- .yamato/_triggers.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index 344c65bb19..471e68c4a4 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -9,15 +9,14 @@ # Each pattern represents different balance between validation depth, execution time and CI resource usage # TRIGGER PATTERNS------------------------------------------------------------------- + # Pull Request: # This test validates Standards, Package tests, Project tests and Desktop standalone tests to ensure that main platforms are covered # Triggers on PRs to develop, develop, and release branches # 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 - +# Excludes running when changes are not touching package or testproject code (e.g. docs only changes) # Nightly: # This test validates same subset as pull_request_trigger with addition of mobile/console tests and webgl builds From fbc339a36a6d2e73aab69ddf7e945f758dc6e77b Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Tue, 2 Sep 2025 15:51:50 +0200 Subject: [PATCH 09/12] reverted changelog change --- com.unity.netcode.gameobjects/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index e2d4d7a36e..82bb8d4830 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -24,6 +24,7 @@ Additional documentation and release notes are available at [Multiplayer Documen - Fixed issue where a client, under above average latency and packet loss conditions, could receive multiple NetworkTransform state updates in one frame and when processing the state updates only the last state update would be applied to the transform if interpolation was disabled. (#3614) + ### Security From 6f32eabc2746761638ace126b2e417a226b905c4 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Tue, 2 Sep 2025 16:12:00 +0200 Subject: [PATCH 10/12] Modify trigger to account for draft PRs and branches --- .yamato/_triggers.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index 471e68c4a4..da5ef42c53 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -67,8 +67,12 @@ pull_request_trigger: # TODO: consider setting up and running tests from Examples/ # TODO: or docs only changes are spelling/link check expression: |- - pull_request.changes.any match "com.unity.netcode.gameobjects/**" OR - pull_request.changes.any match "testproject/**" + (pull_request.target eq "develop" OR + pull_request.target eq "develop-2.0.0" OR + pull_request.target match "release/*") AND + NOT pull_request.draft AND + (pull_request.changes.any match "com.unity.netcode.gameobjects/**" OR + pull_request.changes.any match "testproject/**") cancel_old_ci: true # Run all tests on trunk on nightly basis. From 66e0fb511b8e304c6edadca97d0d3359d3424099 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Tue, 2 Sep 2025 16:15:14 +0200 Subject: [PATCH 11/12] test with package changes --- com.unity.netcode.gameobjects/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/CHANGELOG.md b/com.unity.netcode.gameobjects/CHANGELOG.md index 82bb8d4830..e2d4d7a36e 100644 --- a/com.unity.netcode.gameobjects/CHANGELOG.md +++ b/com.unity.netcode.gameobjects/CHANGELOG.md @@ -24,7 +24,6 @@ Additional documentation and release notes are available at [Multiplayer Documen - Fixed issue where a client, under above average latency and packet loss conditions, could receive multiple NetworkTransform state updates in one frame and when processing the state updates only the last state update would be applied to the transform if interpolation was disabled. (#3614) - ### Security From 3234cc314a4621d112f86f08209c7f88df523a24 Mon Sep 17 00:00:00 2001 From: michal-chrobot Date: Tue, 2 Sep 2025 17:24:17 +0200 Subject: [PATCH 12/12] Added possibility of usage of /ci ngo --- .yamato/_triggers.yml | 51 +++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/.yamato/_triggers.yml b/.yamato/_triggers.yml index da5ef42c53..549e90ccdb 100644 --- a/.yamato/_triggers.yml +++ b/.yamato/_triggers.yml @@ -2,40 +2,42 @@ --- # DESCRIPTION-------------------------------------------------------------------------- -# This configuration defines three main CI trigger patterns: -# 1. Pull Request Validation: Validation performed on PR basis -# 2. Nightly Development: Test set run nightly (validates most important test cases) -# 3. Weekly Full Validation: Test set run weekly (validates all test cases to prevent any surprises) -# Each pattern represents different balance between validation depth, execution time and CI resource usage + # This configuration defines three main CI trigger patterns: + # 1. Pull Request Validation: Validation performed on PR basis + # 2. Nightly Development: Test set run nightly (validates most important test cases) + # 3. Weekly Full Validation: Test set run weekly (validates all test cases to prevent any surprises) + # Each pattern represents different balance between validation depth, execution time and CI resource usage # TRIGGER PATTERNS------------------------------------------------------------------- # Pull Request: -# This test validates Standards, Package tests, Project tests and Desktop standalone tests to ensure that main platforms are covered -# Triggers on PRs to develop, develop, and release branches -# 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 are not touching package or testproject code (e.g. docs only changes) + # This test validates Standards, Package tests, Project tests and Desktop standalone tests to ensure that main platforms are covered + # Focuses on critical validation paths that we should validate before merging PRs. It also cancels previous runs on new commits + # By default it's triggered if + # 1) PR targets develop, develop-2.0.0 or release branches + # 2) PR is not a draft + # 3) PR changes files in package or testproject folders (doesn't run on for example DOCS only changes) + + # Note that in other cases you can trigger it by writing a comment "/ci ngo" in the PR thread # Nightly: -# This test validates same subset as pull_request_trigger with addition of mobile/console tests and webgl builds -# Runs daily on develop (local configuration) -# Includes all test types but only on trunk. -# Adds platform-specific and APV validation + # This test validates same subset as pull_request_trigger with addition of mobile/console tests and webgl builds + # Runs daily on develop (local configuration) + # Includes all test types but only on trunk. + # Adds platform-specific and APV validation # Weekly: -# This test validates same subset as develop_nightly but runs per all supported editors as well as executes code coverage test and runs project standards per project -# Runs across all supported editor versions -# Includes code coverage analysis -# Validates all projects and standards + # This test validates same subset as develop_nightly but runs per all supported editors as well as executes code coverage test and runs project standards per project + # Runs across all supported editor versions + # Includes code coverage analysis + # Validates all projects and standards # CONFIGURATION STRUCTURE-------------------------------------------------------------- -# Jobs configurations are generated by ensuring that all dependencies are successful. -# The dependencies are taken from _run-all.yml file where we can gather multiple tests into proper sets + # Jobs configurations are generated by ensuring that all dependencies are successful. + # The dependencies are taken from _run-all.yml file where we can gather multiple tests into proper sets # QUALITY CONSIDERATIONS--------------------------------------------------------------- -# It's important to ensure that all dependencies exist (this can be verified in Yamato) since a modification in parameters may result in a given job not being generated, and thus we will not be able to run such erroneous job. + # It's important to ensure that all dependencies exist (this can be verified in Yamato) since a modification in parameters may result in a given job not being generated, and thus we will not be able to run such erroneous job. #----------------------------------------------------------------------------------- @@ -67,12 +69,13 @@ pull_request_trigger: # TODO: consider setting up and running tests from Examples/ # TODO: or docs only changes are spelling/link check expression: |- - (pull_request.target eq "develop" OR + pull_request.comment eq "ngo" OR + ((pull_request.target eq "develop" OR pull_request.target eq "develop-2.0.0" OR pull_request.target match "release/*") AND NOT pull_request.draft AND (pull_request.changes.any match "com.unity.netcode.gameobjects/**" OR - pull_request.changes.any match "testproject/**") + pull_request.changes.any match "testproject/**")) cancel_old_ci: true # Run all tests on trunk on nightly basis.