Skip to content

ci: fixing issues around Standards check#4089

Open
michalChrobot wants to merge 9 commits into
develop-2.0.0from
standards-check-fix
Open

ci: fixing issues around Standards check#4089
michalChrobot wants to merge 9 commits into
develop-2.0.0from
standards-check-fix

Conversation

@michalChrobot

@michalChrobot michalChrobot commented Jul 16, 2026

Copy link
Copy Markdown
Member

Purpose of this PR

The Standards Check CI job was failing on formatting that could not be reproduced or fixed locally (EXAMPLE). Investigation found 2 independent causes:

  1. Unpinned .NET SDK. The job runs dotnet format, whose Roslyn formatter behaves differently across SDK feature bands (e.g. 10.0.2xx vs 10.0.3xx). CI and local machines floated to whatever SDK was installed, so the same code formatted differently in each place.
  2. No easy local fix path. Reproducing CI requires a matching installed editor + SyncSolution (so the generated .csproj reference paths resolve) and the right SDK. Without a complete editor install the style pass silently loads no references and reports a false "no issues", while stale .csproj HintPaths (pointing at an uninstalled editor) produce Required references did not load.

Usually what was happening is that you could see that CI used 6000.3 editor and 10.0.300 dotnet sdk version while I was using 10.0.230 and 6000.0 editor so standards run could generate different results

Changes

  1. I aligned all our projects to one "minimal supported" editor
  2. I added global.json which pins the .NET SDK to the 10.0.3xx feature band (rollForward: latestPatch) so dotnet format uses the same Roslyn formatter locally and in CI.
  • If you will try to run dotnet format but you won't have proper .NET SDK then it will fail telling you what to do\
  • If CI will get updated with newer version of .NET then the job will fail and we should update this pin accordingly

Since this may be a bit time consuming and annoying I also added a dedicated standards_fix_and_push Yamato job. This is a dedicated, manually-run job** (intentionally not wired into any trigger pipeline). It runs the same netcode.standards --fix the check runs, for every project, then commits and pushes the formatting result back to the branch so the check passes. This removes the local editor/SDK setup burden.
How one should use it is if you see standards failure and you are sure you want to apply all changes then you can just run that job from CI

Jira ticket

N/A

Documentation

N/A

Testing & QA (How your changes can be verified during release Playtest)

Tested on ... changes that now are being fixed locally correctly

Backports

N/A

@michalChrobot michalChrobot self-assigned this Jul 16, 2026
@michalChrobot

Copy link
Copy Markdown
Member Author

I could also just automatically push fixes via usual Standards job but then devs wouldn't have control over it. I guess there may be some cases where you wouldn't want to push everything as the job says?

"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)

@michalChrobot

michalChrobot commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

Example results of queued job are in 9134d7e

@michalChrobot michalChrobot marked this pull request as ready for review July 16, 2026 12:56
@codecov-github-com

codecov-github-com Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

@@                Coverage Diff                @@
##           develop-2.0.0    #4089      +/-   ##
=================================================
+ Coverage          66.39%   66.45%   +0.06%     
=================================================
  Files                163      163              
  Lines              24999    24999              
=================================================
+ Hits               16597    16614      +17     
+ Misses              8402     8385      -17     
Flag Coverage Δ
NGOv2_ubuntu_6000.3 66.45% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 4 files with indirect coverage changes

Components Coverage Δ
com.unity.netcode.gameobjects 66.45% <ø> (+0.06%) ⬆️

ℹ️ Need help interpreting these results?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants