Skip to content

feat(ir): add typed builder for KubernetesManifest@1 - #1229

Merged
jamesadevine merged 3 commits into
mainfrom
ir/kubernetes-manifest-task-d4f9b8b6b810ab19
Jul 1, 2026
Merged

feat(ir): add typed builder for KubernetesManifest@1#1229
jamesadevine merged 3 commits into
mainfrom
ir/kubernetes-manifest-task-d4f9b8b6b810ab19

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed builder struct for KubernetesManifest@1 to the ado-aw IR.

Motivation

KubernetesManifest@1 is one of the core ADO tasks for deploying containerised workloads to Kubernetes clusters. Previously, any code that needed to emit this task step had to hand-craft TaskStep::new("KubernetesManifest@1", ...) with raw string input keys. This PR introduces a command-dispatch typed builder (modelled after docker.rs) so every action variant type-checks its own inputs, required inputs are positional, and constrained values are enums with as_ado_str().

Changes

  • src/compile/ir/tasks/kubernetes_manifest.rs: new KubernetesManifest command-dispatch builder
    • 8 action variants (deploy, bake, createSecret, delete, patch, promote, scale, reject) each with its own per-action struct carrying the relevant required/optional inputs
    • 8 constrained-value enums: ConnectionType, DeploymentStrategy, TrafficSplitMethod, RenderType, ResourceKind, MergeStrategy, SecretType, PatchTarget
    • Shared connection and namespace inputs on the top-level KubernetesManifest builder (avoids repeating 6 connection fields across 7 of 8 action variants)
    • 14 unit tests covering all 8 actions and connection variants
  • src/compile/ir/tasks/mod.rs: pub mod kubernetes_manifest; declaration (alphabetical order)

ADO Task Reference

  • Task: KubernetesManifest@1
  • Docs: (https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/kubernetes-manifest-v1)
  • Required inputs (per action):
    • deploy: manifests
    • bake: helmChart (helm), dockerComposeFile (kompose)
    • createSecret: secretType
    • scale: kind, name, replicas
    • patch: resourceToPatch, mergeStrategy, patch
    • promote/reject: manifests
    • delete: none
  • Shared optional inputs (all except bake): connectionType, kubernetesServiceConnection, azureSubscriptionConnection, azureResourceGroup, kubernetesCluster, useClusterAdmin, namespace

Validation

  • cargo build --all-targets
  • cargo test (14 new tests, all passing; 2300+ total passing)
  • cargo clippy --all-targets --all-features --workspace -- -D warnings

Created by the ado-task-ir-contributor workflow.

Warning

Firewall blocked 2 domains

The following domains were blocked by the firewall during workflow execution:

  • spsprodeus21.vssps.visualstudio.com
  • spsprodweu4.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"
    - "spsprodweu4.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by ADO Task IR Contributor · 897.2 AIC · ⌖ 82.7 AIC · ⊞ 38.7K ·

Add a typed builder struct for `KubernetesManifest@1` to the ado-aw IR.
This is a command-dispatch task with 8 action variants (deploy, bake,
createSecret, delete, patch, promote, scale, reject). Each action carries
its own per-action inputs; shared connection and namespace inputs live on
the KubernetesManifest builder itself.

- src/compile/ir/tasks/kubernetes_manifest.rs: new command-dispatch builder
  with ConnectionType, DeploymentStrategy, TrafficSplitMethod, RenderType,
  ResourceKind, MergeStrategy, SecretType, PatchTarget enums plus
  per-action structs and 14 unit tests
- src/compile/ir/tasks/mod.rs: pub mod kubernetes_manifest declaration

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request Jun 27, 2026
jamesadevine and others added 2 commits July 1, 2026 15:09
Integrates the KubernetesManifest@1 typed builder with the front-matter task-step advisory validation added in #1096. KubernetesManifest dispatches on action (deploy/bake/createSecret/delete/patch/promote/scale/reject), so it supplies a bespoke validate_inputs: the shared connection/namespace inputs are validated and removed first, then the per-action inputs are validated against a deny_unknown_fields schema, reporting inputs used for the wrong action. All eight token enums derive Deserialize; numeric-ish inputs accept string or integer forms. Registered in parse.rs VALIDATORS.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine
jamesadevine marked this pull request as ready for review July 1, 2026 14:16
@jamesadevine
jamesadevine merged commit 01d06cf into main Jul 1, 2026
@jamesadevine
jamesadevine deleted the ir/kubernetes-manifest-task-d4f9b8b6b810ab19 branch July 1, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant