Skip to content

Commit e5d4627

Browse files
authored
Merge branch 'develop-2.0.0' into chore/update-change-ownership-tests
2 parents d543c62 + c1f86c6 commit e5d4627

File tree

96 files changed

+2963
-1450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+2963
-1450
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# GitHub Actions workflow to monitor Yamato CI job state on pull requests
2+
# We are using https://cli.github.com/manual/gh_pr_checks
3+
# The aim is to ensure that conditionally triggered Yamato jobs are completed successfully before allowing merges
4+
5+
# This job will be required in branch protection rules for develop, develop-2.0.0, and release/* branches. It's only goal will be to ensure that Yamato jobs are completed successfully before allowing Pr to merge.
6+
# Note that conditional jobs will have 30s to show which is always the cas since they are showing up as soon as in distribution stage.
7+
8+
name: Yamato PR Supervisor
9+
10+
on:
11+
pull_request:
12+
types: [opened, synchronize, reopened]
13+
branches:
14+
- develop
15+
- develop-2.0.0
16+
- release/*
17+
18+
concurrency:
19+
group: pr-${{ github.event.pull_request.number }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
yamato-supervisor:
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 720
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Wait and Verify Yamato Job Status
31+
env:
32+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
33+
PR_NUMBER: ${{ github.event.pull_request.number }}
34+
run: |
35+
set -e
36+
37+
38+
MAX_ATTEMPTS=$((12*60))
39+
INTERVAL=60
40+
41+
sleep $INTERVAL
42+
for ((i=1;i<=MAX_ATTEMPTS;i++)); do
43+
echo "Polling PR checks (attempt $i/$MAX_ATTEMPTS)..."
44+
45+
# We want to watch for pending checks beside this check
46+
checks=$(gh pr checks $PR_NUMBER --json name,state --jq '[ .[] | select(.name != "yamato-supervisor") ]')
47+
48+
pending=$(echo "$checks" | jq '[.[] | select(.state == "PENDING")] | length')
49+
skipping=$(echo "$checks" | jq '[.[] | select(.state == "SKIPPED")] | length')
50+
passed=$(echo "$checks" | jq '[.[] | select(.state == "SUCCESS")] | length')
51+
failed=$(echo "$checks" | jq '[.[] | select(.state == "FAILURE")] | length')
52+
53+
echo "Pending checks: $pending, Skipping checks: $skipping", Passed checks: $passed, Failed checks: $failed
54+
55+
if [[ "$failed" -gt 0 ]]; then
56+
echo "A check has failed! Failing fast."
57+
exit 1
58+
fi
59+
60+
if [[ "$pending" -eq 0 ]] && [[ "$passed" -gt 0 ]]; then
61+
echo "All non-supervisor checks are completed!"
62+
exit 0
63+
fi
64+
65+
sleep $INTERVAL
66+
done

.yamato/_triggers.yml

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,23 @@
44
# DESCRIPTION--------------------------------------------------------------------------
55
# This configuration defines three main CI trigger patterns:
66
# 1. Pull Request Validation: Validation performed on PR basis
7+
# - we have mandatory minimal checks that run on all PRs (even if only docs are changed)
8+
# - we have more extensive pr_code_changes_checks that run if code is changed
79
# 2. Nightly Development: Test set run nightly (validates most important test cases)
810
# 3. Weekly Full Validation: Test set run weekly (validates all test cases to prevent any surprises)
911
# Each pattern represents different balance between validation depth, execution time and CI resource usage
1012

1113
# TRIGGER PATTERNS-------------------------------------------------------------------
1214

1315
# Pull Request:
14-
# This test validates Standards, Package tests, Project tests and Desktop standalone tests to ensure that main platforms are covered
15-
# Focuses on critical validation paths that we should validate before merging PRs. It also cancels previous runs on new commits
16-
# By default it's triggered if
16+
# We have two PR triggers:
17+
# 1) Minimal PR checks that run on all PRs (even if only docs are changed)
18+
# 2) More extensive pr_code_changes_checks that run if code is changed. This test validates Standards, Package tests, Project tests and Desktop standalone tests to ensure that main platforms are covered
19+
# By default pr_minimal_required_checks it's triggered if
1720
# 1) PR targets develop, develop-2.0.0 or release branches
1821
# 2) PR is not a draft
19-
# 3) PR changes files in package or testproject folders (doesn't run on for example DOCS only changes)
22+
# Then pr_code_changes_checks it's triggered if the same conditions apply plus:
23+
# 1) PR changes code in com.unity.netcode.gameobjects package (Editor, Runtime or Tests folders) or in testproject folder or package.json file
2024

2125
# Note that in other cases you can trigger it by writing a comment "/ci ngo" in the PR thread
2226

@@ -40,16 +44,32 @@
4044
# 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.
4145

4246

43-
#-----------------------------------------------------------------------------------
47+
#-----------------------------------------------------------------------------------
48+
49+
# After some experimenting with CI setups we discovered that even though sometimes we don't need CI to run (no reason to run package tests if only Documentation is changed) there are some checks that devs may not realize but changes in seemingly unrelated files will cause their failures
50+
# This trigger was created to ensure that ALL PRs run this minimal check even when we don't need to run full tests
51+
pr_minimal_required_checks:
52+
name: Minimal PR checks
53+
dependencies:
54+
- .yamato/package-pack.yml#package_pack_-_ngo_win
55+
- .yamato/project-standards.yml#standards_ubuntu_testproject_trunk
56+
triggers:
57+
expression: |-
58+
(pull_request.comment eq "ngo" OR
59+
(pull_request.target eq "develop" OR
60+
pull_request.target eq "develop-2.0.0" OR
61+
pull_request.target match "release/*")) AND
62+
NOT pull_request.draft
63+
cancel_old_ci: true
4464

4565

4666
# Run all relevant tasks when a pull request targeting the develop or release branch is created or updated.
4767
# 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.
4868
# 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.
4969
# This optimization allows to speed up feedback look for any "obvious" errors and save resources.
5070
# Since standards job is a part of initial checks it's not present as direct dependency here!!!!!!!!!!!!!!!!!!!!
51-
pull_request_trigger:
52-
name: Pull Request Trigger (develop, develop-2.0.0, & release branches)
71+
pr_code_changes_checks:
72+
name: Code changes PR checks
5373
# Run the following tests on a selection of different desktop platforms
5474
dependencies:
5575
# Run package EditMode and Playmode package tests on trunk and an older supported editor (6000.0)
@@ -65,18 +85,31 @@ pull_request_trigger:
6585
- .yamato/desktop-standalone-tests.yml#desktop_standalone_test_testproject_win_il2cpp_6000.0
6686
- .yamato/cmb-service-standalone-tests.yml#cmb_service_standalone_test_testproject_ubuntu_il2cpp_trunk
6787
triggers:
68-
# 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
69-
# TODO: consider setting up and running tests from Examples/
70-
# TODO: or docs only changes are spelling/link check
7188
expression: |-
72-
pull_request.comment eq "ngo" OR
73-
((pull_request.target eq "develop" OR
89+
(pull_request.comment eq "ngo" OR
90+
(pull_request.target eq "develop" OR
7491
pull_request.target eq "develop-2.0.0" OR
75-
pull_request.target match "release/*") AND
92+
pull_request.target match "release/*")) AND
7693
NOT pull_request.draft AND
77-
(pull_request.changes.any match "com.unity.netcode.gameobjects/**" OR
78-
pull_request.changes.any match "testproject/**"))
94+
pull_request.changes.any match [
95+
"com.unity.netcode.gameobjects/Editor/**",
96+
"com.unity.netcode.gameobjects/Runtime/**",
97+
"com.unity.netcode.gameobjects/Tests/**",
98+
"testproject/**",
99+
"com.unity.netcode.gameobjects/package.json"
100+
] AND
101+
NOT pull_request.changes.all match [
102+
"**/Documentation~/**",
103+
"**/InternalDocs~/**",
104+
"**/*.md"
105+
]
79106
cancel_old_ci: true
107+
108+
109+
110+
111+
112+
80113

