feat(ir): add typed builder for TwineAuthenticate@1#1158
Merged
jamesadevine merged 1 commit intoJun 23, 2026
Conversation
Adds a typed builder struct for `TwineAuthenticate@1` to the ado-aw IR. The task authenticates the twine Python package upload tool by writing a `.pypirc` file and setting the `PYPIRC_PATH` environment variable. Two optional inputs are modeled: - `artifact_feed` — Azure Artifacts feed name within the organization (single feed; supports `project/feed` scoped form) - `python_upload_service_connection` — service connection name for an external PyPI-compatible endpoint Both inputs are optional; in practice exactly one should be set per task invocation (the task docs warn that only one feed/connection is honored per invocation). `Default` is implemented since all inputs are optional. This builder complements the existing `PipAuthenticate@1` builder (install-time download auth) with the corresponding upload-time auth. After the step runs, `twine upload -r FeedName --config-file $(PYPIRC_PATH)` can be used in a subsequent bash step. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jamesadevine
approved these changes
Jun 23, 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
TwineAuthenticate@1to the ado-aw IR.Motivation
TwineAuthenticate@1is the current (non-deprecated) version of the Pythonpackage upload authentication task. Previously, any code emitting this step
would have to hand-craft
TaskStep::new("TwineAuthenticate@1", ...).with_input(...).This PR introduces a typed builder (
new()+ typed optional setters +into_step()) so both inputs and their semantics are clear, and call sitesavoid stringly-typed input keys.
This builder complements the existing
PipAuthenticate@1(install-timedownload auth) with the corresponding upload-time auth needed for Python
package publishing workflows.
Changes
src/compile/ir/tasks/twine_authenticate.rs: newTwineAuthenticatebuilder struct and its#[cfg(test)] mod tests(8 unit tests)src/compile/ir/tasks/mod.rs:pub mod twine_authenticate;declaration (alphabetical order)ADO Task Reference
TwineAuthenticate@1https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/twine-authenticate-v1artifactFeed— Azure Artifacts feed name (single feed; supportsproject/feedscoped form)pythonUploadServiceConnection— service connection name for an external PyPI-compatible endpointUsage pattern after this step runs:
twine upload -r FeedName --config-file $(PYPIRC_PATH)Note: Only one feed or one service connection can be honored per task invocation (per ADO task docs).
TwineAuthenticate@0is scheduled for deprecation in June 2026; this builder targets V1.Validation
cargo build --all-targetscargo testcargo clippy --all-targets --all-features --workspace -- -D warningsCreated 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.