Skip to content

Conversation

@Avery-Dunn
Copy link
Contributor

@Avery-Dunn Avery-Dunn commented Jan 5, 2026

Continues the lab migration work begun in #5558 and other PRs based on discussions and similar refactoring done in AzureAD/microsoft-authentication-library-for-java#1002

In short, these changes remove the last pieces of the old API-based system of retrieving test config in favor of the new key vault-based approach, and should make the Microsoft.Identity.Test.LabInfrastructure package easier to maintain going forward by simplifying the various helper classes/methods

Although a lot of files were changed, the majority of them don't need a deep review: they are test classes that were only changed to use the new helper class/method names and behavior, each file received the same sort of adjustment, and no test behavior was actually changed.

The only files that need a real review are in the Microsoft.Identity.Test.LabInfrastructure namespace, and here is a brief summary of the changes:

  • Simplify the helper classes/methods and clarify what they are doing, and allow integration tests to retrieve only the configuration they need
    • LabResponse: Previously just a container for user/app/lab config JSON classes, deleted in favor of separate XYZConfig classes
    • AppConfig and UserConfig: Represents the JSON-based configurations stored in the key vault
    • KeyVaultSecrets: Added to store the names of secrets in our key vaults, rather than hardcoding them in helper methods
    • KeyVaultSecretsProvider: Minor changes to comments to clarify what the key vaults are used for
    • LabResponseHelper: The main helper for retrieving configuration from the key vault, and the class that received the most meaningful changes
      • Renamed from LabUserHelper, as it does more than user config
      • Removed numerous GetXYZUserAsync methods which had hardcoded secret names and, despite the name, returned a merged response containing user, app, and lab configuration
      • Added GetUserConfigAsync and GetAppConfigAsync methods to return separate XYZConfig instances based on key vault secret names
      • Added three ConcurrentDictionary fields to cache deserialized JSON config responses from the key vault
  • Remove the last references to the Lab API
    • LabApiConstants: Previously stored query parameters and other constants for API calls, deleted because those calls are no longer made
    • LabServiceParameters: Previously stored numerous enums that were compared to results in API calls, deleted in favor of a simpler LabConstants file as the vast majority weren't actually used
    • LabConstants: Remnants of the enums that were in LabServiceParameters, left here to avoid changing tests and making this PR even larger
    • LabServiceApi: Previously was the main API helper class, deleted because those calls are no longer made
    • UserQueryParameters and LabUserNotFoundException: Previously used only to help format a strings in a few debug logs, deleted in favor of simpler error message behavior

@Avery-Dunn Avery-Dunn requested a review from a team as a code owner January 5, 2026 16:43
@bgavrilMS
Copy link
Member

@MZOLN @gladjohn @cpp11nullptr - can you please review this as this introduces breaking changes to the lab API

Copy link
Contributor

@RyAuld RyAuld left a comment

Choose a reason for hiding this comment

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

Reviewed changes with Bogdan during labsync.

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.

5 participants