Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/schema/yaml/1.0.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -777,4 +777,4 @@ services:
# @param services.dev.agentSession.skills.branch (required)
branch: ''
# @param services.dev.agentSession.skills.path (required)
path: ''
path: ''
4 changes: 2 additions & 2 deletions src/server/lib/jsonschema/schemas/1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"additionalProperties": true,
"properties": {
"name": {
"type": "string"
Expand Down Expand Up @@ -1515,4 +1515,4 @@
}
}
}
}
}
3 changes: 2 additions & 1 deletion src/server/lib/yamlSchemas/schema_1_0_0/schema_1_0_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
32 changes: 32 additions & 0 deletions src/server/models/config/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
});
Loading