From ef96bd1905f225393917aa66489e853d38df1394 Mon Sep 17 00:00:00 2001 From: thisrohangupta <52221549+thisrohangupta@users.noreply.github.com> Date: Sat, 29 Aug 2026 00:29:05 +0000 Subject: [PATCH 1/2] chore: auto-sync harness schemas --- src/data/schemas/v0/pipeline.ts | 128 ++++++++++++------------------- src/data/schemas/v0/template.ts | 131 ++++++++++++-------------------- 2 files changed, 96 insertions(+), 163 deletions(-) diff --git a/src/data/schemas/v0/pipeline.ts b/src/data/schemas/v0/pipeline.ts index c71174a3b..09cf5f5ca 100644 --- a/src/data/schemas/v0/pipeline.ts +++ b/src/data/schemas/v0/pipeline.ts @@ -66624,7 +66624,6 @@ const schema: Record = { "provider": { "type": "string", "enum": [ - "smi", "istio" ] }, @@ -66633,22 +66632,6 @@ const schema: Record = { } }, "allOf": [ - { - "if": { - "properties": { - "provider": { - "const": "smi" - } - } - }, - "then": { - "properties": { - "spec": { - "$ref": "#/definitions/pipeline/steps/cd/SMIProviderSpec" - } - } - } - }, { "if": { "properties": { @@ -66667,8 +66650,8 @@ const schema: Record = { } ] }, - "SMIProviderSpec": { - "title": "SMIProviderSpec", + "IstioProviderSpec": { + "title": "IstioProviderSpec", "allOf": [ { "$ref": "#/definitions/pipeline/steps/cd/K8sTrafficRoutingProviderBaseSpec" @@ -66676,8 +66659,51 @@ const schema: Record = { { "type": "object", "properties": { - "rootService": { - "type": "string" + "gateways": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1 + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, + "hosts": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1 + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "delegateService": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] } } } @@ -67179,66 +67205,6 @@ const schema: Record = { } ] }, - "IstioProviderSpec": { - "title": "IstioProviderSpec", - "allOf": [ - { - "$ref": "#/definitions/pipeline/steps/cd/K8sTrafficRoutingProviderBaseSpec" - }, - { - "type": "object", - "properties": { - "gateways": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "minItems": 1 - }, - { - "type": "string", - "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", - "minLength": 1 - } - ] - }, - "hosts": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "minItems": 1 - }, - { - "type": "string", - "pattern": "(<\\+.+>.*)", - "minLength": 1 - } - ] - }, - "delegateService": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "pattern": "(<\\+.+>.*)", - "minLength": 1 - } - ] - } - } - } - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, "TerraformRollbackStepNode": { "title": "TerraformRollbackStepNode", "type": "object", diff --git a/src/data/schemas/v0/template.ts b/src/data/schemas/v0/template.ts index 9385815bb..7e7e68d75 100644 --- a/src/data/schemas/v0/template.ts +++ b/src/data/schemas/v0/template.ts @@ -1342,7 +1342,8 @@ const schema: Record = { "PipelineTimeout", "AllowStageExecutions", "FixedInputsOnRerun", - "DelegateSelectors" + "DelegateSelectors", + "NotificationRules" ] } }, @@ -20100,7 +20101,6 @@ const schema: Record = { "provider": { "type": "string", "enum": [ - "smi", "istio" ] }, @@ -20109,22 +20109,6 @@ const schema: Record = { } }, "allOf": [ - { - "if": { - "properties": { - "provider": { - "const": "smi" - } - } - }, - "then": { - "properties": { - "spec": { - "$ref": "#/definitions/pipeline/steps/cd/SMIProviderSpec" - } - } - } - }, { "if": { "properties": { @@ -20143,8 +20127,8 @@ const schema: Record = { } ] }, - "SMIProviderSpec": { - "title": "SMIProviderSpec", + "IstioProviderSpec": { + "title": "IstioProviderSpec", "allOf": [ { "$ref": "#/definitions/pipeline/steps/cd/K8sTrafficRoutingProviderBaseSpec" @@ -20152,8 +20136,51 @@ const schema: Record = { { "type": "object", "properties": { - "rootService": { - "type": "string" + "gateways": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1 + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, + "hosts": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1 + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "delegateService": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] } } } @@ -20655,66 +20682,6 @@ const schema: Record = { } ] }, - "IstioProviderSpec": { - "title": "IstioProviderSpec", - "allOf": [ - { - "$ref": "#/definitions/pipeline/steps/cd/K8sTrafficRoutingProviderBaseSpec" - }, - { - "type": "object", - "properties": { - "gateways": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "minItems": 1 - }, - { - "type": "string", - "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", - "minLength": 1 - } - ] - }, - "hosts": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "minItems": 1 - }, - { - "type": "string", - "pattern": "(<\\+.+>.*)", - "minLength": 1 - } - ] - }, - "delegateService": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "pattern": "(<\\+.+>.*)", - "minLength": 1 - } - ] - } - } - } - ], - "$schema": "http://json-schema.org/draft-07/schema#" - }, "K8sCanaryDeleteStepNode_template": { "title": "K8sCanaryDeleteStepNode_template", "type": "object", From 85d27c10a6c0bfd7f5fc25a6d1d7e1f9bb8799ee Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 29 Aug 2026 00:30:31 +0000 Subject: [PATCH 2/2] test: regression coverage for schema sync #874 (istio routing, NotificationRules) Co-authored-by: Rohan Gupta --- tests/schemas/schema-bundle-contract.test.ts | 56 ++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/tests/schemas/schema-bundle-contract.test.ts b/tests/schemas/schema-bundle-contract.test.ts index dc51f3f88..4501d1c6d 100644 --- a/tests/schemas/schema-bundle-contract.test.ts +++ b/tests/schemas/schema-bundle-contract.test.ts @@ -220,4 +220,60 @@ describe("schema bundle contract", () => { expect(dynamicStage.properties.dynamic.properties).toHaveProperty("source-config"); } }); + + it("drops the removed smi provider from K8sTrafficRoutingSpec in v0 pipeline and template", () => { + for (const key of ["pipeline", "template"] as const) { + const cdSteps = (SCHEMAS[key].definitions as Record>).pipeline + .steps.cd as Record; + const routingSpec = cdSteps.K8sTrafficRoutingSpec as { + properties: { provider: { enum: string[] } }; + allOf: Array<{ + if: { properties: { provider: { const: string } } }; + then: { properties: { spec: { $ref: string } } }; + }>; + }; + + expect(routingSpec.properties.provider.enum).toEqual(["istio"]); + expect(cdSteps).not.toHaveProperty("SMIProviderSpec"); + + const istioBranch = routingSpec.allOf.find( + (rule) => rule.if?.properties?.provider?.const === "istio", + ); + expect(istioBranch?.then.properties.spec.$ref).toContain("IstioProviderSpec"); + } + }); + + it("includes upstream IstioProviderSpec traffic-routing fields in v0 pipeline and template", () => { + for (const key of ["pipeline", "template"] as const) { + const cdSteps = (SCHEMAS[key].definitions as Record>).pipeline + .steps.cd as Record; + const istioSpec = cdSteps.IstioProviderSpec as { + title: string; + allOf: Array<{ properties?: Record }>; + }; + + expect(istioSpec.title).toBe("IstioProviderSpec"); + + const props = istioSpec.allOf.find((part) => part.properties?.gateways)?.properties; + expect(props).toHaveProperty("gateways"); + expect(props).toHaveProperty("hosts"); + expect(props).toHaveProperty("delegateService"); + expect(props).not.toHaveProperty("rootService"); + } + }); + + it("includes NotificationRules in pipeline template allowedOverrides", () => { + const templateDefs = SCHEMAS.template.definitions as Record>; + const pipelineTemplate = templateDefs.template.pipeline as { + template: { properties: { allowedOverrides: { items: { enum: string[] } } } }; + }; + + expect(pipelineTemplate.template.properties.allowedOverrides.items.enum).toEqual([ + "PipelineTimeout", + "AllowStageExecutions", + "FixedInputsOnRerun", + "DelegateSelectors", + "NotificationRules", + ]); + }); });