feat(ir): add typed builder for PublishBuildArtifacts@1#1105
Merged
jamesadevine merged 1 commit intoJun 18, 2026
Merged
Conversation
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
approved these changes
Jun 18, 2026
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
PublishBuildArtifacts@1to the ado-aw IR undersrc/compile/ir/tasks/publish_build_artifacts.rs.Motivation
Previously, any code that needed to emit a
PublishBuildArtifacts@1step had to hand-craftTaskStep::new(...)with raw string input keys. This PR introduces a location-dispatch typed builder so the twopublishLocationmodes (ContainerandFilePath) are structurally distinct, required inputs are positional, and file-share-only inputs are unrepresentable when publishing to Azure Pipelines artifact storage.Design
The
publishLocationinput 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.FilePathLocationcarriesTargetPath(required for this mode), plusParallel,ParallelCount, andFileCopyOptions. These inputs are unrepresentable in Container mode.Shared optional inputs (
MaxArtifactSize,StoreAsTar) sit on the outerPublishBuildArtifactsbuilder and apply to both modes.Convenience constructors (
::container,::file_path) mirror the Docker@2 template.Changes
src/compile/ir/tasks/publish_build_artifacts.rs: newPublishBuildArtifactsbuilder,PublishLocationenum, andFilePathLocationstruct 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
PublishBuildArtifacts@1PathtoPublish,ArtifactName,publishLocationMaxArtifactSize,StoreAsTarTargetPath(required for FilePath),Parallel,ParallelCount,FileCopyOptionsValidation
cargo build --all-targets— no warningscargo test— 2052+ tests, 0 failedcargo clippy --all-targets --all-features --workspace -- -D warnings— cleanCreated 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.