81114
# Run all tests on trunk on nightly basis.
82115
# Same subset as pull_request_trigger with addition of mobile/desktop/console tests and webgl builds

.yamato/ngo-publish.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ngo_release_preparation:
2+
name: "NGO release preparation"
3+
agent: { type: Unity::VM, flavor: b1.small, image: package-ci/ubuntu-22.04:v4 }
4+
triggers:
5+
recurring:
6+
- branch: develop-2.0.0 # We make new releases from this branch
7+
frequency: weekly # Run at some point every Saturday. Note that it's restricted to every 4th Saturday inside the script
8+
rerun: always
9+
commands:
10+
- pip install PyGithub
11+
- pip install GitPython
12+
- python Tools/scripts/ReleaseAutomation/run_release_preparation.py

.yamato/package-pack.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ package_pack_-_ngo_{{ platform.name }}:
3737
variables:
3838
XRAY_PROFILE: "gold ./pvpExceptions.json"
3939
commands:
40-
- python Tools/scripts/release.py # Needed to ensure that CHANGELOG is properly formatted for this test due to the fact that we have bumped package version (to properly perform vetting tests)
4140
- upm-pvp pack "com.unity.netcode.gameobjects" --output upm-ci~/packages
4241
- upm-pvp xray --packages "upm-ci~/packages/com.unity.netcode.gameobjects*.tgz" --results pvp-results
4342
- upm-pvp require {% if platform.name == "win" %}"%XRAY_PROFILE%"{% else %}"$XRAY_PROFILE"{% endif %} --results pvp-results --allow-missing
@@ -48,4 +47,4 @@ package_pack_-_ngo_{{ platform.name }}:
4847
packages:
4948
paths:
5049
- "upm-ci~/**"
51-
{% endfor -%}
50+
{% endfor -%}

