fix: fill runtime lane catalog services

This commit is contained in:
lyon
2026-06-21 20:14:07 +08:00
parent 96a4cb83b9
commit c8d02405d3
+11 -4
View File
@@ -738,12 +738,19 @@ function bootShForService(deployManifest, serviceId, lane) {
return text;
}
function normalizeCatalogForLane(catalog, lane, deployManifest) {
function normalizeCatalogForLane(catalog, args, deployManifest, commitId) {
const lane = args?.lane;
if (!catalog || !isRuntimeArtifactLane(lane)) return catalog;
const allowed = new Set(runtimeLaneServiceIdsFromDeploy(deployManifest, lane));
const serviceIds = runtimeLaneServiceIdsFromDeploy(deployManifest, lane);
const allowed = new Set(serviceIds);
const existingById = new Map((catalog.services ?? [])
.filter((service) => allowed.has(service.serviceId))
.map((service) => [service.serviceId, service]));
const tag = imageTagForCommit(args, commitId);
return {
...catalog,
services: (catalog.services ?? []).filter((service) => allowed.has(service.serviceId))
services: serviceIds.map((serviceId) => existingById.get(serviceId)
?? artifactCatalogSkeletonService({ args, deployManifest, serviceId, tag, commitId }))
};
}
@@ -2297,7 +2304,7 @@ async function main() {
let catalog = await readConfigIfPresent(args.catalogPath, null);
const catalogWasMissing = !catalog;
if (!catalog && isRuntimeArtifactLane(args.lane)) catalog = artifactCatalogSkeleton({ args, deployManifest, commitId });
catalog = normalizeCatalogForLane(catalog, args.lane, deployManifest);
catalog = normalizeCatalogForLane(catalog, args, deployManifest, commitId);
assert.ok(catalog, `${args.catalogPath} is required for ${args.lane} artifact publish`);
const shortCommit = imageTagForCommit(args, commitId);
let effectiveCatalogPath = args.catalogPath;