Q2 2026 — System.Text.Json migration + quarterly work#23
Q2 2026 — System.Text.Json migration + quarterly work#23michaldengusiak wants to merge 11 commits into
Conversation
SAM-BIM core migrated from Newtonsoft.Json to System.Text.Json.Nodes. SAM.Core's public surface now exposes JsonObject; replace each csproj's Newtonsoft package reference with System.Text.Json 10.0.8 so downstream consumers can resolve the type at compile time. 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>
Replaces the older spdx-check.yml (literal en-dash grep, top 6 lines, PR-only trigger) with the modern template shipped on SAM core: - grep -qE with [-–] char class — accepts both hyphen-minus and en-dash - 20-line lookback (was 6) - BOM and CR stripping - mapfile + diff-filter for cleaner change detection - Adds workflow_dispatch trigger Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Remove Newtonsoft.Json — migrate to System.Text.Json.Nodes
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a43e3da8e
ℹ️ 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 (Test-Path $r) { continue } | ||
| Write-Host "Cloning https://github.com/$org/$r.git" | ||
| git clone --depth 1 "https://github.com/$org/$r.git" $r | ||
| $headRef = '${{ github.head_ref }}' |
There was a problem hiding this comment.
Sanitize
github.head_ref before embedding in PowerShell
github.head_ref is interpolated directly into a single-quoted PowerShell string, so a branch name containing ' can break out of the assignment and inject extra commands in the run: block. Because this job runs on pull_request, an attacker-controlled branch name can cause arbitrary command execution on the runner (at minimum a CI DoS, and potentially more depending on token/repo permissions). Use a safe transport (for example, pass via environment and avoid inline script interpolation, or escape quotes explicitly) before assigning it.
Useful? React with 👍 / 👎.
| $candidates += 'sow/2026-Q2' | ||
| $cloned = $false | ||
| foreach ($cand in $candidates) { | ||
| $has = (git ls-remote --heads "https://github.com/$org/$r.git" $cand 2>$null | Out-String).Trim() |
There was a problem hiding this comment.
Match remote branch names exactly before cloning
git ls-remote --heads ... $cand uses glob-style tail matching, not exact matching, so $cand can be reported as present when only a different branch like feature/$cand exists. The subsequent git clone --branch $cand then fails with “Remote branch ... not found,” causing the build step to fail for otherwise valid PR branches. Query refs/heads/$cand (or otherwise enforce exact matching) before cloning.
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.
Pin System.Text.Json to 8.0.5
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
* 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.
|
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. - Directory.Build.props at repo root ($(SAMVersion) MSBuild property) - csproj/AssemblyInfo: strip duplicated AssemblyVersion/FileVersion/Deterministic - build.yml: sow/2026-Q2 -> sow/** triggers, Compute SAMVersion step, /p:SAMVersion injected, dep-clone candidate now derives current sow branch dynamically (Codex P1 fix) * 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.
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.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8ca61e96c
ℹ️ 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' |
There was a problem hiding this comment.
Remove fixed quarter branch fallback for dependency clones
In the dependency clone loop, adding sow/2026-Q2 as an unconditional fallback means non-sow builds (for example PRs into main) will still clone dependency repos from that quarter branch whenever it exists, instead of validating against the dependency default branch. This can make CI report green while masking real integration breakages against main/master, because the workflow is testing against a pinned historical branch rather than the branch that production development targets.
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.
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
IJSAMObjectimplementations migrated fromJObject/JArray/JTokentoJsonObject/JsonArray/JsonNode.FromJObject/ToJObjectrenamed toFromJsonObject/ToJsonObject.System.Text.Json10.0.8 replacesNewtonsoft.Json13.0.3 in every csproj(except SAM_Revit which keeps Newtonsoft loadable for Revit's runtime).
Log identity loss, SearchWrapper missing type discriminator, RelationCollection
wrong-jObject-passed).
Verification
BuildAlls_v3 RestoreCleanRebuildagainst the merged sow/2026-Q2 chain:0 errors, 144 artifacts.
Test plan
IJSAMObjectAPI renamemasterfrom upstream🤖 Generated with Claude Code