Skip to content

Use AsyncTask thread-safe logging helpers in MavenDownload#12024

Merged
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-async-task-logging-helpers
Jul 9, 2026
Merged

Use AsyncTask thread-safe logging helpers in MavenDownload#12024
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-async-task-logging-helpers

Conversation

Copilot AI commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

MavenDownload derives from AsyncTask but still used six direct Log.Log* calls inside async/background execution paths. This updates those call sites to AsyncTask’s thread-safe logging helpers while preserving existing messages and XA error codes.

  • Logging API alignment in MavenDownload

    • Replaced direct calls:
      • Log.LogMessage(...)LogMessage(...) (3 sites)
      • Log.LogCodedError(...)LogCodedError(...) (3 sites)
    • No text/code changes: all log message templates and XA4237/XA4252/XA4239 values remain unchanged.
  • Scope intentionally constrained

    • Kept Log usages passed as an argument to helper APIs unchanged (GetRequiredMetadata, TryParseArtifactWithVersion, DownloadPayload), since those APIs require TaskLoggingHelper.
// Before
Log.LogMessage ("Found POM file '{0}' for Java artifact '{1}'.", primary_pom, artifact);
Log.LogCodedError ("XA4237", Properties.Resources.XA4237, artifact, ex.Unwrap ().Message);

// After
LogMessage ("Found POM file '{0}' for Java artifact '{1}'.", primary_pom, artifact);
LogCodedError ("XA4237", Properties.Resources.XA4237, artifact, ex.Unwrap ().Message);

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix use of thread-safe AsyncTask logging in MavenDownload task Use AsyncTask thread-safe logging helpers in MavenDownload Jul 9, 2026
Copilot AI requested a review from jonathanpeppers July 9, 2026 03:02
@jonathanpeppers jonathanpeppers marked this pull request as ready for review July 9, 2026 17:30
Copilot AI review requested due to automatic review settings July 9, 2026 17:30
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jul 9, 2026

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

This PR updates the MavenDownload MSBuild task (which derives from AsyncTask) to use AsyncTask’s thread-safe logging helper methods instead of calling TaskLoggingHelper.Log* directly from async/background execution paths.

Changes:

  • Replaced Log.LogMessage(...) with LogMessage(...) at three call sites.
  • Replaced Log.LogCodedError(...) with LogCodedError(...) at three call sites.

return null;

Log.LogMessage ("Found library '{0}' for Java artifact '{1}'.", artifact_file, artifact);
LogMessage ("Found library '{0}' for Java artifact '{1}'.", artifact_file, artifact);
@jonathanpeppers jonathanpeppers merged commit ab0beeb into main Jul 9, 2026
43 checks passed
@jonathanpeppers jonathanpeppers deleted the copilot/fix-async-task-logging-helpers branch July 9, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix-finder] Use thread-safe AsyncTask logging helpers in MavenDownload task

4 participants