feat: add v03 user billing service (#1128)
This commit is contained in:
@@ -431,7 +431,7 @@ function refreshDocuments({ deploy, catalog, target, publishRecords, serviceInve
|
||||
const records = publishRecords?.records ?? null;
|
||||
const requiredIds = new Set(publishRecords?.requiredServiceIds ?? serviceInventory.requiredServiceIds);
|
||||
const catalogByService = new Map(catalog.services.map((service) => [service.serviceId, service]));
|
||||
const deployByService = new Map(deploy.services.map((service) => [service.serviceId, service]));
|
||||
const deployByService = deployServiceMapForLane(deploy, lane, serviceIds);
|
||||
const inventoryByService = new Map(serviceInventory.services.map((service) => [service.serviceId, service]));
|
||||
const refreshedServices = [];
|
||||
const nextCatalogServices = [];
|
||||
@@ -539,6 +539,17 @@ function refreshDocuments({ deploy, catalog, target, publishRecords, serviceInve
|
||||
return refreshedServices;
|
||||
}
|
||||
|
||||
function deployServiceMapForLane(deploy, lane, serviceIds) {
|
||||
const base = new Map((deploy.services ?? []).map((service) => [service.serviceId, service]));
|
||||
if (!isRuntimeArtifactLane(lane)) return base;
|
||||
const overlay = new Map((laneDeployConfig(deploy, lane)?.services ?? []).map((service) => [service.serviceId, service]));
|
||||
return new Map(serviceIds.map((serviceId) => [serviceId, {
|
||||
serviceId,
|
||||
...(base.get(serviceId) ?? {}),
|
||||
...(overlay.get(serviceId) ?? {})
|
||||
}]));
|
||||
}
|
||||
|
||||
function publishReportProvenance(publishReport, fallbackPath) {
|
||||
const producer = publishReport?.artifactPublish?.producer;
|
||||
if (producer?.kind && producer?.runId) return `${producer.kind}:${producer.runId}`;
|
||||
@@ -566,7 +577,7 @@ async function main() {
|
||||
const serviceIds = serviceIdsForLane(args.lane, deploy);
|
||||
const publishRecords = publishReport ? publishRecordsFromReport(publishReport, target, serviceIds) : null;
|
||||
const serviceInventory = publishReport?.artifactPublish?.serviceInventory ?? serviceInventoryFromServices(
|
||||
await resolveDevArtifactServices(repoRoot, serviceIds, SERVICE_IDS)
|
||||
await resolveDevArtifactServices(repoRoot, serviceIds, serviceIds)
|
||||
);
|
||||
const services = refreshDocuments({
|
||||
deploy,
|
||||
|
||||
Reference in New Issue
Block a user