@kumori/aurora-backend-handler 1.1.74 → 1.1.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/backend-handler.ts
CHANGED
|
@@ -748,7 +748,6 @@ export class BackendHandler {
|
|
|
748
748
|
eventHelper.environment.unsubscribe.clean(cleanCb),
|
|
749
749
|
);
|
|
750
750
|
const scaleCb = (data: Environment) => {
|
|
751
|
-
console.log("Scale called", data);
|
|
752
751
|
scaleEnvironment(data, token);
|
|
753
752
|
};
|
|
754
753
|
eventHelper.environment.subscribe.scale(scaleCb);
|
|
@@ -686,10 +686,8 @@ export const processRevisionData = (
|
|
|
686
686
|
const schemaResult = revisionData.revision
|
|
687
687
|
? extractStructuredSchema(revisionData)
|
|
688
688
|
: {};
|
|
689
|
-
console.log("DEBUG schemaResult", schemaResult);
|
|
690
689
|
const schema =
|
|
691
690
|
schemaResult && "parameters" in schemaResult ? schemaResult : {};
|
|
692
|
-
console.log("DEBUG schema", schema);
|
|
693
691
|
if (
|
|
694
692
|
revisionsMap &&
|
|
695
693
|
serviceId &&
|
|
@@ -697,12 +695,11 @@ export const processRevisionData = (
|
|
|
697
695
|
"parameters" in schema
|
|
698
696
|
) {
|
|
699
697
|
const revisionId: string = revisionData.revision;
|
|
700
|
-
const
|
|
698
|
+
const [tenantId, serviceName] = serviceId.split('/');
|
|
699
|
+
const revisionKey = `/tenant/${tenantId}/service/${serviceName}/revision/${revisionId}`;
|
|
701
700
|
const existing = revisionsMap.get(revisionKey);
|
|
702
701
|
if (existing) {
|
|
703
|
-
console.log("DEBUG: Updating existing revision in revisionsMap", revisionKey, existing);
|
|
704
702
|
revisionsMap.set(revisionKey, { ...existing, schema });
|
|
705
|
-
console.log("DEBUG: Updated revision in revisionsMap", revisionKey, revisionsMap.get(revisionKey));
|
|
706
703
|
} else {
|
|
707
704
|
revisionsMap.set(revisionKey, {
|
|
708
705
|
id: revisionId,
|
|
@@ -743,7 +740,6 @@ export const processRevisionData = (
|
|
|
743
740
|
errorMsg: "",
|
|
744
741
|
createdAt: "",
|
|
745
742
|
});
|
|
746
|
-
console.log("DEBUG: Added new revision to revisionsMap", revisionKey, revisionsMap.get(revisionKey));
|
|
747
743
|
}
|
|
748
744
|
}
|
|
749
745
|
|
|
@@ -812,11 +808,6 @@ export const processRevisionData = (
|
|
|
812
808
|
),
|
|
813
809
|
);
|
|
814
810
|
}
|
|
815
|
-
console.log("DEBUG: No deployment found in revisionData, applying schema to service with top-level parameters and resources.", service, topLevelParameters, topLevelResources, applySchemaToService({
|
|
816
|
-
...service,
|
|
817
|
-
parameters: topLevelParameters,
|
|
818
|
-
resources: topLevelResources,
|
|
819
|
-
}));
|
|
820
811
|
return applySchemaToService({
|
|
821
812
|
...service,
|
|
822
813
|
parameters: topLevelParameters,
|
|
@@ -188,16 +188,12 @@ export const handleServiceEvent = ({
|
|
|
188
188
|
}: HandleServiceEventParams): HandleServiceEventResult => {
|
|
189
189
|
const serviceFullKey = `${parentParts.tenant}/${entityId}`;
|
|
190
190
|
const serviceTenantId = parentParts.tenant;
|
|
191
|
-
const currentRevisionKey = `${eventData.id.parent.name}/service/${entityId}/revision/${eventData.status.revision}`;
|
|
191
|
+
const currentRevisionKey = `${eventData.id.parent.name}/service/${entityId}/revision/${eventData.spec.ctstamp || eventData.status.revision}`;
|
|
192
192
|
const currentRevision = revisionsMap.get(currentRevisionKey);
|
|
193
193
|
|
|
194
194
|
const projectLabel = eventData.meta?.labels?.project;
|
|
195
195
|
const serviceRoles = roleMap.get(serviceFullKey) || [];
|
|
196
196
|
const serviceUsage = currentRevision?.usage || getDefaultUsage(eventData);
|
|
197
|
-
console.log("DEBUG currentRevision", currentRevision);
|
|
198
|
-
console.log("DEBUG currentRevision.usage", currentRevision?.usage);
|
|
199
|
-
console.log("DEBUG defaultData", getDefaultUsage(eventData));
|
|
200
|
-
console.log("DEBUG: serviceUsage", serviceUsage);
|
|
201
197
|
|
|
202
198
|
|
|
203
199
|
const serviceRevisions: Revision[] = [];
|