Skip to content

Suppress MAR fallback noise in Save/Install and remove test-oriented information output - #2014

Open
Sydney Smith (SydneyhSmith) with Copilot wants to merge 4 commits into
masterfrom
copilot/fix-unneeded-logs-errors
Open

Sydney Smith (SydneyhSmith) with Copilot wants to merge 4 commits into
masterfrom
copilot/fix-unneeded-logs-errors

Conversation

Copilot AI commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

When MAR is searched before other repositories, normal 404 Not Found responses for packages not present in MAR were being emitted as user-visible errors, even when a later repository could satisfy the request. In addition, container registry auth-path internals were emitting Information-stream messages used only by tests.

  • Container registry fallback error classification

    • Updated ContainerRegistryServerAPICalls.GetHttpResponseJObjectUsingDefaultHeaders(...) to classify ResourceNotFoundException as:
      • FullyQualifiedErrorId = "PackageNotFound"
      • ErrorCategory = ObjectNotFound
    • This aligns MAR 404 behavior with existing fallback logic so per-repository misses do not surface as misleading user errors during multi-repo search.
  • Removed test-only Information stream output

    • Replaced WriteInformation("Value of isRepositoryUnauthenticated: ...") with WriteDebug(...) in container registry auth flow.
    • Eliminates noisy Information output from normal cmdlet usage while preserving diagnosability via Debug stream.
  • Adjusted affected tests to match intended behavior

    • Updated publish/save/install tests that previously asserted MAR fallback noise or relied on Information-stream internals.
    • New expectations validate no extra error/info output for successful fallback scenarios.
catch (ResourceNotFoundException e)
{
    errRecord = new ErrorRecord(
        exception: e,
        "PackageNotFound",
        ErrorCategory.ObjectNotFound,
        _cmdletPassedIn);
}
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.
Copilot AI linked an issue Jul 21, 2026 that may be closed by this pull request
3 tasks done
Copilot AI changed the title [WIP] Fix multiple Cmdlets emitting unneeded logs and errors Jul 21, 2026
@adityapatwardhan

Copy link
Copy Markdown
Member

/azp run

@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) marked this pull request as ready for review July 23, 2026 17:49
Copilot AI review requested due to automatic review settings July 23, 2026 17:49
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI 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.

Pull request overview

This PR reduces end-user noise during multi-repository Save/Install scenarios by treating container-registry (MAR) “not found” responses as normal per-repository misses (instead of user-visible errors), and removes test-oriented Information-stream output from the container registry auth flow.

Changes:

  • Reclassified container registry ResourceNotFoundException errors in GetHttpResponseJObjectUsingDefaultHeaders(...) as PackageNotFound / ObjectNotFound to align with fallback search behavior.
  • Replaced container registry auth-path WriteInformation(...) with WriteDebug(...) to avoid Information-stream noise in normal cmdlet usage.
  • Updated Save/Install/Publish tests to assert no extra error/info output for successful fallback scenarios.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/code/ContainerRegistryServerAPICalls.cs Adjusts container registry not-found error classification for fallback behavior; removes Information-stream output from auth flow.
test/SavePSResourceTests/SavePSResourceLocal.Tests.ps1 Updates expectations so successful fallback produces no per-repo error noise.
test/InstallPSResourceTests/InstallPSResourceRepositorySearching.Tests.ps1 Updates expectations for multi-repo search to avoid MAR “miss” errors when a lower-priority repo succeeds.
test/PublishPSResourceTests/PublishPSResourceContainerRegistryServer.Tests.ps1 Removes reliance on Information-stream internals for registry-auth assertions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@adityapatwardhan

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants