chore: asmdef guid references - #4152
Conversation
Three asmdefs named "Unity.NetCode" and "Unity.NetCode.Editor" as strings. Unity silently drops an asmdef reference it cannot resolve, so renaming either assembly would make every UNIFIED_NETCODE code path fail to compile with nothing pointing at the cause. A GUID reference resolves to whichever asmdef asset carries that GUID regardless of the name inside it, which is how NGO's own editor assembly rename stayed transparent to projects referencing it. The GUIDs are read from the installed package's .asmdef.meta files, not derived: Unity.NetCode 953adc2a6b8b4e3c8df5b728bcd546e9 Unity.NetCode.Editor eb8cf780bf058694ebf7ec5cf5b8cfa3 Unity.Entities is left by name. It is not the assembly at risk of a rename, and converting it would add surface that cannot be checked here for no benefit. Not verified locally: confirming a GUID reference resolves needs an editor with both packages installed. Worth an import in a project that has Netcode for Entities before this is relied on - if a GUID is wrong the reference drops silently, which is the failure this is meant to prevent.
The last of the three type names NGO and Netcode for Entities share. This one is internal, so no user sees it and it is not a compile error either way: a source-declared type beats an imported one, so NGO's own assembly would take its own and warn CS0436. But once the two namespaces converge the warning appears in our build log for a name nobody can act on from outside, and "Unity.Netcode holds no name that collides" is a simpler thing to be able to say than "two of the three". ToolsNetworkMetrics keeps the suffix, so it still reads as a pair with its sibling NullNetworkMetrics - the two INetworkMetrics implementations, one behind MULTIPLAYER_TOOLS and one not. Five sites in two files: the declaration, both constructors, the profiler marker and the single construction site. Everything else that reads NetworkMetrics is a property of that name on NetworkManager, NetworkMetricsManager or NetworkTransport, all typed INetworkMetrics and untouched. The profiler marker keeps its old string rather than following the rename. It is what shows up in the Profiler, and an internal rename is not a reason to move it, so nameof gives way to the literal with a comment saying why. Verified as far as this machine allows: runtime, editor and runtime tests all compile clean, which covers the #else branch. The renamed class is entirely inside #if MULTIPLAYER_TOOLS and the harness has no Unity.Multiplayer.Tools references, so that branch cannot be built here. A parse pass over the file with the define on reports only CS0246/CS0234 for the tools types and no structural error, which is what a class and constructor disagreeing on a name would produce. The define-on path still wants a real editor build before this is trusted.
|
/ci unified |
There was a problem hiding this comment.
💡 Harness Review
The metrics implementation rename is consistently guarded and its interface-facing consumers remain unchanged; the assembly references were updated only where the optional unified Netcode integration is declared. I examined the concrete-type usages, conditional compilation paths, profiler marker, and the affected assembly definitions and project manifests.
Reviewed commit 46223c5
🤖 Helpful? 👍/👎
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop-3.x.x #4152 +/- ##
=================================================
+ Coverage 78.01% 78.25% +0.24%
=================================================
Files 153 154 +1
Lines 26260 26543 +283
=================================================
+ Hits 20486 20771 +285
+ Misses 5774 5772 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes
|
michalChrobot
left a comment
There was a problem hiding this comment.
LGTM, I don't fully understand why we should use GUID instead of usual naming in the asmdef but we can clarify on call
Purpose of this PR
Validating the GUID assembly references for N4E as opposed to the assembly namespaces themselves.
Renames
NetworkMetrics(internal to SDK) toToolsNetworkMetrics.1st pass: run through /ci command to validate the GUIDs.
2nd pass: (If they are correct) Mark for review and merge.
Jira ticket
MTT-15570
Changelog
NA
Documentation
Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Manual testing :
Manual testing doneAutomated tests:
Covered by existing automated testsCovered by new automated testsDoes the change require QA team to:
Review automated tests?Execute manual tests?Provide feedback about the PR?If any boxes above are checked the QA team will be automatically added as a PR reviewer.
Up-port
N/A
Backports
N/A