feat(ir): add typed builder for KubernetesManifest@1 - #1229
Merged
Conversation
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>
Open
…t-task-d4f9b8b6b810ab19
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a typed builder struct for
KubernetesManifest@1to the ado-aw IR.Motivation
KubernetesManifest@1is 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-craftTaskStep::new("KubernetesManifest@1", ...)with raw string input keys. This PR introduces a command-dispatch typed builder (modelled afterdocker.rs) so every action variant type-checks its own inputs, required inputs are positional, and constrained values are enums withas_ado_str().Changes
src/compile/ir/tasks/kubernetes_manifest.rs: newKubernetesManifestcommand-dispatch builderdeploy,bake,createSecret,delete,patch,promote,scale,reject) each with its own per-action struct carrying the relevant required/optional inputsConnectionType,DeploymentStrategy,TrafficSplitMethod,RenderType,ResourceKind,MergeStrategy,SecretType,PatchTargetKubernetesManifestbuilder (avoids repeating 6 connection fields across 7 of 8 action variants)src/compile/ir/tasks/mod.rs:pub mod kubernetes_manifest;declaration (alphabetical order)ADO Task Reference
KubernetesManifest@1deploy:manifestsbake:helmChart(helm),dockerComposeFile(kompose)createSecret:secretTypescale:kind,name,replicaspatch:resourceToPatch,mergeStrategy,patchpromote/reject:manifestsdelete: nonebake):connectionType,kubernetesServiceConnection,azureSubscriptionConnection,azureResourceGroup,kubernetesCluster,useClusterAdmin,namespaceValidation
cargo build --all-targetscargo test(14 new tests, all passing; 2300+ total passing)cargo clippy --all-targets --all-features --workspace -- -D warningsCreated 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.comspsprodweu4.vssps.visualstudio.comSee Network Configuration for more information.