Skip to content

Switch from Newtonsoft to MessagePack restore in fsi tests - #20205

Merged
abonie merged 3 commits into
mainfrom
bump-newtonsoft-in-fsi-tests
Aug 5, 2026
Merged

Switch from Newtonsoft to MessagePack restore in fsi tests#20205
abonie merged 3 commits into
mainfrom
bump-newtonsoft-in-fsi-tests

Conversation

@abonie

@abonieabonie commented Aug 4, 2026

Copy link
Copy Markdown
Member

Signed build fails because (I think) it tries to resolve offline and the previous Newtonsoft version is no longer cached.

Switching to MessagePack instead of Newtonsoft and using a centrally managed version to avoid future regressions of this kind.

@github-actions

Copy link
Copy Markdown
Contributor

✅ No release notes required

@github-actionsgithub-actionsBot added the AI-Tooling-Check-Bypassed Tooling check: non-fork PR, not diff-analyzed label Aug 4, 2026
@abonie
abonie requested a review from T-GroAugust 5, 2026 04:52
@abonieabonie changed the title Bump Newtonsoft version restored in fsi testsSwitch from Newtonsoft to FsCheck restore in fsi testsAug 5, 2026
The two FsiCliTests that exercise `#r "nuget:"` restore hardcoded
Newtonsoft.Json 13.0.3. After central package management with transitive
pinning was enabled, only the centrally-pinned version is restored into the
offline cache used by the internal signed build, so requesting 13.0.3 failed
there (version-resolution NUxxxx diagnostics on stdout).
Instead of hardcoding a version (which would silently drift on every central
bump), bake the centrally-pinned version into the test assembly via
AssemblyMetadata and read it at runtime. Switch the target package from
Newtonsoft.Json (a removal candidate) to MessagePack, which is actively
maintained, published on public nuget.org (so online public CI restore works)
and centrally pinned + restored transitively by the product (so it is present
in the internal offline cache).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9d1550-25ab-4466-ae43-8c7f106f4e49

@T-GroT-Gro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤖 This review was generated by AI (@expert-reviewer agent). Findings may contain inaccuracies — please verify independently.

No significant correctness, security, or performance issues found. The approach is sound and I verified the key mechanics locally:

  • MSBuild transform works: @(PackageVersion->WithMetadataValue('Identity','FsCheck')->'%(Version)') correctly resolves to the centrally-pinned 2.16.6 and is baked into the test assembly's AssemblyMetadata at static evaluation (confirmed via an isolated CPM repro). Note: -getProperty shows the raw expression, but the item Value is expanded at evaluation time as expected.
  • Runtime read is robust: reading AssemblyMetadataAttribute with Array.tryPick + Option.defaultWith (failwith ...) fails loudly if the metadata is missing, rather than silently requesting an empty version.
  • Offline-cache premise holds: FsCheck 2.16.6 is an actual PackageReference of tests/FSharp.Core.UnitTests, so it lands in the offline restore cache. Its only transitive dependency is FSharp.Core [4.2.3, ), which is always cached — so the FSI #r "nuget: FsCheck, ..." restore has everything it needs offline.

Minor (non-blocking) nit: the fsproj comment calls FsCheck a "standalone leaf library," but it does depend on FSharp.Core. That dependency is always cached, so it does not affect correctness — you may just want to soften the wording.

@github-project-automationgithub-project-automationBot moved this from New to In Progress in F# Compiler and ToolingAug 5, 2026
@abonieabonie changed the title Switch from Newtonsoft to FsCheck restore in fsi testsSwitch from Newtonsoft to MessagePack restore in fsi testsAug 5, 2026
@T-GroT-Gro added the AI-reviewed PR reviewed by AI review council label Aug 5, 2026
@T-Gro
T-Gro self-requested a review August 5, 2026 08:22
@abonie

Copy link
Copy Markdown
MemberAuthor

🤖 This review was generated by AI (@expert-reviewer agent). Findings may contain inaccuracies — please verify independently.

No significant correctness, security, or performance issues found. The approach is sound and I verified the key mechanics locally:

  • MSBuild transform works: @(PackageVersion->WithMetadataValue('Identity','FsCheck')->'%(Version)') correctly resolves to the centrally-pinned 2.16.6 and is baked into the test assembly's AssemblyMetadata at static evaluation (confirmed via an isolated CPM repro). Note: -getProperty shows the raw expression, but the item Value is expanded at evaluation time as expected.
  • Runtime read is robust: reading AssemblyMetadataAttribute with Array.tryPick + Option.defaultWith (failwith ...) fails loudly if the metadata is missing, rather than silently requesting an empty version.
  • Offline-cache premise holds: FsCheck 2.16.6 is an actual PackageReference of tests/FSharp.Core.UnitTests, so it lands in the offline restore cache. Its only transitive dependency is FSharp.Core [4.2.3, ), which is always cached — so the FSI #r "nuget: FsCheck, ..." restore has everything it needs offline.

Minor (non-blocking) nit: the fsproj comment calls FsCheck a "standalone leaf library," but it does depend on FSharp.Core. That dependency is always cached, so it does not affect correctness — you may just want to soften the wording.

@T-Gro Switched again from FsCheck to MessagePack

@abonie
abonie enabled auto-merge (squash) August 5, 2026 09:17
@abonie
abonie merged commit 11c59aa into mainAug 5, 2026
63 checks passed
@github-project-automationgithub-project-automationBot moved this from In Progress to Done in F# Compiler and ToolingAug 5, 2026
bartelink pushed a commit to bartelink/fsharp that referenced this pull request Aug 6, 2026
)
* Bump Newtonsoft version restored in fsi tests
* Switch from Newtonsoft to FsCheck for #r test
* Make FSI nuget-restore tests robust to central package management
The two FsiCliTests that exercise `#r "nuget:"` restore hardcoded
Newtonsoft.Json 13.0.3. After central package management with transitive
pinning was enabled, only the centrally-pinned version is restored into the
offline cache used by the internal signed build, so requesting 13.0.3 failed
there (version-resolution NUxxxx diagnostics on stdout).
Instead of hardcoding a version (which would silently drift on every central
bump), bake the centrally-pinned version into the test assembly via
AssemblyMetadata and read it at runtime. Switch the target package from
Newtonsoft.Json (a removal candidate) to MessagePack, which is actively
maintained, published on public nuget.org (so online public CI restore works)
and centrally pinned + restored transitively by the product (so it is present
in the internal offline cache).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9d1550-25ab-4466-ae43-8c7f106f4e49
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9d1550-25ab-4466-ae43-8c7f106f4e49
abonie added a commit that referenced this pull request Aug 19, 2026
* Switch from Newtonsoft to MessagePack restore in fsi tests (#20205)
* Bump Newtonsoft version restored in fsi tests
* Switch from Newtonsoft to FsCheck for #r test
* Make FSI nuget-restore tests robust to central package management
The two FsiCliTests that exercise `#r "nuget:"` restore hardcoded
Newtonsoft.Json 13.0.3. After central package management with transitive
pinning was enabled, only the centrally-pinned version is restored into the
offline cache used by the internal signed build, so requesting 13.0.3 failed
there (version-resolution NUxxxx diagnostics on stdout).
Instead of hardcoding a version (which would silently drift on every central
bump), bake the centrally-pinned version into the test assembly via
AssemblyMetadata and read it at runtime. Switch the target package from
Newtonsoft.Json (a removal candidate) to MessagePack, which is actively
maintained, published on public nuget.org (so online public CI restore works)
and centrally pinned + restored transitively by the product (so it is present
in the internal offline cache).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9d1550-25ab-4466-ae43-8c7f106f4e49
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9d1550-25ab-4466-ae43-8c7f106f4e49
* Switch to FsCheck for fsi restore tests (#20210)
* Switch to FsCheck for fsi restore tests
MessagePack has dependencies on net472 that are not cached on signed
builds. FsCheck depends on FSharp.Core, but that should be cached.
* Add logging in case of failed test
* Bump FSharp.Core servicing version to 10.1.401
10.1.400 is already published on nuget.org, so Check_Published_Package_Versions FSCore fails. Bump FSBuildVersion 400->401.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7d778863-b4d5-4e3d-95ba-980fd2eafc81
---------
Co-authored-by: Adam Boniecki <20281641+abonie@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9d1550-25ab-4466-ae43-8c7f106f4e49
Copilot-Session: 7d778863-b4d5-4e3d-95ba-980fd2eafc81
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-reviewedPR reviewed by AI review councilAI-Tooling-Check-BypassedTooling check: non-fork PR, not diff-analyzed

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants

@abonie@T-Gro