fix(windows_esp): resolve app validation pagination limit by querying apps individually #889
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes validation error in the Windows Enrollment Status Page resource where app ID validation would fail for applications that weren't in the first 250 results from the Microsoft Graph API. The validation logic now queries apps individually by ID instead of fetching a paginated list, eliminating the pagination limit issue.
Issue Reference
Resolves validation error:
supplied app ID '01e267f2-eb89-41b0-a771-09569d65cdda' does not match any valid Windows app typesMotivation and Context
top := int32(250)), causing validation to fail for any app IDs not in that initial batchByMobileAppId(appIdValue).Get(ctx, nil)Dependencies
No new dependencies required. Changes use existing Microsoft Graph Beta SDK patterns.
Type of Change
Please mark the relevant option with an
x:Testing
Changes Made
validate.godeviceappmanagementimportgraphmodelsimport for SDK type assertions*graphmodels.Win32LobApp,*graphmodels.WinGetApp, etc.)mocks/responders.go=~^https://graph\.microsoft\.com/beta/deviceAppManagement/mobileApps/[0-9a-fA-F-]+$@odata.typeandid)Quality Checklist
constructResource()- no additional integration neededScreenshots/Recordings (if appropriate)
[Add screenshots or recordings that demonstrate the changes]
Additional Notes
Technical Details
Validation Flow:
/deviceAppManagement/mobileApps/{appId}Supported Windows App Types:
WindowsAppXWindowsMobileMSIWindowsUniversalAppXOfficeSuiteAppWindowsMicrosoftEdgeAppWinGetAppWin32LobAppWin32CatalogAppMock Test App IDs:
12345678-1234-1234-1234-123456789012(Win32LobApp)87654321-4321-4321-4321-210987654321(WinGetApp)e4938228-aab3-493b-a9d5-8250aa8e9d55(Win32LobApp)e83d36e1-3ff2-4567-90d9-940919184ad5(Win32LobApp)cd4486df-05cc-42bd-8c34-67ac20e10166(Win32LobApp)Files Changed
internal/services/resources/device_management/graph_beta/windows_enrollment_status_page/validate.gointernal/services/resources/device_management/graph_beta/windows_enrollment_status_page/mocks/responders.go