Skip to content

feat(ir): add typed builder for TwineAuthenticate@1#1158

Merged
jamesadevine merged 1 commit into
mainfrom
feat/ir-twine-authenticate-v1-386908f9ee0d49cc
Jun 23, 2026
Merged

feat(ir): add typed builder for TwineAuthenticate@1#1158
jamesadevine merged 1 commit into
mainfrom
feat/ir-twine-authenticate-v1-386908f9ee0d49cc

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed builder struct for TwineAuthenticate@1 to the ado-aw IR.

Motivation

TwineAuthenticate@1 is the current (non-deprecated) version of the Python
package 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 sites
avoid stringly-typed input keys.

This builder complements the existing PipAuthenticate@1 (install-time
download auth) with the corresponding upload-time auth needed for Python
package publishing workflows.

Changes

  • src/compile/ir/tasks/twine_authenticate.rs: new TwineAuthenticate builder 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

  • Task: TwineAuthenticate@1
  • Docs: https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/twine-authenticate-v1
  • Required inputs: (none — both are optional)
  • Optional inputs:
    • artifactFeed — Azure Artifacts feed name (single feed; supports project/feed scoped form)
    • pythonUploadServiceConnection — service connection name for an external PyPI-compatible endpoint

Usage 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@0 is scheduled for deprecation in June 2026; this builder targets V1.

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 · 990 AIC · ⌖ 29.9 AIC · ⊞ 38.1K ·

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 jamesadevine marked this pull request as ready for review June 23, 2026 05:50
@jamesadevine jamesadevine merged commit 096c8f1 into main Jun 23, 2026
@jamesadevine jamesadevine deleted the feat/ir-twine-authenticate-v1-386908f9ee0d49cc branch June 23, 2026 05:51
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