Skip to content

Q2 2026 — System.Text.Json migration + quarterly work - #5

Merged
michaldengusiak merged 11 commits into
HoareLea:masterfrom
SAM-BIM:sow/2026-Q2
Jun 27, 2026
Merged

michaldengusiak merged 11 commits into
HoareLea:masterfrom
SAM-BIM:sow/2026-Q2

Conversation

@michaldengusiak

Copy link
Copy Markdown
Contributor

Summary

Quarterly Q2 2026 work from the SAM-BIM fork merging back into the upstream.
Includes the Newtonsoft.Json → System.Text.Json.Nodes migration of the
entire SAM-BIM stack (per-repo PRs already merged into SAM-BIM's sow/2026-Q2).

Highlights of this quarter

  • All IJSAMObject implementations migrated from JObject/JArray/JToken to
    JsonObject/JsonArray/JsonNode.
  • FromJObject / ToJObject renamed to FromJsonObject / ToJsonObject.
  • System.Text.Json 10.0.8 replaces Newtonsoft.Json 13.0.3 in every csproj
    (except SAM_Revit which keeps Newtonsoft loadable for Revit's runtime).
  • Wire format preserved bit-for-bit (14 fixture round-trip tests in SAM/SAM.Tests).
  • 5 latent pre-existing bugs fixed (DateTime/string bleed, NCMData enum round-trip,
    Log identity loss, SearchWrapper missing type discriminator, RelationCollection
    wrong-jObject-passed).

Verification

  • Full BuildAlls_v3 RestoreCleanRebuild against the merged sow/2026-Q2 chain:
    0 errors, 144 artifacts.
  • All 32 per-repo migration PRs on SAM-BIM:sow/2026-Q2 passed build + spdx CI.
  • Local Rhino / Revit / Tas runtime smoke validated.

Test plan

  • Upstream CI builds (if configured)
  • Reviewer spot-check of IJSAMObject API rename
  • After merge, downstream forks sync master from upstream

🤖 Generated with Claude Code

michaldengusiak and others added 5 commits May 15, 2026 17:01
SAM-BIM core migrated from Newtonsoft.Json to System.Text.Json.Nodes.
- Replace each csproj's Newtonsoft package reference with System.Text.Json 10.0.8
- MultitaskerInput, MultitaskerOutput, MultitaskerVariable, Script:
  FromJObject/ToJObject -> FromJsonObject/ToJsonObject; JObject -> JsonObject;
  .Value<T>(key) -> indexer + GetValue<T>(); .Value<object>(key) -> indexer +
  Deserialize<object>()
- Resource scripts (files/resources/Core/Multitasker/scripts/*.cs) are
  Roslyn-compiled at runtime against the consumer's SAM.Core, so they need
  the same migration: drop unused 'using Newtonsoft.Json' and rewrite
  TestScript.cs's JsonConvert.DeserializeObject -> JsonNode.Parse

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
During the SAM-BIM Newtonsoft.Json -> System.Text.Json migration the
quarterly sow/2026-Q2 branch carries the binary-breaking change. CI needs
to consume the migrated SAM (and any sibling dep) from sow/2026-Q2, not
from master, until the quarter-end merge.

- Add "sow/2026-Q2" to push/pull_request branch triggers
- For each dep clone, ls-remote sow/2026-Q2 and prefer it when present;
  fall back to default branch (e.g. master) otherwise. After the quarter
  merges back to master, this fallback naturally restores prior behaviour.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Refines the previous workflow patch so CI on the migration PR can succeed
before anything has been merged. Each dep repo is cloned from:
1. github.head_ref (feature/remove-newtonsoft on these PRs) - has the
   migration right now on every dep
2. sow/2026-Q2 - source of truth after these PRs merge
3. default branch - source of truth after quarter-end merge

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The SPDX-check workflow requires the top 6 lines of every changed .cs file
to contain both:
  // SPDX-License-Identifier: LGPL-3.0-or-later
  // Copyright (c) 2020-2026 Michal Dengusiak & Jakub Ziolkowski and contributors
(with an en-dash between the years). Migration commits modified existing
files without preserving the header. Prepend the two lines now.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Remove Newtonsoft.Json — migrate to System.Text.Json.Nodes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e43f2684d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if(jObject.ContainsKey("Value"))
{
object value = jObject.Value<object>("Value");
object value = jObject["Value"]?.Deserialize<object>();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve primitive value types when deserializing Value

Using jObject["Value"]?.Deserialize<object>() changes the runtime type of JSON primitives to JsonElement instead of boxed primitives, so the subsequent TryConvert branches can fail and this.value is left as a JsonElement. This breaks round-tripping and downstream consumers that expect bool/int/double/string (for example when reading previously serialized multitasker variables), whereas the previous JObject.Value<object>("Value") path returned directly usable primitive objects.

Useful? React with 👍 / 👎.

Aligns the repo with the SAM-BIM workspace-wide pin to the LTS-aligned
System.Text.Json 8.0.5, replacing the previously pinned 10.0.8 preview.
* fix: pin AssemblyVersion/FileVersion to 1.0.0.0 (drop 1.0.* wildcard)

Eliminates CS1607 warnings and restores deterministic builds.
Aligns with the workspace's existing fixed-version files.

Scope: AssemblyInfo.cs + .csproj version attributes only.
The // commented-out template example is left intact for documentation.

* fix: add SPDX + copyright header to modified AssemblyInfo.cs and refresh .csproj <Copyright>

Satisfies the spdx-check workflow which requires every changed .cs file to declare
the LGPL-3.0-or-later SPDX identifier and the 2020-2026 attribution in its first 20 lines.

Also updates the stale '<Copyright>Copyright (c) 2020</Copyright>' line in .csproj files
to match the SPDX header style.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

* build: Directory.Build.props for centralised SAMVersion stamping

Mirrors SAM-BIM/SAM#7. Stage 2 of the AssemblyVersion versioning migration.

* fix: replace literal u{2013} escape with actual en-dash in SPDX header

PowerShell 5.1 doesn't support backtick-u escape sequences; the
apply-stage2.ps1 script leaked them as literal text in 'Copyright (c) 2020u{2013}2026'.

* fix: relax SAMVersion.g.cs Target condition to != 'true'

Codex P1 on SAM_LadybugTools#4: classic (non-SDK) csprojs don't set
GenerateAssemblyInfo at all, so the previous '== false' condition skipped
them. Switching to '!= true' catches both GenerateAssemblyInfo=false
(SDK projects with legacy AssemblyInfo.cs) AND empty (classic projects).

* ci: Codex P2 fixes — four-part SAMVersion, prefer head_ref for sow PRs

- Append .0 so SAMVersion is 4-part (AssemblyFileVersion expects 4 parts).
- Prefer github.head_ref when it matches sow/yyyy-Qx (release-promotion PRs).
- Mirrors SAM sow/2026-Q2 6d87d98e.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Mirrors SAM sow/2026-Q2. Adds AssemblyInformationalVersion attribute generation to
Path D's SAMVersion.g.cs Target — covers Grasshopper / Tas-bridge assemblies that
have GenerateAssemblyInfo=false, so they also get the CI commit SHA stamp in their
ProductVersion field. SDK projects pick up InformationalVersion via PropertyGroup
auto-gen as before. Local dev builds unchanged.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59f9ece524

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# Current sow branch: base_ref on PR events, ref_name on push events.
$sowRef = if ($baseRef -match '^sow/') { $baseRef } elseif ($refName -match '^sow/') { $refName } else { '' }
if ($sowRef -and $sowRef -ne $headRef) { $candidates += $sowRef }
$candidates += 'sow/2026-Q2'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove hardcoded sow fallback for dependency checkout

The dependency-clone loop always adds sow/2026-Q2 to $candidates, so on main/master pushes (where head_ref/base_ref are empty and ref_name is not a sow branch) CI will preferentially clone dependencies from that quarterly branch whenever it exists instead of the default branch. This makes non-sow builds compile/test against the wrong dependency revisions and can mask or create regressions unrelated to the target branch.

Useful? React with 👍 / 👎.

Mirrors SAM sow/2026-Q2. Adds AssemblyInformationalVersion attribute generation to
Path D's SAMVersion.g.cs Target — covers Grasshopper / Tas-bridge assemblies that
have GenerateAssemblyInfo=false, so they also get the CI commit SHA stamp in their
ProductVersion field. SDK projects pick up InformationalVersion via PropertyGroup
auto-gen as before. Local dev builds unchanged.
@michaldengusiak
michaldengusiak merged commit e6cd655 into HoareLea:master Jun 27, 2026
2 checks passed
@michaldengusiak
michaldengusiak deleted the sow/2026-Q2 branch June 27, 2026 14:15
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.

3 participants