Skip to content

chore: editor namespace auto upgrade - #4142

Open
NoelStephensUnity wants to merge 13 commits into
develop-3.x.xfrom
chore/editor-namespace-auto-upgrade
Open

chore: editor namespace auto upgrade#4142
NoelStephensUnity wants to merge 13 commits into
develop-3.x.xfrom
chore/editor-namespace-auto-upgrade

Conversation

@NoelStephensUnity

Copy link
Copy Markdown
Member

Purpose of this PR

This PR handles the auto-upgrade namespace change from Unity.Netcode.Editor to Unity.Netcode.GameObjects.Editor.
It also includes a job that can be manually triggered to validate the auto-upgrade or the job itself could be added to nightly or the like.

Jira ticket

MTT-15570

Changelog

NA

Documentation

  • No documentation changes or additions were necessary.

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

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated test

Does the change require QA team to:

  • Review automated tests?
    • Currently, it is only wired into the comment trigger ("apiupdater").
    • @michalChrobot Feel free to adjust this if you want it to automatically run under specific conditions.
  • 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

None

Backports

None

marking all unity.netcode.editor public API as having moved to a new namespace in order to auto-upgrade users.
Adding a project verification test that can be triggered by typing "apiupdater" as a comment.
The project added verifies that the entire public API within the unity.netcode.editor namespace is auto-upgraded without compilation errors.
@NoelStephensUnity
NoelStephensUnity requested review from a team and EmandM as code owners August 24, 2026 20:29

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Harness Review

Needs changes

The relocation metadata covers the unconditional public editor API, but the new validation harness has a configuration-specific coverage gap and cannot be run reliably from paths containing spaces.

Reviewed commit dcf9a26

🤖 Helpful? 👍/👎

Comment thread apiupdaterproject/run-upgrade-test.ps1 Outdated
Comment thread apiupdaterproject/run-upgrade-test.ps1 Outdated
Removed obsolete custom property drawer for NetworkObject.OwnershipStatus.
Handling paths with spaces.
Remove this too as we don't need that work around.
Comment thread apiupdaterproject/.gitignore
Comment thread apiupdaterproject/run-upgrade-test.ps1 Outdated
@@ -0,0 +1,121 @@
# API updater upgrade-path project

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This README has too much info. The README from this project doesn't need info on how the upgrade was implemented, it just needs info on how it works.

If you want this project to be used also for future upgrades then this README shouldn't have any references to the 2.x -> 3.x upgrade specifically, otherwise future us might think we can pull this project out once that upgrade is released.

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.

This project and the tests associated with it will not be pertinent once v2.x.x becomes deprecated.
But I can remove the extra info...leaving it only provides the context as to why it is there in the first place.

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.

This should be much more straight forward now.

Comment thread apiupdaterproject/Packages/manifest.json
@codecov-github-com

codecov-github-com Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

@@                Coverage Diff                @@
##           develop-3.x.x    #4142      +/-   ##
=================================================
+ Coverage          78.00%   78.01%   +0.01%     
=================================================
  Files                153      153              
  Lines              26260    26260              
=================================================
+ Hits               20483    20486       +3     
+ Misses              5777     5774       -3     
Flag Coverage Δ
NGOv2_project_testproject_ubuntu_pinnedTrunk 77.73% <ø> (?)

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

see 1 file with indirect coverage changes

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

ℹ️ Need help interpreting these results?

@NoelStephensUnity
NoelStephensUnity marked this pull request as draft August 25, 2026 20:13
Adjusting README to be less verbose.
Adding agent.md file to keep context.
Correction... making a single PYTHON script that stays in alignment with our CI scripting language usage.
@NoelStephensUnity

Copy link
Copy Markdown
Member Author

/ci apiupdater

Fixing issue with path
@NoelStephensUnity

Copy link
Copy Markdown
Member Author

/ci apiupdater

Project version correction.
Removal of 600.7.0a5 injected assemblies.
Updating agent knowledge.
@NoelStephensUnity

Copy link
Copy Markdown
Member Author

/ci apiupdater

Clearing out some of the verbosity.
@NoelStephensUnity
NoelStephensUnity marked this pull request as ready for review August 26, 2026 00:26
@NoelStephensUnity

Copy link
Copy Markdown
Member Author

/ci apiupdater

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Harness Review

Needs changes

The relocation metadata covers the current public editor surface, but the new validation workflow can report a successful upgrade without supplying any legacy source to upgrade.

Reviewed commit 341cf66

🤖 Helpful? 👍/👎

print(f"Project: {PROJECT_PATH}")

backup_dir = tempfile.mkdtemp(prefix='ngo-apiupdater-')
copy_flat(SOURCE_DIR, backup_dir)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1

After a documented run with --keep-updated-sources, this directory contains only the rewritten 3.x sources. A subsequent invocation backs up those already-updated files here, invokes Unity with no legacy references to migrate, and assert_rewritten() returns PASS because it only requires new names to be present and old names absent. That makes a repeat of the documented inspection command a false-positive upgrade validation. Validate that the pre-run fixtures contain the expected legacy references (or restore a canonical legacy fixture before each run), even when keeping the output.

🤖 Helpful? 👍/👎

removing conflicting text.
@NoelStephensUnity

Copy link
Copy Markdown
Member Author

/ci apiupdater

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