Skip to content
This repository was archived by the owner on Aug 14, 2026. It is now read-only.

Commit 3c52cf8

Browse files
authored
refactor: make orchestrator engine-agnostic at the typed surface (#26)
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).
1 parent 68bbf99 commit 3c52cf8

9 files changed

Lines changed: 487 additions & 444 deletions

File tree

src/cli-plugin/build-parameters-adapter.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ export function createBuildParametersFromCliOptions(options: Record<string, any>
2121
// ── identity / build settings ─────────────────────────────────────
2222
bp.editorVersion = options.engineVersion || options.editorVersion || options.unityVersion || '';
2323
bp.customImage = options.customImage || '';
24-
bp.unitySerial = options.unitySerial || process.env.UNITY_SERIAL || '';
25-
bp.unityLicensingServer = options.unityLicensingServer || '';
26-
bp.skipActivation = options.skipActivation || 'false';
24+
// Engine-specific licensing fields (unitySerial, unityLicensingServer,
25+
// unityLicensingToolset, skipActivation, ...) are not assigned here.
26+
// They flow opaquely through BuildParameters' index signature when the host
27+
// populates them; orchestrator does not read them.
28+
// See https://github.com/game-ci/orchestrator/issues/25
2729
bp.runnerTempPath = options.runnerTempPath || process.env.RUNNER_TEMP || '';
2830
bp.targetPlatform = options.targetPlatform || 'StandaloneLinux64';
2931
bp.projectPath = options.projectPath || '.';

src/cli/__tests__/commands.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,15 @@ describe('CLI commands', () => {
8787
expect(options['chown-files-to']).toBeDefined();
8888

8989
expect(options['provider-strategy']).toBeDefined();
90-
expect(options['skip-activation']).toBeDefined();
91-
expect(options['unity-licensing-server']).toBeDefined();
90+
91+
// Engine-specific licensing flags are intentionally NOT defined on
92+
// orchestrator's build command — orchestrator is engine-agnostic.
93+
// Hosts (unity-builder action, @game-ci/cli) own those flags and pass
94+
// them through to the build container as environment variables.
95+
// See https://github.com/game-ci/orchestrator/issues/25
96+
expect(options['skip-activation']).toBeUndefined();
97+
expect(options['unity-licensing-server']).toBeUndefined();
98+
expect(options['unity-licensing-toolset']).toBeUndefined();
9299
});
93100

94101
it('sets correct default values', () => {

0 commit comments

Comments
 (0)