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
3 changes: 2 additions & 1 deletion pipelines/types/pipeline.schema.v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,8 @@
}
},
"required": [
"command"
"command",
"shellIdentity"
]
},
"shellStep": {
Expand Down
12 changes: 12 additions & 0 deletions pipelines/types/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ resourceGroups:
- name: deploy
action: Shell
command: echo hello
shellIdentity:
value: existing-msi
`,
expectError: false,
description: "backfillSubscriptionId alone should be valid",
Expand All @@ -101,6 +103,8 @@ resourceGroups:
- name: deploy
action: Shell
command: echo hello
shellIdentity:
value: existing-msi
`,
expectError: false,
description: "displayName and roleAssignment alone should be valid",
Expand All @@ -124,6 +128,8 @@ resourceGroups:
- name: deploy
action: Shell
command: echo hello
shellIdentity:
value: existing-msi
`,
expectError: false,
description: "backfillSubscriptionId with displayName should be valid (new behavior)",
Expand Down Expand Up @@ -152,6 +158,8 @@ resourceGroups:
- name: deploy
action: Shell
command: echo hello
shellIdentity:
value: existing-msi
`,
expectError: false,
description: "backfillSubscriptionId with all other fields should be valid (new behavior)",
Expand All @@ -173,6 +181,8 @@ resourceGroups:
- name: deploy
action: Shell
command: echo hello
shellIdentity:
value: existing-msi
`,
expectError: true,
description: "missing both required patterns should fail validation",
Expand All @@ -194,6 +204,8 @@ resourceGroups:
- name: deploy
action: Shell
command: echo hello
shellIdentity:
value: existing-msi
`,
expectError: true,
description: "displayName without roleAssignment should fail validation",
Expand Down
6 changes: 6 additions & 0 deletions pipelines/types/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ func TestValidatePipelineSchema(t *testing.T) {
"name": "step",
"action": "Shell",
"command": "echo hello",
"shellIdentity": map[string]interface{}{
"value": "test-msi",
},
},
},
},
Expand All @@ -325,6 +328,9 @@ func TestValidatePipelineSchema(t *testing.T) {
"action": "Shell",
"command": "echo hello",
"timeout": "75m",
"shellIdentity": map[string]interface{}{
"value": "test-msi",
},
},
},
},
Expand Down
Loading