-
Notifications
You must be signed in to change notification settings - Fork 7
feat: improve MSAL module version checking to be more permissive #3376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Refactor version checking logic into dedicated versioning module - Make version checking more permissive for minor and patch versions - Add comprehensive test coverage for version resolution - Improve error messages and warnings for version mismatches - Update spec to reflect new branch naming convention Closes #3375
🦋 Changeset detectedLatest commit: 59ae6a4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this 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 MSAL module version checking to be more permissive for minor and patch versions while maintaining strict checking for major version incompatibilities.
- Version checking now allows minor version differences with warnings instead of failures
- Patch version differences are completely ignored for maximum compatibility
- Comprehensive versioning module with dedicated error handling and test coverage
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
specs/0002-improve-msal-versioning/spec.md | Feature specification documenting version checking requirements and acceptance criteria |
packages/modules/msal/vitest.config.ts | Added Vitest configuration for test execution |
packages/modules/msal/tsconfig.json | Updated TypeScript config to exclude test files from compilation |
packages/modules/msal/src/versioning/types.ts | TypeScript type definitions for version resolution results |
packages/modules/msal/src/versioning/static.ts | Enum definitions for version message types |
packages/modules/msal/src/versioning/resolve-version.ts | Core version resolution logic with permissive checking |
packages/modules/msal/src/versioning/index.ts | Public API exports for the versioning module |
packages/modules/msal/src/versioning/create-version-message.ts | Helper function for generating human-readable version messages |
packages/modules/msal/src/versioning/VersionError.ts | Custom error class for version-related issues |
packages/modules/msal/src/v2/provider.ts | Updated import path to use new versioning module |
packages/modules/msal/src/resolve-version.ts | Deleted legacy version resolution file |
packages/modules/msal/src/tests/versioning/resolve-version.test.ts | Comprehensive test suite for version resolution |
packages/modules/msal/package.json | Added test script and updated dependencies |
packages/modules/msal/README.md | Added documentation for version management features |
Coverage Report
File Coverage
|
- Store version properties as strings instead of SemVer objects in VersionError - Add warnings array to ResolvedVersion for minor version mismatches - Improve type safety by using type imports where appropriate - Collect warnings instead of immediately logging them for better control
There was a problem hiding this 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 15 out of 15 changed files in this pull request and generated 2 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
tsc
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 140 in cc4f2c1
expect(versionError.requestedVersion.version).toBe('5.0.0'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 141 in cc4f2c1
expect(versionError.latestVersion.version).toBe('4.0.9'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 140 in cc4f2c1
expect(versionError.requestedVersion.version).toBe('5.0.0'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 141 in cc4f2c1
expect(versionError.latestVersion.version).toBe('4.0.9'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 140 in cc4f2c1
expect(versionError.requestedVersion.version).toBe('5.0.0'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 141 in cc4f2c1
expect(versionError.latestVersion.version).toBe('4.0.9'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 140 in cc4f2c1
expect(versionError.requestedVersion.version).toBe('5.0.0'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 141 in cc4f2c1
expect(versionError.latestVersion.version).toBe('4.0.9'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 140 in cc4f2c1
expect(versionError.requestedVersion.version).toBe('5.0.0'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 141 in cc4f2c1
expect(versionError.latestVersion.version).toBe('4.0.9'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 140 in cc4f2c1
expect(versionError.requestedVersion.version).toBe('5.0.0'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 141 in cc4f2c1
expect(versionError.latestVersion.version).toBe('4.0.9'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 140 in cc4f2c1
expect(versionError.requestedVersion.version).toBe('5.0.0'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 141 in cc4f2c1
expect(versionError.latestVersion.version).toBe('4.0.9'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 140 in cc4f2c1
expect(versionError.requestedVersion.version).toBe('5.0.0'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 141 in cc4f2c1
expect(versionError.latestVersion.version).toBe('4.0.9'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 140 in cc4f2c1
expect(versionError.requestedVersion.version).toBe('5.0.0'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 141 in cc4f2c1
expect(versionError.latestVersion.version).toBe('4.0.9'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 140 in cc4f2c1
expect(versionError.requestedVersion.version).toBe('5.0.0'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 141 in cc4f2c1
expect(versionError.latestVersion.version).toBe('4.0.9'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 140 in cc4f2c1
expect(versionError.requestedVersion.version).toBe('5.0.0'); |
🚫 [tsc] <2339> reported by reviewdog 🐶
Property 'version' does not exist on type 'string'.
fusion-framework/packages/modules/msal/src/__tests__/versioning/resolve-version.test.ts
Line 141 in cc4f2c1
expect(versionError.latestVersion.version).toBe('4.0.9'); |
- Replace console.warn with structured warnings in resolveVersion return - Update VersionError to use string versions instead of SemVer objects - Simplify test setup by removing console.warn mocking - Fix type import for SemVer in resolve-version.ts - Improve error type consistency (TypeError -> VersionError)
There was a problem hiding this 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 15 out of 15 changed files in this pull request and generated 1 comment.
- Replace unsafe type assertion with explicit undefined check - Throw VersionError when no matching enum version is found - Update tests to expect errors for unsupported major versions - Ensures type safety and proper error handling for invalid versions
Why
This PR introduces improvements to the MSAL module version checking to be more permissive for minor and patch versions.
What is the current behavior?
The MSAL module currently has strict version checking that can cause failures when different parts of an application use slightly different minor or patch versions of the MSAL module.
What is the new behavior?
Does this PR introduce a breaking change?
No, this change maintains backward compatibility with existing MSAL module configurations.
Other information?
This refactors the version checking logic into a dedicated versioning module with comprehensive test coverage.
Testing
Review Testing Steps
gh pr checkout 3376
closes: #3375
Check off the following:
Confirm that I checked changes to branch which I am merging into.
Confirm that the I have completed the self-review checklist.
Confirm that my changes meet our code of conduct.