.yamato/vetting-test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
{% metadata_file .yamato/project.metafile %} # All configuration that is used to create different configurations (used in for loops) is taken from this file.
22
---
33
# DESCRIPTION--------------------------------------------------------------------------
4-
# This configuration defines vetting tests for the Tools package which allows to validate if the package is in releasable state. This is important in particular because of API validation that allows to detect if we are introducing any new APIs that will force us to bump package version to new minor
4+
# This configuration defines vetting tests for the NGO package which allows to validate if the package is in releasable state. This is important in particular because of API validation that allows to detect if we are introducing any new APIs that will force us to bump package version to new minor
55
# If this test fails with new API error we should either make those API internal OR bump package version to new minor (note that the package version reflects the current package state)
66

77
# Note that we are packing the package only (no project context) so if package have any soft dependencies then project should be used to test it (to enable those APIs)
88
{% for editor in validation_editors.minimal -%}
99
vetting_test:
10-
name: MP Tools - Vetting Test (Win, {{editor}} LTS)
10+
name: NGO - Vetting Test (Win, {{editor}} LTS)
1111
agent: { type: Unity::VM, flavor: b1.large, image: package-ci/win11:v4 }
1212
commands:
13-
- python Tools/scripts/release.py # Needed to ensure that CHANGELOG is properly formatted for this test
1413
- npm install -g "upm-ci-utils@stable" --registry https://artifactory.prd.it.unity3d.com/artifactory/api/npm/upm-npm
1514
- unity-downloader-cli --fast --wait --unity-version {{ editor }} --components editor --arch x64
1615
- upm-ci package pack --package-path com.unity.netcode.gameobjects
@@ -22,4 +21,4 @@ vetting_test:
2221
- test-results/**
2322
- upm-ci~/test-results/**
2423
- upm-ci~/upm-ci.log
25-
{% endfor -%}
24+
{% endfor -%}

.yamato/wrench/api-validation-jobs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ api_validation_-_netcode_gameobjects_-_6000_0_-_windows:
1313
type: Unity::VM
1414
flavor: b1.large
1515
commands:
16-
- command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-68_53c92d3b34ce3f4b652c9785dd1530bdc5885f6523465d6969c3be91f9ccaaf1.zip -o wrench-localapv.zip
16+
- command: curl https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-2-72_a4dd85cf1f7f298f0ad40b6cddfe56a92ed54d408f336c1688069ca743ea46fb.zip -o wrench-localapv.zip
1717
- command: 7z x -aoa wrench-localapv.zip
1818
- command: pip install semver requests --index-url https://artifactory-slo.bf.unity3d.com/artifactory/api/pypi/pypi/simple
1919
- command: python PythonScripts/print_machine_info.py
@@ -51,8 +51,8 @@ api_validation_-_netcode_gameobjects_-_6000_0_-_windows:
5151
dependencies:
5252
- path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects
5353
variables:
54-
UPMPVP_CONTEXT_WRENCH: 1.1.1.0
54+
UPMPVP_CONTEXT_WRENCH: 1.1.3.0
5555
metadata:
5656
Job Maintainers: '#rm-packageworks'
57-
Wrench: 1.1.1.0
57+
Wrench: 1.1.3.0
5858

.yamato/wrench/package-pack-jobs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ package_pack_-_netcode_gameobjects:
2424
UPMCI_ACK_LARGE_PACKAGE: 1
2525
metadata:
2626
Job Maintainers: '#rm-packageworks'
27-
Wrench: 1.1.1.0
27+
Wrench: 1.1.3.0
2828

0 commit comments

Comments
 (0)