mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-12 17:03:55 -07:00
refactor: rename enterprise services to plugin services
The orchestrator is a plugin, not an enterprise feature. Renamed loadEnterpriseServices -> loadPluginServices and all related variables, types, log messages, and test descriptions to use "plugin" terminology. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+35
-35
@@ -48,16 +48,16 @@ async function runMain() {
|
||||
}
|
||||
model_1.Action.checkCompatibility();
|
||||
model_1.Cache.verify();
|
||||
const enterprise = await (0, orchestrator_plugin_1.loadEnterpriseServices)();
|
||||
const plugin = await (0, orchestrator_plugin_1.loadPluginServices)();
|
||||
// Always configure git environment for CI reliability
|
||||
enterprise?.BuildReliabilityService.configureGitEnvironment();
|
||||
plugin?.BuildReliabilityService.configureGitEnvironment();
|
||||
const { workspace, actionFolder } = model_1.Action;
|
||||
const buildParameters = await model_1.BuildParameters.create();
|
||||
// If a test suite path is provided, use the test workflow engine
|
||||
// instead of the standard build execution path
|
||||
if (buildParameters.testSuitePath) {
|
||||
core.info('[TestWorkflow] Test suite path detected, using test workflow engine');
|
||||
const results = await enterprise?.TestWorkflowService.executeTestSuite(buildParameters.testSuitePath, buildParameters);
|
||||
const results = await plugin?.TestWorkflowService.executeTestSuite(buildParameters.testSuitePath, buildParameters);
|
||||
let totalFailed = 0;
|
||||
for (const result of results || []) {
|
||||
totalFailed += result.failed;
|
||||
@@ -74,15 +74,15 @@ async function runMain() {
|
||||
// Pre-build reliability checks
|
||||
if (buildParameters.gitIntegrityCheck) {
|
||||
core.info('Running git integrity checks...');
|
||||
const isHealthy = enterprise?.BuildReliabilityService.checkGitIntegrity(workspace);
|
||||
enterprise?.BuildReliabilityService.cleanStaleLockFiles(workspace);
|
||||
enterprise?.BuildReliabilityService.validateSubmoduleBackingStores(workspace);
|
||||
const isHealthy = plugin?.BuildReliabilityService.checkGitIntegrity(workspace);
|
||||
plugin?.BuildReliabilityService.cleanStaleLockFiles(workspace);
|
||||
plugin?.BuildReliabilityService.validateSubmoduleBackingStores(workspace);
|
||||
if (buildParameters.cleanReservedFilenames) {
|
||||
enterprise?.BuildReliabilityService.cleanReservedFilenames(buildParameters.projectPath);
|
||||
plugin?.BuildReliabilityService.cleanReservedFilenames(buildParameters.projectPath);
|
||||
}
|
||||
if (!isHealthy && buildParameters.gitAutoRecover) {
|
||||
core.info('Git corruption detected, attempting automatic recovery...');
|
||||
const recovered = enterprise?.BuildReliabilityService.recoverCorruptedRepo(workspace);
|
||||
const recovered = plugin?.BuildReliabilityService.recoverCorruptedRepo(workspace);
|
||||
if (!recovered) {
|
||||
core.warning('Automatic recovery failed. Build may encounter issues.');
|
||||
}
|
||||
@@ -90,7 +90,7 @@ async function runMain() {
|
||||
}
|
||||
else if (buildParameters.cleanReservedFilenames) {
|
||||
// cleanReservedFilenames can run independently of gitIntegrityCheck
|
||||
enterprise?.BuildReliabilityService.cleanReservedFilenames(buildParameters.projectPath);
|
||||
plugin?.BuildReliabilityService.cleanReservedFilenames(buildParameters.projectPath);
|
||||
}
|
||||
let exitCode = -1;
|
||||
// Hot runner path: attempt to use a persistent Unity editor instance
|
||||
@@ -105,10 +105,10 @@ async function runMain() {
|
||||
maxIdleTime: buildParameters.hotRunnerMaxIdle,
|
||||
maxJobsBeforeRecycle: 0, // no automatic recycle by job count
|
||||
};
|
||||
if (!enterprise?.HotRunnerService) {
|
||||
throw new Error('[HotRunner] Enterprise services required for hot runner mode');
|
||||
if (!plugin?.HotRunnerService) {
|
||||
throw new Error('[HotRunner] Orchestrator plugin required for hot runner mode');
|
||||
}
|
||||
const hotRunnerService = new enterprise.HotRunnerService();
|
||||
const hotRunnerService = new plugin.HotRunnerService();
|
||||
try {
|
||||
await hotRunnerService.initialize(hotRunnerConfig);
|
||||
const result = await hotRunnerService.submitBuild(buildParameters, (output) => {
|
||||
@@ -134,7 +134,7 @@ async function runMain() {
|
||||
// Child workspace isolation - restore cached workspace before any other setup
|
||||
let childWorkspaceConfig;
|
||||
if (buildParameters.childWorkspacesEnabled && buildParameters.childWorkspaceName) {
|
||||
const ChildWorkspaceService = await enterprise?.loadChildWorkspaceService();
|
||||
const ChildWorkspaceService = await plugin?.loadChildWorkspaceService();
|
||||
const cacheRoot = buildParameters.childWorkspaceCacheRoot ||
|
||||
node_path_1.default.join(buildParameters.runnerTempPath || process.env.RUNNER_TEMP || '', 'game-ci-workspaces');
|
||||
childWorkspaceConfig = ChildWorkspaceService?.buildConfig({
|
||||
@@ -154,7 +154,7 @@ async function runMain() {
|
||||
// Submodule profile initialization
|
||||
if (buildParameters.submoduleProfilePath) {
|
||||
core.info('Initializing submodules from profile...');
|
||||
const SubmoduleProfileService = await enterprise?.loadSubmoduleProfileService();
|
||||
const SubmoduleProfileService = await plugin?.loadSubmoduleProfileService();
|
||||
const plan = await SubmoduleProfileService?.createInitPlan(buildParameters.submoduleProfilePath, buildParameters.submoduleVariantPath, workspace);
|
||||
if (plan) {
|
||||
await SubmoduleProfileService?.execute(plan, workspace, buildParameters.submoduleToken || buildParameters.gitPrivateToken);
|
||||
@@ -163,7 +163,7 @@ async function runMain() {
|
||||
// Configure custom LFS transfer agent
|
||||
if (buildParameters.lfsTransferAgent) {
|
||||
core.info('Configuring custom LFS transfer agent...');
|
||||
const LfsAgentService = await enterprise?.loadLfsAgentService();
|
||||
const LfsAgentService = await plugin?.loadLfsAgentService();
|
||||
await LfsAgentService?.configure(buildParameters.lfsTransferAgent, buildParameters.lfsTransferAgentArgs, buildParameters.lfsStoragePaths ? buildParameters.lfsStoragePaths.split(';') : [], workspace);
|
||||
}
|
||||
// Local build caching - restore
|
||||
@@ -172,7 +172,7 @@ async function runMain() {
|
||||
// eslint-disable-next-line no-undef
|
||||
let LocalCacheService;
|
||||
if (buildParameters.localCacheEnabled) {
|
||||
LocalCacheService = await enterprise?.loadLocalCacheService();
|
||||
LocalCacheService = await plugin?.loadLocalCacheService();
|
||||
cacheRoot = LocalCacheService?.resolveCacheRoot(buildParameters) || '';
|
||||
cacheKey =
|
||||
LocalCacheService?.generateCacheKey(buildParameters.targetPlatform, buildParameters.editorVersion, buildParameters.branch || '') || '';
|
||||
@@ -186,7 +186,7 @@ async function runMain() {
|
||||
}
|
||||
// Git hooks — opt-in only. When disabled (default), do not touch hooks at all.
|
||||
if (buildParameters.gitHooksEnabled) {
|
||||
const GitHooksService = await enterprise?.loadGitHooksService();
|
||||
const GitHooksService = await plugin?.loadGitHooksService();
|
||||
await GitHooksService?.installHooks(workspace);
|
||||
if (buildParameters.gitHooksSkipList) {
|
||||
const environment = GitHooksService?.configureSkipList(buildParameters.gitHooksSkipList.split(','));
|
||||
@@ -199,7 +199,7 @@ async function runMain() {
|
||||
const syncStrategy = buildParameters.syncStrategy;
|
||||
if (syncStrategy !== 'full') {
|
||||
core.info(`[Sync] Applying sync strategy: ${syncStrategy}`);
|
||||
await applySyncStrategy(buildParameters, workspace, enterprise);
|
||||
await applySyncStrategy(buildParameters, workspace, plugin);
|
||||
}
|
||||
await platform_setup_1.default.setup(buildParameters, actionFolder);
|
||||
exitCode =
|
||||
@@ -222,7 +222,7 @@ async function runMain() {
|
||||
}
|
||||
// Child workspace isolation - save workspace for next run
|
||||
if (childWorkspaceConfig && childWorkspaceConfig.enabled) {
|
||||
const ChildWorkspaceService = await enterprise?.loadChildWorkspaceService();
|
||||
const ChildWorkspaceService = await plugin?.loadChildWorkspaceService();
|
||||
const projectFullPath = node_path_1.default.join(workspace, buildParameters.projectPath);
|
||||
const preSaveSize = ChildWorkspaceService?.getWorkspaceSize(projectFullPath);
|
||||
core.info(`Child workspace size before save: ${preSaveSize}`);
|
||||
@@ -233,7 +233,7 @@ async function runMain() {
|
||||
if (buildParameters.syncRevertAfter && syncStrategy !== 'full') {
|
||||
core.info('[Sync] Reverting overlay changes after job completion');
|
||||
try {
|
||||
await enterprise?.IncrementalSyncService.revertOverlays(workspace, buildParameters.syncStatePath);
|
||||
await plugin?.IncrementalSyncService.revertOverlays(workspace, buildParameters.syncStatePath);
|
||||
}
|
||||
catch (revertError) {
|
||||
core.warning(`[Sync] Overlay revert failed: ${revertError.message}`);
|
||||
@@ -251,8 +251,8 @@ async function runMain() {
|
||||
// Post-build: archive and enforce retention
|
||||
if (buildParameters.buildArchiveEnabled && exitCode === 0) {
|
||||
core.info('Archiving build output...');
|
||||
enterprise?.BuildReliabilityService.archiveBuildOutput(buildParameters.buildPath, buildParameters.buildArchivePath);
|
||||
enterprise?.BuildReliabilityService.enforceRetention(buildParameters.buildArchivePath, buildParameters.buildArchiveRetention);
|
||||
plugin?.BuildReliabilityService.archiveBuildOutput(buildParameters.buildPath, buildParameters.buildArchivePath);
|
||||
plugin?.BuildReliabilityService.enforceRetention(buildParameters.buildArchivePath, buildParameters.buildArchiveRetention);
|
||||
}
|
||||
// Set output
|
||||
await model_1.Output.setBuildVersion(buildParameters.buildVersion);
|
||||
@@ -266,7 +266,7 @@ async function runMain() {
|
||||
const customTypes = JSON.parse(buildParameters.artifactCustomTypes);
|
||||
if (Array.isArray(customTypes)) {
|
||||
for (const ct of customTypes) {
|
||||
enterprise?.OutputTypeRegistry.registerType({
|
||||
plugin?.OutputTypeRegistry.registerType({
|
||||
name: ct.name,
|
||||
defaultPath: ct.defaultPath || ct.pattern || `./${ct.name}/`,
|
||||
description: ct.description || `Custom output type: ${ct.name}`,
|
||||
@@ -281,13 +281,13 @@ async function runMain() {
|
||||
}
|
||||
// Collect outputs and generate manifest
|
||||
const manifestPath = node_path_1.default.join(buildParameters.projectPath, 'output-manifest.json');
|
||||
const manifest = await enterprise?.OutputService.collectOutputs(buildParameters.projectPath, buildParameters.buildGuid, buildParameters.artifactOutputTypes, manifestPath);
|
||||
const manifest = await plugin?.OutputService.collectOutputs(buildParameters.projectPath, buildParameters.buildGuid, buildParameters.artifactOutputTypes, manifestPath);
|
||||
core.setOutput('artifactManifestPath', manifestPath);
|
||||
if (manifest) {
|
||||
// Upload artifacts
|
||||
const uploadConfig = enterprise?.ArtifactUploadHandler.parseConfig(buildParameters.artifactUploadTarget, buildParameters.artifactUploadPath || undefined, buildParameters.artifactCompression, buildParameters.artifactRetentionDays);
|
||||
const uploadConfig = plugin?.ArtifactUploadHandler.parseConfig(buildParameters.artifactUploadTarget, buildParameters.artifactUploadPath || undefined, buildParameters.artifactCompression, buildParameters.artifactRetentionDays);
|
||||
if (uploadConfig) {
|
||||
const uploadResult = await enterprise?.ArtifactUploadHandler.uploadArtifacts(manifest, uploadConfig, buildParameters.projectPath);
|
||||
const uploadResult = await plugin?.ArtifactUploadHandler.uploadArtifacts(manifest, uploadConfig, buildParameters.projectPath);
|
||||
if (uploadResult && !uploadResult.success) {
|
||||
core.warning(`Artifact upload completed with errors: ${uploadResult.entries
|
||||
.filter((entry) => !entry.success)
|
||||
@@ -332,12 +332,12 @@ async function runColdBuild(buildParameters, baseImage, workspace, actionFolder)
|
||||
/**
|
||||
* Apply the configured sync strategy to the workspace before build.
|
||||
*/
|
||||
async function applySyncStrategy(buildParameters, workspace, enterprise) {
|
||||
if (!enterprise?.IncrementalSyncService) {
|
||||
core.warning('[Sync] Enterprise services not available, skipping sync strategy');
|
||||
async function applySyncStrategy(buildParameters, workspace, plugin) {
|
||||
if (!plugin?.IncrementalSyncService) {
|
||||
core.warning('[Sync] Orchestrator plugin not available, skipping sync strategy');
|
||||
return;
|
||||
}
|
||||
const { IncrementalSyncService } = enterprise;
|
||||
const { IncrementalSyncService } = plugin;
|
||||
const strategy = buildParameters.syncStrategy;
|
||||
const resolvedStrategy = IncrementalSyncService.resolveStrategy(strategy, workspace, buildParameters.syncStatePath);
|
||||
if (resolvedStrategy === 'full') {
|
||||
@@ -2239,7 +2239,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.loadEnterpriseServices = exports.loadOrchestrator = void 0;
|
||||
exports.loadPluginServices = exports.loadOrchestrator = void 0;
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
/**
|
||||
* Load the orchestrator for remote builds.
|
||||
@@ -2265,11 +2265,11 @@ async function loadOrchestrator() {
|
||||
}
|
||||
exports.loadOrchestrator = loadOrchestrator;
|
||||
/**
|
||||
* Load enterprise services for local builds.
|
||||
* Load orchestrator plugin services for local builds.
|
||||
* These services are part of the orchestrator but also used in local builds
|
||||
* (child workspaces, local cache, git hooks, LFS agents, etc.).
|
||||
*/
|
||||
async function loadEnterpriseServices() {
|
||||
async function loadPluginServices() {
|
||||
try {
|
||||
// eslint-disable-next-line import/no-unresolved
|
||||
const orchestrator = await Promise.resolve().then(() => __importStar(__nccwpck_require__(70776)));
|
||||
@@ -2300,10 +2300,10 @@ async function loadEnterpriseServices() {
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
core.warning(`Enterprise services not available: ${error.message}`);
|
||||
core.warning(`Orchestrator plugin not available: ${error.message}`);
|
||||
}
|
||||
}
|
||||
exports.loadEnterpriseServices = loadEnterpriseServices;
|
||||
exports.loadPluginServices = loadPluginServices;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user