Skip to content

refactor: make orchestrator engine-agnostic at the typed surface#26

Merged
frostebite merged 1 commit into
mainfrom
refactor/orchestrator-engine-agnostic
May 7, 2026
Merged

refactor: make orchestrator engine-agnostic at the typed surface#26
frostebite merged 1 commit into
mainfrom
refactor/orchestrator-engine-agnostic

Conversation

@frostebite

@frostebite frostebite commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

Removes Unity-specific licensing fields from orchestrator's typed surfaces. Orchestrator's domain is dispatch + providers, not engine-specific licensing — the fields removed here were vestigial leftovers from the original carve-out from unity-builder.

Tracking issue: #25 (full architecture, today/future state, migration runway)

Supersedes: #24 (closed). That PR mirrored unityLicensingToolset across orchestrator's typed surfaces. The architectural review (#25) concluded orchestrator shouldn't carry any Unity-specific licensing field, so adding the toolset here was the wrong direction. User-facing toolset support remains live in game-ci/unity-builder#838 and game-ci/cli#50; orchestrator forwards the value opaquely via the existing coreParams: Record<string, any> plugin contract.

Motivated by game-ci/unity-builder#739 — adding one Unity field today touches ~13 places across three repos. After this refactor, adding a Unity-licensing field touches zero orchestrator files.

What changes

Removed from typed surfaces only:

  • unitySerial
  • unityLicensingServer
  • skipActivation

