feat(safe-outputs): rename upload-build-artifact to upload-build-attachment and add upload-pipeline-artifact#404
Conversation
…chment and add upload-pipeline-artifact - Rename upload-build-artifact → upload-build-attachment to match ADO terminology (the tool uses the build attachments REST API, not the deprecated build artifacts API) - Add central canonical_safe_output_name() alias layer for backward compatibility: old front-matter keys, NDJSON entries, and config are normalized to the new name - Implement new upload-pipeline-artifact safe output that publishes files as pipeline artifacts visible in the ADO Artifacts tab (3-step REST: create container → upload file → associate artifact with build) - Add ado_project_id field to ExecutionContext (from SYSTEM_TEAMPROJECTID) - Update docs/safe-outputs.md with renamed tool, new tool, and attachment-type clarification Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…scriptions - Remove canonical_safe_output_name() alias layer — no backward compatibility for the old upload-build-artifact name - Fix stale upload-build-artifact references in mcp.rs staged filenames/comments - Improve MCP tool descriptions: clearly state that build attachments are NOT visible in ADO UI and recommend upload-pipeline-artifact for user-visible files - Add upload-build-attachment and upload-pipeline-artifact to AGENTS.md architecture tree and README.md safe-outputs table - Remove deprecation notice from docs/safe-outputs.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/rust-review |
|
✅ Rust PR Reviewer completed successfully! |
🔍 Rust PR ReviewSummary: Needs one bug fix before merging — success message has swapped arguments; everything else looks solid. Findings🐛 Bugs / Logic Issues
|
…P handlers - Fix swapped effective_build_id/final_name in upload-pipeline-artifact success message (the info!() log was correct but the returned ExecutionResult message had them reversed) - Use source_bytes.len() instead of metadata.len() for recorded file_size in both upload-build-attachment and upload-pipeline-artifact MCP handlers, closing a TOCTOU window where the source file could change between stat and read Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Looks good overall — the rename is clean and the new Findings🐛 Bugs / Logic Issues
✅ What Looks Good
|
Include the project GUID in the container creation POST body so the container is scoped to the project, matching the scope query param used in the subsequent file upload step. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Looks good overall — the implementation is solid and follows project conventions well. One notable test coverage gap deserves follow-up. Findings
|
Summary
Renames
upload-build-artifacttoupload-build-attachment(matching ADO terminology) and introduces a newupload-pipeline-artifactsafe output that publishes files as pipeline artifacts visible in the ADO Artifacts tab.Motivation
The existing
upload-build-artifactsafe output uses the ADO build attachments REST API (PUT .../attachments/{type}/{name}), not the build/pipeline artifacts system. This is confusing because:PublishBuildArtifactssystemChanges
Rename:
upload-build-artifact→upload-build-attachmentNew:
upload-pipeline-artifactsafe outputPOST /_apis/resources/containers— create containerPUT /_apis/resources/containers/{id}— upload file bytesPOST /_apis/build/builds/{buildId}/artifacts— associate artifact with buildupload-build-attachmentwith SHA-256 integrity checksmax-file-size,allowed-extensions,allowed-artifact-names,allowed-build-ids,name-prefix,maxado_project_idfield toExecutionContext(fromSYSTEM_TEAMPROJECTID) — required for the container uploadscopeparameterImproved tool descriptions
upload-pipeline-artifactfor user-visible filesdocs/safe-outputs.mdupdated with full documentation for both tools, includingattachment-typeclarificationTesting
cargo clippy --all-targets --all-featuresclean (only pre-existing warnings)upload-pipeline-artifact: param validation, dry-run, file size mismatch, max size rejection, build-id allow-list, extension allow-list, config deserialization