feat(ir): add tasks module with typed helper for PublishTestResults@2#1012
Merged
jamesadevine merged 1 commit intoJun 14, 2026
Merged
Conversation
Introduces `src/compile/ir/tasks.rs` — a new home for typed factory functions for ADO built-in pipeline tasks. The first entry is `publish_test_results_step(format, files)`, which returns a pre-configured `TaskStep` for `PublishTestResults@2`. Required inputs (`testResultsFormat`, `testResultsFiles`) are positional parameters; optional inputs (`testRunTitle`, `mergeTestResults`, `searchFolder`, `failTaskOnFailedTests`, `publishRunAttachments`) are applied via the existing `.with_input(…)` builder on the returned value. Three unit tests cover the required-inputs contract, all five supported format identifiers, and the optional-input extension pattern. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jamesadevine
approved these changes
Jun 14, 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
Introduces
src/compile/ir/tasks.rs— a new module that will serve as the canonical home for typed factory functions for ADO built-in pipeline tasks. The first entry ispublish_test_results_step, a well-typed helper forPublishTestResults@2.Motivation
Previously, any compiler code that needed to emit
PublishTestResults@2had to hand-craftTaskStep::new("PublishTestResults@2", ...).with_input(...).with_input(...)inline, duplicating the raw string input keys. This PR introduces a single source of truth for that task's required/optional input contract.Changes
src/compile/ir/tasks.rs(new):publish_test_results_step(format, files)factory function with full doc comment listing all supported optional inputs.src/compile/ir/mod.rs: addspub mod tasks;to expose the new module.publish_test_results_stepsignatureOptional inputs applied via
.with_input(...):testRunTitlesearchFolder$(System.DefaultWorkingDirectory)mergeTestResults"false"failTaskOnFailedTests"false"publishRunAttachments"true"ADO Task Reference
PublishTestResults@2testResultsFormat,testResultsFilestestRunTitle,searchFolder,mergeTestResults,failTaskOnFailedTests,failTaskOnFailureToPublishResults,failTaskOnMissingResultsFile,publishRunAttachmentsTests
Three unit tests in
src/compile/ir/tasks.rs:publish_test_results_step_sets_task_and_required_inputs— verifies task id, display name, and both required inputspublish_test_results_step_accepts_all_supported_formats— smoke-tests all five format identifierspublish_test_results_step_optional_inputs_via_with_input— verifies the.with_input(...)extension patternValidation
cargo build --all-targets— cleancargo test— 1853 + 3 new tests pass, 0 failurescargo clippy --all-targets --all-features --workspace -- -D warnings— cleanCreated 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.