Skip to content

feat(ir): add typed builder for PublishBuildArtifacts@1#1105

Merged
jamesadevine merged 1 commit into
mainfrom
ir/publish-build-artifacts-typed-builder-74dda218a24fc6fb
Jun 18, 2026
Merged

feat(ir): add typed builder for PublishBuildArtifacts@1#1105
jamesadevine merged 1 commit into
mainfrom
ir/publish-build-artifacts-typed-builder-74dda218a24fc6fb

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed builder struct for PublishBuildArtifacts@1 to the ado-aw IR under src/compile/ir/tasks/publish_build_artifacts.rs.

Motivation

Previously, any code that needed to emit a PublishBuildArtifacts@1 step had to hand-craft TaskStep::new(...) with raw string input keys. This PR introduces a location-dispatch typed builder so the two publishLocation modes (Container and FilePath) are structurally distinct, required inputs are positional, and file-share-only inputs are unrepresentable when publishing to Azure Pipelines artifact storage.

Design

The publishLocation input selects between two modes with very different optional inputs:

  • PublishLocation::Container — publish to Azure Pipelines (default). No location-specific optionals.
  • PublishLocation::FilePath(FilePathLocation) — publish to a UNC file share. FilePathLocation carries TargetPath (required for this mode), plus Parallel, ParallelCount, and FileCopyOptions. These inputs are unrepresentable in Container mode.

Shared optional inputs (MaxArtifactSize, StoreAsTar) sit on the outer PublishBuildArtifacts builder and apply to both modes.

Convenience constructors (::container, ::file_path) mirror the Docker@2 template.

Changes

  • src/compile/ir/tasks/publish_build_artifacts.rs: new PublishBuildArtifacts builder, PublishLocation enum, and FilePathLocation struct with #[cfg(test)] mod tests (5 unit tests)
  • src/compile/ir/tasks/mod.rs: pub mod publish_build_artifacts; declaration (alphabetical order)

ADO Task Reference

Validation

  • cargo build --all-targets — no warnings
  • cargo test — 2052+ tests, 0 failed
  • cargo clippy --all-targets --all-features --workspace -- -D warnings — clean

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 · 719.5 AIC · ⌖ 31.1 AIC · ⊞ 38.1K ·

Adds a location-dispatch typed builder struct for the
`PublishBuildArtifacts@1` ADO task to `src/compile/ir/tasks/`.

The builder models the two `publishLocation` variants as an enum:
- `PublishLocation::Container` — publish to Azure Pipelines artifact
  storage (no location-specific optionals).
- `PublishLocation::FilePath(FilePathLocation)` — publish to a file
  share; carries `TargetPath` (required), `Parallel`, `ParallelCount`,
  and `FileCopyOptions` so file-share-only inputs are unrepresentable for
  the Container location.

Shared optional inputs (`MaxArtifactSize`, `StoreAsTar`) live on the
outer builder and apply to both locations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine jamesadevine marked this pull request as ready for review June 18, 2026 23:05
@jamesadevine jamesadevine merged commit 56cee37 into main Jun 18, 2026
@jamesadevine jamesadevine deleted the ir/publish-build-artifacts-typed-builder-74dda218a24fc6fb branch June 18, 2026 23:05
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