Skip to content

chore: Add Unity 6000.5 package compile compatibility check#1840

Merged
hatayama merged 25 commits into
v3-betafrom
feature/unity-6000-5-compile-check
Jul 19, 2026
Merged

chore: Add Unity 6000.5 package compile compatibility check#1840
hatayama merged 25 commits into
v3-betafrom
feature/unity-6000-5-compile-check

Conversation

@hatayama

@hatayama hatayama commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Detect Unity 6000.5 package compilation incompatibilities before v3-beta merges.
  • Keep the minimum supported Unity 2022.3 compile check running alongside the new compatibility check.

User Impact

  • Pull requests now verify package compilation against both Unity 2022.3.62f1 and Unity 6000.5.4f1.
  • Unity 6000.5 dependency-resolution failures and package compiler errors fail the check instead of being silently skipped.

Changes

  • Added a minimal Unity 6000.5 fixture project that references the package through its repository-relative path.
  • Converted the compile workflow to a versioned matrix with separate project paths, Library caches, and unit-test execution.
  • Scoped Unity 6000.5 diagnostics to package sources while preserving the existing 2022.3 diagnostic scope.
  • Added package assembly evidence validation and stale ScriptAssemblies purging so dependency resolution failures cannot produce a false green result.
  • Added direct Unity 6000.5 container execution with derived serial activation, controlled log-file capture, and guaranteed license return.
  • Added Unity version compatibility adapters and overload branches for Unity 6000.5 obsolete API diagnostics while preserving the existing integer wire contract.
  • Opened follow-up issue Migrate object handles from int to opaque EntityId values #1841 for migrating object handles to an opaque EntityId-compatible wire contract.

Verification

  • Ruby YAML parser: passed.
  • Fixture relative-path resolution: passed; it resolves to Packages/src.
  • Change-detection pattern: passed for C# and fixture files and rejected .csv input.
  • Final PR CI run 29677617670: both Compile Check (2022.3.62f1) and Compile Check (6000.5.4f1) passed.
  • The 6000.5 log showed successful license activation, 37 package assemblies, package compilation evidence, and zero scoped errors/warnings.
  • Full gh pr checks 1840 passed, including package tests, CLI build, security analysis, and complexity checks.
  • actionlint: not run because it is not installed locally.

Run package compilation checks against both the minimum supported Unity version and Unity 6000.5 so incompatible APIs and dependency resolution failures are detected before v3-beta merges.\n\nUse an isolated Unity 6000.5 fixture, version-specific Library caches, and package-scoped diagnostics while preserving the existing 2022.3 checks and required-status skip behavior.
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request adds Unity 6.0.4+ API and object-identifier compatibility, expands Unity compile checks into a version matrix, improves diagnostic log validation, and registers the 6000.5 project against the local package source.

Changes

Unity compatibility and validation

Layer / File(s) Summary
Matrix-based Unity compile validation
.github/workflows/unity-compile-check-and-test-runner.yml, ci/unity-projects/6000.5/Packages/manifest.json
Compile checks run across configured Unity versions with version-specific paths, caching, tests, build logs, package diagnostics, and local package registration.
Unity version-specific API calls
Packages/src/Editor/FirstPartyTools/Common/..., Packages/src/Editor/FirstPartyTools/Screenshot/UIElementAnnotator.cs, Packages/src/Editor/FirstPartyTools/SimulateMouseUi/..., Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/...
Unity 6.0.4+ uses updated object-discovery overloads, older versions retain compatible calls, and a warning is suppressed around AssemblyBuilder construction.
Version-compatible object identifiers
Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs, Packages/src/Editor/FirstPartyTools/PausePoint/..., Packages/src/Editor/FirstPartyTools/Screenshot/RaycastAnnotation/...
UnityObjectIdentifier.GetInstanceId provides version-specific handles for classification, formatting, and raycast clustering.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: adding a Unity 6000.5 package compile compatibility check.
Description check ✅ Passed The description accurately covers the workflow, Unity 6000.5 fixture, diagnostics, and compatibility updates in the changeset.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/unity-6000-5-compile-check

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously requested changes Jul 19, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Packages/src/Editor/FirstPartyTools/Screenshot/UIElementAnnotator.cs`:
- Around line 125-129: Update the UNITY_6000_4_OR_NEWER branch in the
allBehaviours initialization to call Object.FindObjectsByType<MonoBehaviour>
with FindObjectsSortMode.None. Leave the legacy
Object.FindObjectsOfType<MonoBehaviour>() branch unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a1dc12c6-2daf-437e-848d-c69d9e9aa7ee

📥 Commits

Reviewing files that changed from the base of the PR and between c7c650e and 7517f01.

⛔ Files ignored due to path filters (3)
  • Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs.meta is excluded by none and included by none
  • ci/unity-projects/6000.5/Assets/.gitkeep is excluded by none and included by none
  • ci/unity-projects/6000.5/ProjectSettings/ProjectVersion.txt is excluded by none and included by none
📒 Files selected for processing (11)
  • .github/workflows/unity-compile-check-and-test-runner.yml
  • Packages/src/Editor/FirstPartyTools/Common/MouseUi/UiRaycastHelper.cs
  • Packages/src/Editor/FirstPartyTools/Common/Overlay/OverlayCanvasFactory.cs
  • Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/DynamicCompilation/AssemblyBuilderFallbackCompilerBackend.cs
  • Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointUnityObjectClassifier.cs
  • Packages/src/Editor/FirstPartyTools/PausePoint/SourcePausePointVariableFormatter.cs
  • Packages/src/Editor/FirstPartyTools/Screenshot/RaycastAnnotation/RaycastGridAnnotator.cs
  • Packages/src/Editor/FirstPartyTools/Screenshot/UIElementAnnotator.cs
  • Packages/src/Editor/FirstPartyTools/SimulateMouseUi/MouseUiPointerTargetResolver.cs
  • Packages/src/Editor/ToolContracts/UnityObjectIdentifier.cs
  • ci/unity-projects/6000.5/Packages/manifest.json

hatayama added 14 commits July 19, 2026 15:17
Print the controlled Unity log tail before failing the strict 6000.5 package evidence assertion so direct-editor failures can be diagnosed from CI output.
The UNITY_LICENSE secret contains machine-bound DeveloperData, so direct .ulf placement fails on GitHub-hosted runners. Derive the personal serial inside the container, activate with the existing credentials, compile the fixture, and return the license on every exit.
The base image does not include the builder's BlankProject directory. Reuse the checked-in fixture for activation and license return so the direct 6000.5 container reaches the actual compilation command.
grep already prints a zero count when no diagnostics match; suppressing only its nonzero exit status keeps the count numeric and removes misleading integer-expression warnings from the 6000.5 check.
Use the image-local blank project for activation and license return so project compiler failures do not consume activation retries or hide the controlled fixture log.
@hatayama
hatayama dismissed coderabbitai[bot]’s stale review July 19, 2026 07:42

Dismissing: the finding is factually incorrect. The parameterless Object.FindObjectsByType() overload exists since Unity 6000.4 (UnityCsReference Runtime/Export/Scripting/UnityEngineObject.bindings.cs), and the 6000.5 CI compile leg in this PR compiled this exact call with 0 errors / 0 warnings (run 29677617670).

@hatayama
hatayama merged commit 8454000 into v3-beta Jul 19, 2026
11 checks passed
@hatayama
hatayama deleted the feature/unity-6000-5-compile-check branch July 19, 2026 08:23
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.

1 participant