Skip to content

Report missing Fast Deployment packages as XA0132 - #12060

Merged
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-fast-deployment-issue
Jul 14, 2026
Merged

Report missing Fast Deployment packages as XA0132#12060
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-fast-deployment-issue

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

A successful-looking pm install can leave the package absent, including on CI emulators under storage pressure. After the existing reinstall attempt, Fast Deployment previously fell through to run-as, misreporting this condition as XA0137.

  • Missing-package handling
    • Stop deployment when pm path still finds no package after forced reinstall.
    • Report XA0132 (PackageNotInstalled) instead of invoking run-as.
if (!await IsPackageInstalled (PackageName)) {
	LogDiagnosticDataError ("XA0132", Resources.XA0132_PackageNotInstalled);
	PrintDiagnostics ();
	LogCodedError ("XA0132", Resources.XA0132_PackageNotInstalled);
	return;
}
  • Diagnostics

    • Preserve the existing pm path and /data free-space diagnostics for CI/infra investigation.
  • Coverage

    • Add focused tests for pm path output classification.

Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix race condition with run-as command in Fast Deployment Report missing Fast Deployment packages as XA0132 Jul 13, 2026
Copilot AI requested a review from simonrozsival July 13, 2026 20:40
@simonrozsival
simonrozsival marked this pull request as ready for review July 14, 2026 10:47
Copilot AI review requested due to automatic review settings July 14, 2026 10:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates Fast Deployment’s post-pm install verification so that if pm path <pkg> still fails to report the package after a forced reinstall, deployment stops and reports XA0132 (PackageNotInstalled) instead of continuing into the run-as probe (which previously could misreport this condition as XA0137). Adds unit tests covering the pm path output classification helper.

Changes:

  • Stop FastDeploy deployment and emit XA0132 when pm path still shows no package after a reinstall attempt.
  • Refactor pm path output detection into FastDeploy.IsPackageInstalledOutput.
  • Add unit tests validating pm path output classification.
Show a summary per file
File Description
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/DebuggingTasksTests.cs Adds unit tests for pm path output classification via FastDeploy.IsPackageInstalledOutput.
src/Xamarin.Android.Build.Debugging.Tasks/Tasks/FastDeploy.cs Treats persistent missing-package after reinstall as XA0132 and factors pm path output parsing into a helper.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

@jonathanpeppers
jonathanpeppers merged commit 96da1ca into main Jul 14, 2026
45 checks passed
@jonathanpeppers
jonathanpeppers deleted the copilot/fix-fast-deployment-issue branch July 14, 2026 19:06

@Redbone8686 Redbone8686 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fast Deployment XA0137 (run-as 'couldn't stat') races install on the PRIMARY user (user 0) ~daily in CI

5 participants