(Plus unityLicensingToolset — never lands now that #24 is closed.)

Sites updated:

File Change
src/model/build-parameters.ts 3 field declarations + 3 create() defaults removed; doc-block expanded with engine-agnostic note
src/model/orchestrator/interfaces.ts (OrchestratorConfig) 3 fields removed; comment explains why
src/cli/input-mapper.ts 2 fields removed (skipActivation, unityLicensingServer); index signature [key: string]: unknown continues to accept anything else hosts pass
src/cli/commands/build.ts --skip-activation, --unity-licensing-server yargs options removed; comment points users to env vars / engine-specific host CLI
src/cli/commands/orchestrate.ts --skip-activation removed
src/cli-plugin/build-parameters-adapter.ts 3 lines removed
src/model/orchestrator/orchestrator.ts Defensive secret-scrub in updateStatusWithBuildParameters annotated (still scrubs by key name; safe via BP's index signature)
src/plugin-lifecycle.ts Top-of-file docstring expanded to document the engine-agnostic contract and the migration to cli-as-top-level
src/cli/__tests__/commands.test.ts Test now asserts the engine-specific flags are undefined (with a comment explaining the boundary)

Why no companion PR is needed in unity-builder or cli

The plugin contract (coreParams: Record<string, any>) is already opaque. unity-builder constructs its own BuildParameters (with unityLicensingServer, unityLicensingToolset, etc.) and passes it as the dict. Orchestrator simply stops typing those keys — they ride through the index signature untouched, get forwarded to the build container as env vars by task-parameter-serializer.ts, and reach Unity. No host-side change required.

Are these changes opt-in / backwards compatible?

Mixed — the structure is honest:

Concern Compat
Plugin contract Unchanged — opaque dict, hosts pass whatever
unity-builder GHA flow Unchanged — same behavior, env vars still forwarded
orchestrator's CLI users who pass --skip-activation / --unity-licensing-server directly Breaking — those flags are removed. Users should set the corresponding env vars (SKIP_ACTIVATION, UNITY_LICENSING_SERVER) or invoke the engine-specific host CLI (unity-builder action / @game-ci/cli)
TypeScript consumers reading OrchestratorConfig.unityLicensingServer etc. Breaking — those properties no longer exist. They were always empty strings anyway, so no real consumer should be reading them

The breaking-change blast radius is genuinely small (the fields were dead weight), but I'm flagging it honestly rather than calling this a no-op.

What's intentionally NOT in this PR

These are documented in #25 as separate, follow-up cleanups:

  • cacheUnityInstallationOnMac / unityHubVersionOnMac in input-mapper. More entangled with Mac runtime install caching. Separate PR.
  • task-parameter-serializer.ts UNITY_SERIAL well-known-secret list. Belongs in a "well-known-secrets generalization" cleanup.
  • activate CLI command. Genuinely Unity-specific, but removing it is breaking and the command isn't part of the plugin contract. Migrate later.
  • De-duplicating unity-builder/cli's platform-setup.ts. Naturally collapses in the future state where cli delegates to unity-builder.

Sequencing with the open fix PRs

This PR is built off origin/main and is independent of the two remaining fix PRs (game-ci/unity-builder#838, game-ci/cli#50). Either PR can land first; merge order:

No rebase or follow-up commit needed since #24 is closed and never lands its orchestrator-side toolset additions.

Test plan

  • yarn build clean (tsc passes)
  • yarn test:ci — 891 passed, 1 skipped, 0 failed
  • One existing test in commands.test.ts was inverted (asserts the engine-specific flags are now undefined, with a comment explaining why)
  • Verify against an unrelated unity-builder build to confirm coreParams opaque pass-through still delivers Unity license info to the container (cannot do locally — needs a reviewer with a working dispatch flow to confirm)

🤖 Generated with Claude Code

Remove Unity-specific licensing fields from orchestrator's typed surfaces
(BuildParameters, OrchestratorConfig, CLI input mapper, build/orchestrate
yargs commands, cli-plugin adapter):

- unitySerial
- unityLicensingServer
- skipActivation

These were vestigial — BuildParameters.create() hardcoded them to empty
strings, no orchestrator service read them for logic. They existed only
to mirror unity-builder's BuildParameters shape, which is exactly the
boundary violation: orchestrator's domain is dispatch + providers, not
engine-specific licensing.

The plugin contract (coreParams: Record<string, any>) is already opaque
and engine-agnostic. The host (unity-builder today, @game-ci/cli in the
future) passes its full BuildParameters object through; orchestrator
reads only generic build context (targetPlatform, projectPath, etc.) and
its plugin-owned config from env/inputs. Engine-specific keys ride in
the dict untouched.

No companion change needed in unity-builder: it continues to construct
its own BuildParameters with whatever fields it wants and pass it as
coreParams. The dict's index signature accepts everything.

Documentation:
- Tracking issue #25 lays out the full architecture, today/future state,
  and migration runway.
- Code comments in plugin-lifecycle.ts, interfaces.ts, build-parameters.ts,
  build.ts, orchestrate.ts, input-mapper.ts, build-parameters-adapter.ts
  reference the issue and explain the boundary intent so the next
  contributor understands why these fields are not (and must not be)
  declared here.

Out of scope (separate cleanups, noted in tracking issue):
- cacheUnityInstallationOnMac / unityHubVersionOnMac in input-mapper
  (Mac runtime install caching, more entangled)
- task-parameter-serializer.ts UNITY_SERIAL well-known-secret list
  (well-known-secrets generalization)
- activate CLI command (Unity-specific legacy helper, leave as-is)

Refs game-ci/unity-builder#739 and game-ci/unity-builder#838 (the user-
facing fix that motivated this boundary cleanup).
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@frostebite has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 32 minutes and 47 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1636ef68-f883-4c9a-8050-dcd282c1d04a

📥 Commits

Reviewing files that changed from the base of the PR and between 68bbf99 and b1c3010.

📒 Files selected for processing (9)
  • src/cli-plugin/build-parameters-adapter.ts
  • src/cli/__tests__/commands.test.ts
  • src/cli/commands/build.ts
  • src/cli/commands/orchestrate.ts
  • src/cli/input-mapper.ts
  • src/model/build-parameters.ts
  • src/model/orchestrator/interfaces.ts
  • src/model/orchestrator/orchestrator.ts
  • src/plugin-lifecycle.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/orchestrator-engine-agnostic

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 and usage tips.

@frostebite frostebite merged commit 3c52cf8 into main May 7, 2026
13 checks passed
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