From 3af56fdf170fd9aa9b6959758162d990a12ee5a6 Mon Sep 17 00:00:00 2001 From: Vigneshraj Sekar Babu Date: Thu, 16 Apr 2026 08:37:02 -0700 Subject: [PATCH] allow deprecated service-level YAML keys --- docs/schema/yaml/1.0.0.yaml | 2 +- src/server/lib/jsonschema/schemas/1.0.0.json | 4 +-- .../yamlSchemas/schema_1_0_0/schema_1_0_0.ts | 3 +- src/server/models/config/index.test.ts | 32 +++++++++++++++++++ 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/docs/schema/yaml/1.0.0.yaml b/docs/schema/yaml/1.0.0.yaml index a7dc2371..b78e7de8 100644 --- a/docs/schema/yaml/1.0.0.yaml +++ b/docs/schema/yaml/1.0.0.yaml @@ -777,4 +777,4 @@ services: # @param services.dev.agentSession.skills.branch (required) branch: '' # @param services.dev.agentSession.skills.path (required) - path: '' + path: '' \ No newline at end of file diff --git a/src/server/lib/jsonschema/schemas/1.0.0.json b/src/server/lib/jsonschema/schemas/1.0.0.json index 77aa2e73..1e851ed4 100644 --- a/src/server/lib/jsonschema/schemas/1.0.0.json +++ b/src/server/lib/jsonschema/schemas/1.0.0.json @@ -251,7 +251,7 @@ "minItems": 1, "items": { "type": "object", - "additionalProperties": false, + "additionalProperties": true, "properties": { "name": { "type": "string" @@ -1515,4 +1515,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/server/lib/yamlSchemas/schema_1_0_0/schema_1_0_0.ts b/src/server/lib/yamlSchemas/schema_1_0_0/schema_1_0_0.ts index 93aee5df..354776dc 100644 --- a/src/server/lib/yamlSchemas/schema_1_0_0/schema_1_0_0.ts +++ b/src/server/lib/yamlSchemas/schema_1_0_0/schema_1_0_0.ts @@ -133,7 +133,8 @@ const schema_1_0_0 = { minItems: 1, items: { type: 'object', - additionalProperties: false, + // Backward compatibility: ignore deprecated or repo-specific service keys at validation time. + additionalProperties: true, properties: { name: { type: 'string' }, appShort: { type: 'string' }, diff --git a/src/server/models/config/index.test.ts b/src/server/models/config/index.test.ts index 54922372..1647f733 100644 --- a/src/server/models/config/index.test.ts +++ b/src/server/models/config/index.test.ts @@ -453,4 +453,36 @@ describe('Yaml Service', () => { expect(YamlService.getDetatchAfterBuildPipeline(service)).toEqual(false); }); }); + + describe('schema compatibility', () => { + test('accepts deprecated kedaScaleToZero config as a no-op', () => { + const deprecatedKedaConfig = `--- + version: '1.0.0' + + services: + - name: 'legacy-service' + kedaScaleToZero: + enabled: true + minReplicaCount: 0 + maxReplicaCount: 5 + cooldownPeriod: 300 + pollingInterval: 30 + helm: + repository: 'example/legacy-service' + branchName: 'main' + deploymentMethod: 'native' + chart: + name: 'example-chart' + docker: + defaultTag: 'main' + app: + dockerfilePath: 'Dockerfile' + `; + + const parser = new YamlConfigParser(); + const config = parser.parseYamlConfigFromString(deprecatedKedaConfig); + + expect(() => new YamlConfigValidator().validate_1_0_0(config)).not.toThrow(); + }); + }); });