Prune legacy setup service scaffolding
This commit is contained in:
@@ -7,13 +7,7 @@
|
||||
*
|
||||
* Uses better-sqlite3 directly (no sqlite3 CLI), platform-aware service checks.
|
||||
*/
|
||||
import os from 'os';
|
||||
|
||||
import { logger } from '../src/logger.js';
|
||||
import {
|
||||
detectLegacyServiceIssues,
|
||||
formatLegacyServiceFailureMessage,
|
||||
} from './legacy-service-guard.js';
|
||||
import { getServiceManager } from './platform.js';
|
||||
import { getServiceDefs } from './service-defs.js';
|
||||
import { emitStatus } from './status.js';
|
||||
@@ -39,21 +33,10 @@ export async function run(_args: string[]): Promise<void> {
|
||||
// 1. Check service statuses
|
||||
const serviceDefs = getServiceDefs(projectRoot);
|
||||
const services = getServiceChecks(serviceDefs, projectRoot, mgr);
|
||||
const legacyServiceIssues = detectLegacyServiceIssues(
|
||||
projectRoot,
|
||||
mgr,
|
||||
os.homedir(),
|
||||
);
|
||||
|
||||
for (const svc of services) {
|
||||
logger.info({ service: svc.name, status: svc.status }, 'Service status');
|
||||
}
|
||||
for (const svc of legacyServiceIssues) {
|
||||
logger.error(
|
||||
{ service: svc.name, status: svc.status },
|
||||
'Legacy service detected during verification',
|
||||
);
|
||||
}
|
||||
|
||||
const credentials = detectCredentials(projectRoot);
|
||||
const channelAuth = detectChannelAuth();
|
||||
@@ -80,10 +63,7 @@ export async function run(_args: string[]): Promise<void> {
|
||||
activeArbiterTasks,
|
||||
},
|
||||
);
|
||||
const legacyServicesSummary = Object.fromEntries(
|
||||
legacyServiceIssues.map((service) => [service.name, service.status]),
|
||||
);
|
||||
const status = legacyServiceIssues.length > 0 ? 'failed' : baseStatus;
|
||||
const status = baseStatus;
|
||||
|
||||
logger.info(
|
||||
{
|
||||
@@ -92,27 +72,12 @@ export async function run(_args: string[]): Promise<void> {
|
||||
tribunalRooms: detectedTribunalRooms,
|
||||
activeArbiterTasks: detectedActiveArbiterTasks,
|
||||
servicesSummary,
|
||||
legacyServicesSummary,
|
||||
},
|
||||
'Verification complete',
|
||||
);
|
||||
if (legacyServiceIssues.length > 0) {
|
||||
logger.error(
|
||||
{
|
||||
cleanup: formatLegacyServiceFailureMessage({
|
||||
projectRoot,
|
||||
serviceManager: mgr,
|
||||
homeDir: os.homedir(),
|
||||
services: legacyServiceIssues,
|
||||
}),
|
||||
},
|
||||
'Verification failed due to legacy multi-service install',
|
||||
);
|
||||
}
|
||||
|
||||
emitStatus('VERIFY', {
|
||||
SERVICES: JSON.stringify(servicesSummary),
|
||||
LEGACY_SERVICES: JSON.stringify(legacyServicesSummary),
|
||||
// Legacy field (keep for backward compatibility)
|
||||
SERVICE: services[0].status,
|
||||
CREDENTIALS: credentials,
|
||||
|
||||
Reference in New Issue
Block a user