Skip to content

Update common UI infrastucture to point to ID4SLAB2, Fixes AB#3525444#2907

Open
fadidurah wants to merge 24 commits intodevfrom
fadi/lab-migrate
Open

Update common UI infrastucture to point to ID4SLAB2, Fixes AB#3525444#2907
fadidurah wants to merge 24 commits intodevfrom
fadi/lab-migrate

Conversation

@fadidurah
Copy link
Copy Markdown
Contributor

@fadidurah fadidurah commented Feb 23, 2026

Updating our ui infrastructure to point to ID4SLAB2 resources

  • Updated LAB api signatures
  • Updated UPN JSON fields
  • Rewire existing test classes to use the UPN JSON rather than LabQuery, which is no longer available on ID4SLAB2

AB#3525444

@fadidurah fadidurah requested a review from a team as a code owner February 23, 2026 23:02
Copilot AI review requested due to automatic review settings February 23, 2026 23:02
@github-actions
Copy link
Copy Markdown

❌ Work item link check failed. Description does not contain AB#{ID}.

Click here to Learn more.

Copy link
Copy Markdown
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 refactors lab test utilities to use a new static field LabClient.latestLabAccount for storing the most recently fetched/created lab account, replacing the previous pattern of using LabConfig.getCurrentLabConfig().getLabUserPassword(). It also adds support for new user account types (MAM_ON_SPO and CIAM) and includes test coverage for sovereign cloud accounts (US Government and China).

Changes:

  • Replaced LabConfig.getCurrentLabConfig() with LabClient.latestLabAccount for accessing test account credentials
  • Added MAM_ON_SPO and CIAM to UserType enum and LabConstants
  • Added associatedClientId field to LabJsonStringAccountEntry for capturing client association from KeyVault JSON
  • Added tests for fetching US Government and China cloud accounts

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
ResourceOwnerPasswordCredentialsTestStrategy.java Removed LabConfig import and updated getPasswordForUser to use LabClient.latestLabAccount
LabClientTest.java Added two new test methods canFetchUsGovAccount and canFetchChinaAccount to verify sovereign cloud account retrieval
UserType.java Added MAM_ON_SPO and CIAM enum values
LabConstants.java Added corresponding string constants MAM_ON_SPO and CIAM
LabJsonStringAccountEntry.java Added associatedClientId field with Gson serialization annotation
LabClient.java Added public static latestLabAccount field and updated three methods to populate it after creating/fetching accounts

@fadidurah fadidurah changed the title adjust lab stuff Update common UI infrastucture to point to ID4SLAB2 Mar 18, 2026
@fadidurah fadidurah added the No-Changelog This Pull-Request has no associated changelog entry. label Mar 18, 2026
@github-actions
Copy link
Copy Markdown

✅ Work item link check complete. Description contains link AB#3525444 to an Azure Boards work item.

@github-actions
Copy link
Copy Markdown

❌ Work item link check failed. Description contains AB#3525444 but the Bot could not link it to an Azure Boards work item.

Click here to learn more.

@github-actions github-actions Bot changed the title Update common UI infrastucture to point to ID4SLAB2 Update common UI infrastucture to point to ID4SLAB2, Fixes AB#3525444 Mar 18, 2026
@fadidurah fadidurah requested a review from Copilot April 27, 2026 17:29
@fadidurah
Copy link
Copy Markdown
Contributor Author

@copilot please address the spotbugs issue i am running into in checks

Found here: https://identitydivision.visualstudio.com/Engineering/_build/results?buildId=1627598&view=logs&j=fd490c07-0b22-5182-fac9-6d67fe1e939b&t=d5f99b8f-625a-5c99-5f01-32afb4db6921

Command to run: \gradlew.bat LabApiUtilities:spotbugsMain

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 27, 2026

@copilot please address the spotbugs issue i am running into in checks

Found here: https://identitydivision.visualstudio.com/Engineering/_build/results?buildId=1627598&view=logs&j=fd490c07-0b22-518...

Fixed in cb08f3b. The SpotBugs failure was caused by ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD — three instance methods in LabClient.java were directly assigning to the static field latestLabAccount.

Changes made:

  • Made latestLabAccount volatile (fixes thread-visibility and addresses the earlier review suggestion)
  • Added a private static setter setLatestLabAccount(ILabAccount) — writes to a static field from a static method are not flagged by SpotBugs
  • Replaced all three direct instance-method assignments (latestLabAccount = account) with calls to the new setter
  • Added Javadoc for both the field and the setter

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • identitydivision.visualstudio.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • www.puppycrawl.com
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.25.1/x64/codeql/xml/tools/xml-extractor.jar --fileList=/tmp/codeql-scratch-b2678d0398b00160/dbs/java/working/files-to-index8488669193070366573.list --sourceArchiveDir=/tmp/codeql-scratch-b2678d0398b00160/dbs/java/src --outputDir=/tmp/codeql-scratch-b2678d0398b00160/dbs/java/trap/java (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Copy Markdown
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

Copilot reviewed 22 out of 22 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

uiautomationutilities/src/main/java/com/microsoft/identity/client/ui/automation/rules/LoadLabUserTestRule.java:97

  • The thrown IllegalArgumentException message is now inaccurate: it says only query/temp user type are null, but this rule also supports jsonUserType. Update the message to reflect all supported inputs so failures are easier to diagnose.
                    Logger.i(TAG, "Loading Temp User for Test....");
                    mLabAccount = mLabClient.createTempAccount(tempUserType);
                } else {
                    throw new IllegalArgumentException("Both Lab User query and temp user type were null.");
                }

Copy link
Copy Markdown
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

Copilot reviewed 22 out of 22 changed files in this pull request and generated 8 comments.

@fadidurah fadidurah added the Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR label Apr 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

No-Changelog This Pull-Request has no associated changelog entry. Skip-Consumers-Check Only include this if making a breaking change purposefully, and there is an MSAL/ADAL/Broker PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants