Skip to content

Remove Microsoft.Bcl.Memory 9.0 in Wilson #3220

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

Merged
merged 10 commits into from
May 13, 2025

Conversation

mdchennu
Copy link
Contributor

@mdchennu mdchennu commented May 6, 2025

Remove Microsoft.Bcl.Memory 9.0 in Wilson

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • If any gains or losses in performance are possible, you've included benchmarks for your changes. More info
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Summary of the changes (Less than 80 chars)

Description

This PR removes the reference to Microsoft.Bcl.Memory in Wilson, and replaces it with the older version referenced here: Use new Base64Url API (#2817) · AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet@c0eb23c.

The proposal includes three steps as below. This PR covers the first step listed below.

Proposal:

Covered in this PR

  • Microsoft.Bcl.Memory is only for pre-net9 TFM; the new APIs are available in .NET 9. Remove this dependency and restore older implementation for netstandard2.0 and lower TFMs.

Fixes #3224 (in this specific format)

For Testing:

  1. Updated code
  2. Ran all the tests for TFMS + all of them passed
  3. Create a unified build against my branch -> build was successful: https://identitydivision.visualstudio.com/DevEx/_build/results?buildId=1476634&view=results

@mdchennu mdchennu changed the title started merging for Base64UrlEncoder, need to work on decoding Remove Microsoft.Bcl.Memory 9.0 in Wilson May 6, 2025
@mdchennu mdchennu marked this pull request as ready for review May 8, 2025 16:14
@mdchennu mdchennu requested a review from a team as a code owner May 8, 2025 16:14
Copy link

github-actions bot commented May 8, 2025

Summary

Summary
Generated on: 5/8/2025 - 4:28:18 PM
Coverage date: 5/8/2025 - 4:18:02 PM - 5/8/2025 - 4:27:50 PM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

@pmaytak
Copy link
Contributor

pmaytak commented May 8, 2025

One more comment: I'm splitting the work into two PRs as below:

Covered in this PR

Microsoft.Bcl.Memory is only for pre-net9 TFM; the new APIs are available in .NET 9. Remove this dependency and restore older implementation for netstandard2.0 and lower TFMs.

Covered in next PR

Remove System.Text.Json reference for net9.0 TFM Update Microsoft.Extensions.Logging.Abstractions to 8.0.0 for .NET9.0 from 8.0.2

I was thinking this makes sense because:

  1. To separate out changes
  2. reduce size of PR for ease of review

Is that alright to do or should I keep it all in one?

+1 to separating the PRs.

@sruke
Copy link
Contributor

sruke commented May 8, 2025

One more comment: I'm splitting the work into two PRs as below:
Covered in this PR
Microsoft.Bcl.Memory is only for pre-net9 TFM; the new APIs are available in .NET 9. Remove this dependency and restore older implementation for netstandard2.0 and lower TFMs.
Covered in next PR
Remove System.Text.Json reference for net9.0 TFM Update Microsoft.Extensions.Logging.Abstractions to 8.0.0 for .NET9.0 from 8.0.2
I was thinking this makes sense because:

  1. To separate out changes
  2. reduce size of PR for ease of review

Is that alright to do or should I keep it all in one?

+1 to separating the PRs.

Like the idea of splitting the work this way.

@pmaytak
Copy link
Contributor

pmaytak commented May 9, 2025

We should remove the SuppressTfmSupportBuildWarnings flag and verify with the builds that we don't get the unsupported TFM warnings.

https://github.com/search?q=repo%3AAzureAD%2Fazure-activedirectory-identitymodel-extensions-for-dotnet%20Microsoft.Bcl.Memory&type=code

@mdchennu
Copy link
Contributor Author

mdchennu commented May 9, 2025

We should remove the SuppressTfmSupportBuildWarnings flag and verify with the builds that we don't get the unsupported TFM warnings.

https://github.com/search?q=repo%3AAzureAD%2Fazure-activedirectory-identitymodel-extensions-for-dotnet%20Microsoft.Bcl.Memory&type=code

Okay sounds good. I removed the flag, and will check the builds for warnings once they are ready.

Copy link

github-actions bot commented May 9, 2025

Summary

Summary
Generated on: 5/9/2025 - 5:09:56 PM
Coverage date: 5/9/2025 - 4:59:04 PM - 5/9/2025 - 5:09:25 PM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

Copy link

github-actions bot commented May 9, 2025

Summary

Summary
Generated on: 5/9/2025 - 10:06:59 PM
Coverage date: 5/9/2025 - 9:56:21 PM - 5/9/2025 - 10:06:22 PM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

Copy link

Summary

Summary
Generated on: 5/12/2025 - 2:55:36 PM
Coverage date: 5/12/2025 - 2:44:39 PM - 5/12/2025 - 2:54:57 PM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

Copy link

Summary

Summary
Generated on: 5/12/2025 - 9:58:06 PM
Coverage date: 5/12/2025 - 9:47:37 PM - 5/12/2025 - 9:57:34 PM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

Copy link

Summary

Summary
Generated on: 5/13/2025 - 4:27:22 PM
Coverage date: 5/13/2025 - 4:16:56 PM - 5/13/2025 - 4:26:50 PM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

@sruke
Copy link
Contributor

sruke commented May 13, 2025

nit: Consider moving the preprocessor directives inside the method if all targets share the same API signature. To keep the file clean, you could introduce a static class (e.g., LegacyBaseUrlEncoder) for pre-.NET 9 implementations, either in this PR or a follow-up cleanup.

@mdchennu mdchennu merged commit 33784b8 into dev May 13, 2025
6 of 8 checks passed
@mdchennu mdchennu mentioned this pull request May 14, 2025
5 tasks
@pmaytak pmaytak deleted the mallikac/remove-bcl-memory-from-wilson branch May 30, 2025 21:25
@pmaytak pmaytak restored the mallikac/remove-bcl-memory-from-wilson branch May 30, 2025 21:25
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.

Remove Microsoft.Bcl.Memory 9.0 in Wilson netstandard 2.0 build depends on Microsoft.Bcl.Memory causing conflict with Indexes provided by IndexRange
5 participants