Skip to content

Conversation

@luckyy14
Copy link

@luckyy14 luckyy14 commented Jan 3, 2026

Request: Add --properties to "pipelines runs artifact upload"

Links to API documentation:

Feature request reference:

Summary

  • Add --properties support to the new command az pipelines runs artifact upload.
  • --properties accepts artifact metadata in the form key1=value1;key2=value2.
  • Implementation touches:
    • add properties argument to ArtifactToolInvoker.upload_pipeline_artifact
    • add help text and example for pipelines runs artifact upload
    • accept properties in argument parsing for the command
    • robust upload helper with optional validation, dry-run, retry/backoff, progress and callbacks
    • update tests to validate --properties behavior

Files changed (as per provided diff)

  • azure-devops/azext_devops/dev/common/artifacttool.py

    • New signature: upload_pipeline_artifact(..., properties=None)
    • Append --properties to artifacttool args when provided
  • azure-devops/azext_devops/dev/pipelines/_help.py

    • New help block for pipelines runs artifact upload with example demonstrating --properties
  • azure-devops/azext_devops/dev/pipelines/arguments.py

    • New argument registration for properties:
      options_list=['--properties']
      help: "Optional custom properties for the artifact in 'key1=value1;key2=value2' format."
  • azure-devops/azext_devops/dev/pipelines/pipeline.py

    • (Unrelated change included in the same PR) Serialize build.parameters as JSON when variables provided.
  • azure-devops/azext_devops/dev/pipelines/runs_artifacts.py

    • New run_artifact_upload(...) signature accepting properties plus several helper options (validate_path, dry_run, retry/backoff, callbacks)
    • Validates path, supports dry-run, retries, invokes ArtifactToolInvoker.upload_pipeline_artifact with properties.
  • azure-devops/azext_devops/tests/latest/pipelines/test_pipeline_runs_artifacts.py

    • New/updated tests to assert --properties is forwarded and behavior for dry_run, retries, callbacks, and path validation.

Example usage

az pipelines runs artifact upload \
  --artifact-name myArtifact \
  --run-id 123 \
  --path /path/to/artifact \
  --properties "user-key1=value1;user-key2=value2"

Proposed Command Details (artifact upload)

Command Parameters Response
az pipelines runs artifact upload artifact-name (string), run-id (int), path (string), --properties (optional string: "k=v;k2=v2"), --validate-path (bool), --dry-run (bool), --retry-count (int), --backoff-seconds (float), --log-progress (bool) Direct response from artifacttool invocation or CLI wrapper result (forwarded output / status object)

Notes for reviewers

  • Confirm whether --properties should be forwarded verbatim to artifacttool or transformed (e.g., JSON) before invoking the tooling or REST API.

@luckyy14
Copy link
Author

luckyy14 commented Jan 3, 2026

@microsoft-github-policy-service agree [company="forbiddenmurk"]

@luckyy14
Copy link
Author

luckyy14 commented Jan 3, 2026

@microsoft-github-policy-service agree

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.

2 participants