Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 59 additions & 2 deletions .yamato/project-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

# TECHNICAL CONSTRAINTS---------------------------------------------------------------
# Requires .NET SDK installed (should be preinstalled on the image so we just check for version)
# The SDK version is pinned in the repo-root global.json so `dotnet format` uses the same Roslyn
# formatter locally and in CI. Feature-band differences (e.g. 10.0.2xx vs 10.0.3xx) produce different
# whitespace/style results, which caused CI failures that could not be reproduced locally. If the
# image SDK changes, update global.json to match or `dotnet --version` below will fail fast.
# Needs Unity Editor for solution synchronization
# Uses custom standards validation tool (netcode.standards)
# Generates no test artifacts (pass/fail only). Eventual failure will be visible in the logs
Expand All @@ -41,15 +45,68 @@ standards_{{ platform.name }}_{{ project.name }}_{{ editor }}:
model: {{ platform.model }} # This is set only in platforms where we want non-default model to use (more information in project.metafile)
{% endif %}
commands:
# .NET environment setup. Ensures required .NET SDK and formatting tools are available
# .NET environment setup. Ensures required .NET SDK and formatting tools are available.
# These run from the repo root so the global.json pin applies; a missing pinned SDK fails here.
- dotnet --version
- dotnet format --version

- unity-downloader-cli --fast --wait -u {{ editor }} -c editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # For macOS we use ARM64 models. Downloads basic editor
- .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ project.path }} -quit # This command is used to invoke Unity in a "headless" mode. It's used to sync the project
- dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix # Auto-fix formatting issues
- git checkout -- {{ project.path }}/Packages/manifest.json {{ project.path }}/Packages/packages-lock.json {{ project.path }}/ProjectSettings/ProjectVersion.txt 2>/dev/null || true # Restore files that Unity may have modified (we only want to check code formatting)
- 'git diff --exit-code || (echo "ERROR: Code formatting issues found. Run dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix locally and commit the changes." && exit 1)' # Fail if formatter made any changes
- 'git diff --exit-code || (echo "ERROR: Code formatting issues found. Fix by EITHER running locally: dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix (then commit), OR triggering the standards_fix_and_push job in Yamato on this branch to auto-fix and push the changes." && exit 1)' # Fail if formatter made any changes
{% endfor -%}
{% endfor -%}
{% endfor -%}

# AUTO-FIX & PUSH JOB-----------------------------------------------------------------
# This job is intentionally NOT wired into any trigger pipeline (see _triggers.yml / _run-all.yml).
# It is meant to be run MANUALLY from Yamato against the branch that has a failing standards check.
# It runs the SAME `netcode.standards --fix` the check job runs (for every project), then commits
# and pushes the resulting formatting changes back to that branch so the standards check passes.
# It exists because fixing locally requires a matching installed editor + SyncSolution + the pinned
# SDK (global.json); this job removes that setup burden.
# Pushing reuses NETCODE_GITHUB_TOKEN (same token as the release automation in ngo-publish.yml).
# LIMITATION: cannot push to pull requests opened from forks (no write access to fork branches);
# those still need the local --fix workflow. Protected branches will reject the push by design.
#------------------------------------------------------------------------------------

