Skip to content

feat(ir): add typed builder for Maven@3#1122

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
ir/maven-v3-typed-builder-a084794e0c57a0ea
Open

feat(ir): add typed builder for Maven@3#1122
github-actions[bot] wants to merge 1 commit into
mainfrom
ir/maven-v3-typed-builder-a084794e0c57a0ea

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed builder struct for Maven@3 to the ado-aw IR.

Motivation

Previously, any code that needed to emit a Maven build step had to hand-craft
TaskStep::new("Maven@3", ...) with raw string input keys. This PR introduces
a typed builder struct (new(maven_pom_file) + typed optional setters +
into_step()) so the POM-file path is positional, all optional inputs and
their constrained values are type-checked, and call sites stop using
stringly-typed keys.

Three typed enums make constrained values unrepresentable with wrong strings:

  • CodeCoverageToolNone | Cobertura | JaCoCo
  • JdkVersionDefault | V21 | V17 | V11 | V10 | V9 | V8 | V7 | V6
  • JdkArchitectureX86 | X64 | Arm64

Changes

  • src/compile/ir/tasks/maven.rs: new Maven builder struct with typed enums
    and 12 #[cfg(test)] unit tests covering all input groups
  • src/compile/ir/tasks/mod.rs: pub mod maven; declaration (alphabetical)

ADO Task Reference

  • Task: Maven@3
  • Docs: (https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/maven-v3)
  • Required inputs: mavenPOMFile
  • Optional inputs: goals, options, publishJUnitResults, testResultsFiles,
    testRunTitle, allowBrokenSymlinks, codeCoverageToolOption,
    codeCoverageClassFilter, codeCoverageClassFilesDirectories,
    codeCoverageSourceDirectories, codeCoverageFailIfEmpty,
    codeCoverageRestoreOriginalPomXml, jdkVersionOption,
    jdkArchitectureOption, mavenOptions, mavenAuthenticateFeed,
    checkStyleRunAnalysis, pmdRunAnalysis, spotBugsRunAnalysis

Validation

  • cargo build --all-targets
  • cargo test — 12 new unit tests, all pass, no existing tests broken
  • 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 · 969.1 AIC · ⌖ 44.7 AIC · ⊞ 38.1K ·

Add `maven::Maven` builder struct to `src/compile/ir/tasks/maven.rs`.

The builder covers the most commonly used inputs for Maven@3:
- `mavenPOMFile` (required positional)
- Build: `goals`, `options`
- JUnit results: `publishJUnitResults`, `testResultsFiles`, `testRunTitle`, `allowBrokenSymlinks`
- Code coverage: `codeCoverageToolOption` (typed `CodeCoverageTool` enum), class/source filters, fail-if-empty
- JDK: `jdkVersionOption` (typed `JdkVersion` enum), `jdkArchitectureOption` (typed `JdkArchitecture` enum)
- Advanced: `mavenOptions`, `mavenAuthenticateFeed`
- Code analysis: `checkStyleRunAnalysis`, `pmdRunAnalysis`, `spotBugsRunAnalysis`

Typed enums (`CodeCoverageTool`, `JdkVersion`, `JdkArchitecture`) make
constrained inputs unrepresentable with wrong values. 12 unit tests cover
required inputs, all optional groups, enum ADO tokens, and absent-by-default
behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request Jun 20, 2026
@jamesadevine jamesadevine marked this pull request as ready for review June 21, 2026 07:39
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