Skip to content

feat(ir): add typed helper for DownloadPipelineArtifact@2#1063

Merged
jamesadevine merged 1 commit into
mainfrom
feat/ir-download-pipeline-artifact-e61e78742a38ab6e
Jun 17, 2026
Merged

feat(ir): add typed helper for DownloadPipelineArtifact@2#1063
jamesadevine merged 1 commit into
mainfrom
feat/ir-download-pipeline-artifact-e61e78742a38ab6e

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds download_pipeline_artifact_step to src/compile/ir/tasks.rs — a typed factory function for the ADO DownloadPipelineArtifact@2 task.

Motivation

DownloadPipelineArtifact@2 is already used in src/tools/cache_memory/extension.rs via a hand-crafted TaskStep::new("DownloadPipelineArtifact@2", ...). Adding a typed helper to the central tasks.rs module makes the required/optional input boundary explicit and gives future callers a clean, self-documenting API — consistent with the other helpers already in this module.

Changes

  • src/compile/ir/tasks.rs: download_pipeline_artifact_step(target_path) factory function with full doc-comment listing all optional inputs and their defaults.
  • Four unit tests in the same file:
    • required input only (default display name, single input count)
    • filtering by artifact name
    • full source = "specific" with project/pipeline/branch/version inputs
    • glob pattern filtering

API

// Minimal — download all artifacts from the current run:
let step = download_pipeline_artifact_step("$(Pipeline.Workspace)/drop");

// Named artifact from the current run:
let step = download_pipeline_artifact_step("$(Agent.TempDirectory)/out")
    .with_input("artifact", "drop");

// Previous run on the same branch:
let step = download_pipeline_artifact_step("$(Agent.TempDirectory)/prev")
    .with_input("source", "specific")
    .with_input("project", "$(System.TeamProject)")
    .with_input("pipeline", "$(System.DefinitionId)")
    .with_input("runVersion", "latestFromBranch")
    .with_input("branchName", "$(Build.SourceBranch)")
    .with_input("allowPartiallySucceededBuilds", "true");

ADO Task Reference

Validation

  • cargo build --all-targets
  • cargo test
  • 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 · 581.6 AIC · ⌖ 20.1 AIC · ⊞ 36.6K ·

Adds `download_pipeline_artifact_step` to `src/compile/ir/tasks.rs`,
a typed factory function for the ADO `DownloadPipelineArtifact@2` task.

Previously, callers had to hand-craft `TaskStep::new("DownloadPipelineArtifact@2", ...)`
with raw string inputs (as seen in `src/tools/cache_memory/extension.rs`).
The new helper makes the required/optional input boundary explicit:

- `target_path` is the only positional (required) parameter.
- All other inputs — `artifact`, `source`, `project`, `pipeline`,
  `runVersion`, `branchName`, `runId`, `tags`,
  `allowPartiallySucceededBuilds`, `allowFailedBuilds`,
  `preferTriggeringPipeline`, `patterns`, `itemPattern` — are
  applied via the existing `.with_input(…)` builder on the returned
  `TaskStep`.

Four unit tests cover:
- Required input only (default display name and single input)
- Filtering by artifact name
- Full "specific" source with branch/version/project inputs
- Glob pattern filtering

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request Jun 16, 2026
@jamesadevine jamesadevine marked this pull request as ready for review June 17, 2026 10:31
@jamesadevine jamesadevine merged commit a647fd9 into main Jun 17, 2026
@jamesadevine jamesadevine deleted the feat/ir-download-pipeline-artifact-e61e78742a38ab6e branch June 17, 2026 10:31
github-actions Bot added a commit that referenced this pull request Jun 17, 2026
…, DeleteFiles@1 helpers to ir.mdx

Three typed helpers added in #1063, #1065, and #1071 were missing from
the site docs. This patch:

- Adds three rows to the Available helpers table in ir.mdx
- Updates the tasks.rs module-layout bullet to list all 12 helpers
- Updates the cross-reference sentence in extending.mdx to mention the
  three new entries

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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