{% for platform in test_platforms.default -%}
{% for editor in validation_editors.default -%}
standards_fix_and_push_{{ platform.name }}_{{ editor }}:
name: Standards Fix and Push - NGO (all projects) [{{ platform.name }}, {{ editor }}]
agent:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor }}
{% if platform.model %}
model: {{ platform.model }}
{% endif %}
commands:
- dotnet --version
- dotnet format --version
- unity-downloader-cli --fast --wait -u {{ editor }} -c editor {% if platform.name == "mac" %} --arch arm64 {% endif %} # Downloads basic editor
{% for project in projects.all %}
- .Editor/Unity -batchmode -nographics -logFile - -executeMethod Packages.Rider.Editor.RiderScriptEditor.SyncSolution -projectPath {{ project.path }} -quit # Sync solution so csproj references resolve (required by the style pass)
- dotnet run --project=dotnet-tools/netcode.standards -- --project={{ project.path }} --fix # Auto-fix formatting issues
- git checkout -- {{ project.path }}/Packages/manifest.json {{ project.path }}/Packages/packages-lock.json {{ project.path }}/ProjectSettings/ProjectVersion.txt 2>/dev/null || true # Restore files Unity may have modified
{% endfor %}
- |
if [ -z "$(git status --porcelain)" ]; then
echo "No formatting changes to push; branch already conforms to standards."
exit 0
fi
if [ -z "$NETCODE_GITHUB_TOKEN" ]; then
echo "ERROR: NETCODE_GITHUB_TOKEN is not set; cannot push fixes." && exit 1
fi
if [ -z "$GIT_BRANCH" ]; then
echo "ERROR: GIT_BRANCH is not set; run this job against a branch, not a detached revision." && exit 1
fi
git config user.name "netcode-automation"
git config user.email "svc-netcode-sdk@unity3d.com"
git add -A
git commit -m "Apply netcode.standards formatting fixes"
git remote set-url origin "https://x-access-token:${NETCODE_GITHUB_TOKEN}@github.com/Unity-Technologies/com.unity.netcode.gameobjects.git"
git push origin "HEAD:${GIT_BRANCH}"
{% endfor -%}
{% endfor -%}
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ads": "4.4.2",
"com.unity.ai.navigation": "2.0.9",
"com.unity.ads": "4.16.4",
"com.unity.ai.navigation": "2.0.12",
"com.unity.analytics": "3.8.1",
"com.unity.collab-proxy": "2.10.0",
"com.unity.collab-proxy": "2.12.4",
"com.unity.feature.development": "1.0.2",
"com.unity.ide.rider": "3.0.38",
"com.unity.ide.visualstudio": "2.0.25",
"com.unity.ide.rider": "3.0.39",
"com.unity.ide.visualstudio": "2.0.27",
"com.unity.multiplayer.center": "1.0.0",
"com.unity.netcode.gameobjects": "https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#develop-2.0.0",
"com.unity.purchasing": "4.12.2",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed across projects as this version was deprecated (+ I don't think we need this package)

"com.unity.services.multiplayer": "1.2.0",
"com.unity.test-framework": "1.6.0",
"com.unity.timeline": "1.8.9",
"com.unity.timeline": "1.8.10",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.10",
"com.unity.transport": "2.6.0",
"com.unity.transport": "2.7.2",
"com.unity.ugui": "2.0.0",
"com.unity.visualscripting": "1.9.7",
"com.unity.visualscripting": "1.9.11",
"com.unity.xr.legacyinputhelpers": "2.1.12",
"com.unity.modules.accessibility": "1.0.0",
"com.unity.modules.ai": "1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@
}
},
"com.unity.ads": {
"version": "4.4.2",
"version": "4.16.4",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
"com.unity.ugui": "1.0.0",
"com.unity.modules.androidjni": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.ai.navigation": {
"version": "2.0.9",
"version": "2.0.12",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -44,7 +45,7 @@
"url": "https://packages.unity.com"
},
"com.unity.burst": {
"version": "1.8.25",
"version": "1.8.28",
"depth": 1,
"source": "registry",
"dependencies": {
Expand All @@ -54,21 +55,21 @@
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "2.10.0",
"version": "2.12.4",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.collections": {
"version": "2.6.2",
"version": "2.6.5",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.burst": "1.8.23",
"com.unity.burst": "1.8.27",
"com.unity.mathematics": "1.3.2",
"com.unity.test-framework": "1.4.6",
"com.unity.nuget.mono-cecil": "1.11.5",
"com.unity.nuget.mono-cecil": "1.11.6",
"com.unity.test-framework.performance": "3.0.3"
},
"url": "https://packages.unity.com"
Expand All @@ -91,16 +92,16 @@
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.ide.visualstudio": "2.0.25",
"com.unity.ide.rider": "3.0.38",
"com.unity.ide.visualstudio": "2.0.27",
"com.unity.ide.rider": "3.0.39",
"com.unity.editorcoroutines": "1.0.1",
"com.unity.performance.profile-analyzer": "1.2.4",
"com.unity.performance.profile-analyzer": "1.3.3",
"com.unity.test-framework": "1.6.0",
"com.unity.testtools.codecoverage": "1.2.7"
"com.unity.testtools.codecoverage": "1.3.0"
}
},
"com.unity.ide.rider": {
"version": "3.0.38",
"version": "3.0.39",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -109,11 +110,11 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.25",
"version": "2.0.27",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.31"
"com.unity.test-framework": "1.1.33"
},
"url": "https://packages.unity.com"
},
Expand Down Expand Up @@ -143,7 +144,7 @@
"hash": "37bdf528127a9ae3e104d76b9a13343bffd653cb"
},
"com.unity.nuget.mono-cecil": {
"version": "1.11.5",
"version": "1.11.6",
"depth": 1,
"source": "registry",
"dependencies": {},
Expand All @@ -157,38 +158,25 @@
"url": "https://packages.unity.com"
},
"com.unity.performance.profile-analyzer": {
"version": "1.2.4",
"version": "1.3.3",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.purchasing": {
"version": "4.12.2",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.services.core": "1.12.5",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.services.analytics": {
"version": "6.1.0",
"version": "6.3.0",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.services.core": "1.12.4",
"com.unity.services.core": "1.16.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.services.authentication": {
"version": "3.5.1",
"version": "3.6.0",
"depth": 1,
"source": "registry",
"dependencies": {
Expand All @@ -200,7 +188,7 @@
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.15.1",
"version": "1.16.0",
"depth": 1,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -258,7 +246,7 @@
"url": "https://packages.unity.com"
},
"com.unity.services.wire": {
"version": "1.4.0",
"version": "1.4.2",
"depth": 1,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -302,7 +290,7 @@
}
},
"com.unity.test-framework.performance": {
"version": "3.2.0",
"version": "3.3.0",
"depth": 2,
"source": "registry",
"dependencies": {
Expand All @@ -312,17 +300,17 @@
"url": "https://packages.unity.com"
},
"com.unity.testtools.codecoverage": {
"version": "1.2.7",
"version": "1.3.0",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.0.16",
"com.unity.settings-manager": "1.0.1"
"com.unity.test-framework": "1.4.5",
"com.unity.settings-manager": "2.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.8.9",
"version": "1.8.10",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -344,7 +332,7 @@
"url": "https://packages.unity.com"
},
"com.unity.transport": {
"version": "2.6.0",
"version": "2.7.2",
"depth": 0,
"source": "registry",
"dependencies": {
Expand All @@ -364,7 +352,7 @@
}
},
"com.unity.visualscripting": {
"version": "1.9.7",
"version": "1.9.11",
"depth": 0,
"source": "registry",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
m_EditorVersion: 6000.0.61f1
m_EditorVersionWithRevision: 6000.0.61f1 (74a0adb02c31)
m_EditorVersion: 6000.0.72f1
m_EditorVersionWithRevision: 6000.0.72f1 (b731fd3ae857)
17 changes: 8 additions & 9 deletions Examples/OverridingScenesAndPrefabs/Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ads": "4.4.2",
"com.unity.ai.navigation": "2.0.9",
"com.unity.ads": "4.16.4",
"com.unity.ai.navigation": "2.0.12",
"com.unity.analytics": "3.8.1",
"com.unity.collab-proxy": "2.10.0",
"com.unity.collab-proxy": "2.12.4",
"com.unity.feature.development": "1.0.2",
"com.unity.ide.rider": "3.0.38",
"com.unity.ide.visualstudio": "2.0.25",
"com.unity.ide.rider": "3.0.39",
"com.unity.ide.visualstudio": "2.0.27",
"com.unity.multiplayer.center": "1.0.0",
"com.unity.netcode.gameobjects": "https://github.com/Unity-Technologies/com.unity.netcode.gameobjects.git?path=com.unity.netcode.gameobjects#develop-2.0.0",
"com.unity.purchasing": "4.12.2",
"com.unity.services.multiplayer": "1.2.0",
"com.unity.test-framework": "1.6.0",
"com.unity.timeline": "1.8.9",
"com.unity.timeline": "1.8.10",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.10",
"com.unity.transport": "2.6.0",
"com.unity.transport": "2.7.2",
"com.unity.ugui": "2.0.0",
"com.unity.visualscripting": "1.9.7",
"com.unity.visualscripting": "1.9.11",
"com.unity.xr.legacyinputhelpers": "2.1.12",
"com.unity.modules.accessibility": "1.0.0",
"com.unity.modules.ai": "1.0.0",
Expand Down
Loading