Skip to content

fix: Shrink the project runner pin schema to two fields#1503

Merged
hatayama merged 2 commits into
v3-betafrom
refactor/shrink-project-runner-pin-schema
Jul 5, 2026
Merged

fix: Shrink the project runner pin schema to two fields#1503
hatayama merged 2 commits into
v3-betafrom
refactor/shrink-project-runner-pin-schema

Conversation

@hatayama

@hatayama hatayama commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

Part 2 of the version-gate consolidation (G4), following #1501. The pin carried four fields no runtime code reads: requiredProtocolVersion (the IPC protocol is checked on the wire, never via the pin), packageName, packageVersion, and schemaVersion. Dead fields invite drift, and each one is an extra release-please stamp or guard to keep consistent. The pin now declares only the two values the dispatcher actually consumes:

{
  "projectRunnerVersion": "...",
  "minimumDispatcherVersion": "..."
}
  • Drop the removed fields from the dispatcher pin struct, its validation, and the release-automation guard, updating fixtures accordingly
  • Remove the two $.packageVersion pin stamps from release-please-config.json
  • Keep the two-pin identity check and the pin-to-contract projectRunnerVersion consistency check

Compatibility note

Dispatchers older than this change reject a pin without schemaVersion, so they need a manual uloop update once a package ships the new pin. This one-time format break is accepted for the pre-release line; from here on the pin format evolves additively only (fields are never deleted or renamed), because the forced-update instruction travels inside the pin.

Validation

  • scripts/check-go-cli.sh, scripts/test-release-please-config.sh, scripts/test-stamp-release-inputs.sh
  • Both pin files remain byte-identical
  • uloop compile: 0 errors / 0 warnings; CliPinSynchronizerTests: 6/6 passed

Review in cubic

…mumDispatcherVersion

The pin carried four fields no runtime code reads: requiredProtocolVersion
(the IPC protocol is checked on the wire, never via the pin), packageName,
packageVersion, and schemaVersion. Dead fields in the pin invite drift and
each one is an extra release-please stamp or guard to keep consistent, so
the pin now declares only the two values the dispatcher actually consumes.

Older dispatchers reject a pin without schemaVersion; this one-time format
break is accepted because pre-release dispatchers are updated manually.

- Drop the removed fields from the dispatcher pin struct, its validation,
  and the release-automation guard, updating fixtures accordingly
- Remove the two $.packageVersion pin stamps from release-please-config.json
- Keep the two-pin identity and pin-to-contract projectRunnerVersion checks
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@hatayama, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b36ad70e-c938-453e-95b0-46dd19dd82ab

📥 Commits

Reviewing files that changed from the base of the PR and between 446742d and 2f3f4a9.

📒 Files selected for processing (2)
  • Assets/Tests/Editor/CliPinSynchronizerTests.cs
  • scripts/test-release-please-config.sh
📝 Walkthrough

Walkthrough

This PR simplifies the project-runner pin JSON schema across Unity assets and Go CLI code, removing schemaVersion, packageName, packageVersion, and requiredProtocolVersion fields while retaining only projectRunnerVersion and minimumDispatcherVersion. Corresponding parsing structs, validation logic, tests, and release-please configuration/scripts are updated to match.

Changes

Project-runner Pin Schema Simplification

Layer / File(s) Summary
Pin JSON fixture files
.uloop/project-runner-pin.json, Packages/src/project-runner-pin.json
Pin files truncated so minimumDispatcherVersion is the final property, removing packageName, packageVersion, requiredProtocolVersion, and schemaVersion.
Dispatcher pin struct and loader validation
cli/dispatcher/internal/dispatcher/dispatcher_pin.go, cli/dispatcher/internal/dispatcher/dispatcher_test.go
dispatcherPin struct retains only projectRunnerVersion; loader no longer checks schemaVersion == 0; tests write minimal pin JSON accordingly.
Release automation minimum version guard
cli/release-automation/internal/automation/dispatcher_minimum_version_guard.go, dispatcher_minimum_version_guard_test.go
dispatcherMinimumVersionCliPin struct reduced to ProjectRunnerVersion; test helper generates matching minimal JSON.
Protocol version consistency contract tests
cli/common/clicontract/protocol_version_consistency_test.go
Removes unityPackageManifest type and manifest path constant; unityPackageCliPin reduced; test validates only projectRunnerVersion alignment.
Unity CliPinSynchronizer tests
Assets/Tests/Editor/CliPinSynchronizerTests.cs
Test fixtures and assertions switched from schemaVersion payloads to projectRunnerVersion payloads for copy, skip-write, and update scenarios.
Release-please config and scripts
release-please-config.json, scripts/test-release-please-config.sh, scripts/test-sync-release-please-package-releases.sh
extra-files for Packages/src now sources version from package.json instead of pin files; script assertions and fixtures updated accordingly.

Estimated code review effort: 2 (Simple) | ~12 minutes

Possibly related PRs

  • hatayama/unity-cli-loop#1412: Both PRs revolve around minimumDispatcherVersion pin/contract compatibility across dispatcher pin JSON validation and automation guard logic.
  • hatayama/unity-cli-loop#1427: Both PRs adjust Unity/project-runner pin handling around the projectRunnerVersion contract and dispatcher pin JSON parsing.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: reducing the project runner pin to two fields.
Description check ✅ Passed The description is directly related to the change and matches the updated pin schema and validation work.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/shrink-project-runner-pin-schema

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 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 `@scripts/test-release-please-config.sh`:
- Line 131: The jq assertion in test_release_please_config is using invalid
syntax for accessing the extra-files array, so the filter fails before length is
checked. Update the assert_json_value call in
scripts/test-release-please-config.sh to use a valid jq path for the
Packages/src package entry and its extra-files field, keeping the existing
length check intact.
🪄 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: 14e0bbb0-f989-4e30-83f5-188ef5c3b8df

📥 Commits

Reviewing files that changed from the base of the PR and between 2012eb8 and 446742d.

📒 Files selected for processing (11)
  • .uloop/project-runner-pin.json
  • Assets/Tests/Editor/CliPinSynchronizerTests.cs
  • Packages/src/project-runner-pin.json
  • cli/common/clicontract/protocol_version_consistency_test.go
  • cli/dispatcher/internal/dispatcher/dispatcher_pin.go
  • cli/dispatcher/internal/dispatcher/dispatcher_test.go
  • cli/release-automation/internal/automation/dispatcher_minimum_version_guard.go
  • cli/release-automation/internal/automation/dispatcher_minimum_version_guard_test.go
  • release-please-config.json
  • scripts/test-release-please-config.sh
  • scripts/test-sync-release-please-package-releases.sh
💤 Files with no reviewable changes (4)
  • cli/release-automation/internal/automation/dispatcher_minimum_version_guard.go
  • cli/dispatcher/internal/dispatcher/dispatcher_pin.go
  • release-please-config.json
  • scripts/test-sync-release-please-package-releases.sh

Comment thread scripts/test-release-please-config.sh Outdated

@cubic-dev-ai cubic-dev-ai 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.

1 issue found across 11 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread Assets/Tests/Editor/CliPinSynchronizerTests.cs Outdated
.["extra-files"] after an expression is rejected by jq 1.6, so the config
test only worked on newer jq builds; plain ["extra-files"] indexing parses
everywhere. The synchronizer fixtures now carry both pin fields so a sync
bug that dropped minimumDispatcherVersion would fail the exact-match
assertions.
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