Skip to content

Fix RS0017 warnings and enable TreatWarningsAsErrors for Release builds#315

Merged
jonathanpeppers merged 5 commits intomainfrom
copilot/fix-api-warnings
Mar 19, 2026
Merged

Fix RS0017 warnings and enable TreatWarningsAsErrors for Release builds#315
jonathanpeppers merged 5 commits intomainfrom
copilot/fix-api-warnings

Conversation

Copy link
Contributor

Copilot AI commented Mar 19, 2026

Summary

Fixes RS0017 warnings caused by a stale ProcessUtils.StartProcess signature in the PublicAPI.Shipped.txt files, and enables TreatWarningsAsErrors for Release builds to prevent similar regressions going forward.

Changes

  1. Restore old StartProcess overload in ProcessUtils.cs:
    The old StartProcess signature (without environmentVariables parameter) was a shipped API that was inadvertently removed when environmentVariables was added to the method. Restored it as a backward-compatible overload that delegates to the new method. Suppressed RS0027 on the shim since the shipped API already declares the optional parameter.

  2. Add convenience StartProcess overload in ProcessUtils.cs:
    Added a new overload that accepts environmentVariables without requiring onStarted, so callers don't need to pass a trailing null. This overload delegates to the full 6-parameter method.

  3. Update PublicAPI.Unshipped.txt (both netstandard2.0 and net10.0):
    Added entries for both the 6-parameter StartProcess overload (with environmentVariables and onStarted) and the 5-parameter convenience overload (with environmentVariables only).

  4. Enable TreatWarningsAsErrors for Release configuration in Directory.Build.props:
    CI will now fail on any warnings in Release builds, preventing future API tracking issues from going unnoticed.


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…hipped.txt; enable TreatWarningsAsErrors for Release

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>

This comment was marked as outdated.

jonathanpeppers and others added 2 commits March 19, 2026 08:53
…lers and PublicAPI files

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI requested a review from jonathanpeppers March 19, 2026 13:55
@jonathanpeppers jonathanpeppers marked this pull request as ready for review March 19, 2026 13:58
Copilot AI review requested due to automatic review settings March 19, 2026 13:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses API analyzer (RS0017/RS0026/RS0027) warnings around ProcessUtils.StartProcess by restoring a shipped overload, adjusting the unshipped API declaration for the newer overload, updating internal call sites accordingly, and tightening build hygiene by enabling warnings-as-errors in Release builds.

Changes:

  • Reintroduced the shipped ProcessUtils.StartProcess(..., onStarted = null) overload as a compatibility shim delegating to the newer overload.
  • Updated PublicAPI.Unshipped.txt entries (netstandard2.0 + net10.0) to remove optional default values from the newer overload signature.
  • Updated runner call sites to pass an explicit null for onStarted when calling the environment-variable overload; enabled TreatWarningsAsErrors for Release builds.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Xamarin.Android.Tools.AndroidSdk/Runners/EmulatorRunner.cs Updates StartProcess invocation to pass explicit onStarted: null.
src/Xamarin.Android.Tools.AndroidSdk/Runners/AvdManagerRunner.cs Updates StartProcess invocations to pass explicit onStarted: null where unused.
src/Xamarin.Android.Tools.AndroidSdk/Runners/AdbRunner.cs Updates multiple StartProcess invocations to pass explicit onStarted: null.
src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt Adjusts unshipped API entry for the env-var overload to remove optional defaults.
src/Xamarin.Android.Tools.AndroidSdk/PublicAPI/net10.0/PublicAPI.Unshipped.txt Same unshipped API adjustment for net10.0.
src/Xamarin.Android.Tools.AndroidSdk/ProcessUtils.cs Restores shipped overload and defines the newer env-var overload without optional defaults.
Directory.Build.props Enables TreatWarningsAsErrors for Release configuration builds.

…lers and PublicAPI files

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
…rt caller changes

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
@jonathanpeppers jonathanpeppers merged commit afb540a into main Mar 19, 2026
2 checks passed
@jonathanpeppers jonathanpeppers deleted the copilot/fix-api-warnings branch March 19, 2026 14:15
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.

3 participants