Skip to content

feat(ir): add typed builder for SonarQubePrepare@8 - #1226

Merged
jamesadevine merged 3 commits into
mainfrom
ir/sonar-qube-prepare-v8-dcb837d994b08dc2
Jul 1, 2026
Merged

feat(ir): add typed builder for SonarQubePrepare@8#1226
jamesadevine merged 3 commits into
mainfrom
ir/sonar-qube-prepare-v8-dcb837d994b08dc2

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Summary

Adds a typed builder struct for SonarQubePrepare@8 to the ado-aw IR under src/compile/ir/tasks/sonar_qube_prepare.rs.

Motivation

SonarQubePrepare@8 is a commonly used enterprise ADO task that configures SonarQube static analysis before build steps run. Previously, any code that needed to emit this step had to hand-craft TaskStep::new(...) with raw string input keys. This PR introduces a typed, mode-dispatch builder so required inputs are positional, per-mode optional inputs are type-checked, and invalid mode/input combinations are unrepresentable.

Changes

  • src/compile/ir/tasks/sonar_qube_prepare.rs: new SonarQubePrepare builder struct with:
    • ScannerMode enum (DotNet, Cli, Other) carrying per-mode data
    • DotNetModeprojectKey (required), optional projectName, projectVersion, msBuildVersion
    • CliMode::File(CliFileMode) — optional configFile, cliVersion
    • CliMode::Manual(CliManualMode)cliProjectKey (required), optional cliProjectName, cliProjectVersion, cliSources, cliVersion
    • SonarQubePrepare::other(endpoint) — Maven / Gradle integration (no extra inputs)
    • extra_properties and with_display_name on the top-level builder
    • 9 #[cfg(test)] unit tests
  • src/compile/ir/tasks/mod.rs: pub mod sonar_qube_prepare; declaration (alphabetical order)

ADO Task Reference

Validation

  • cargo build --all-targets
  • cargo test (9 new tests pass)
  • 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 · 1K AIC · ⌖ 32.3 AIC · ⊞ 38.7K ·

Add SonarQubePrepare builder in src/compile/ir/tasks/sonar_qube_prepare.rs.

SonarQubePrepare@8 is a mode-dispatch task: scannerMode selects between
dotnet, cli (file or manual sub-mode), and other (Maven/Gradle). Each
mode carries its own typed data so invalid mode/input combinations are
unrepresentable at compile time.

Constructors:
- SonarQubePrepare::dotnet(endpoint, DotNetMode::new(project_key))
- SonarQubePrepare::cli(endpoint, CliMode::File(CliFileMode::new()))
- SonarQubePrepare::cli(endpoint, CliMode::Manual(CliManualMode::new(key)))
- SonarQubePrepare::other(endpoint)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot mentioned this pull request Jun 27, 2026
jamesadevine and others added 2 commits July 1, 2026 14:41
…-v8-dcb837d994b08dc2

# Conflicts:
#	src/compile/ir/tasks/mod.rs
Integrates the SonarQubePrepare@8 typed builder with the front-matter task-step advisory validation added in #1096. Because this is a mode-dispatch task (scannerMode dotnet/cli/other, with a configMode file/manual sub-mode under cli), it supplies a bespoke validate_inputs that dispatches on the discriminators and validates each mode against a deny_unknown_fields schema, so an input supplied for the wrong mode is reported. Registered in parse.rs VALIDATORS. Mode tokens and defaults (scannerMode=dotnet, configMode=file) and the msBuildVersion/cliVersion aliases match the SonarSource v8 task.json.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jamesadevine
jamesadevine marked this pull request as ready for review July 1, 2026 13:47
@jamesadevine
jamesadevine merged commit b2a86e1 into main Jul 1, 2026
@jamesadevine
jamesadevine deleted the ir/sonar-qube-prepare-v8-dcb837d994b08dc2 branch July 1, 2026 13:47
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