Skip to content

ci/docs: release-tag-only publishing, key collisions, source-generation metadata (9.0.0) - #31

Merged
CaffeinatedCoder merged 3 commits into
mainfrom
chore/release-readiness
Oct 11, 2026
Merged

CaffeinatedCoder merged 3 commits into
mainfrom
chore/release-readiness

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Release-readiness items for 9.0.0 that came out of an independent review. Each point was checked against the code or measured before anything changed. Nothing in the packages' code changes: one CI guard, docs, and tests.

Publish only from a release tag (release.yml)

Before this change, a manual run of the release workflow from a branch with dry_run: false would have published. Two steps run only for tag refs, so that run would skip both:

  • the check that the tag matches the version
  • the GitHub release that permanently holds the SBOMs

Two repository settings already prevent this:

  • the nuget environment only accepts deployments from v* tags
  • the "Release tags are immutable" ruleset forbids deleting or moving a v* tag

But the YAML can't show either setting, and its own comment said the opposite.

What changed:

  • publish now requires a v* tag ref as well.
  • The comments describe those settings.
  • The --skip-duplicate note now says to retry with "Re-run failed jobs". That pushes the same verified artifact again, whereas a fresh run rebuilds the packages, and with a floating SDK they need not match the ones already pushed.
  • ReleaseWiringConventionTests.ThePublishJob_RunsOnlyForAReleaseTag reads the job-level condition. Restoring the previous condition makes it fail with the expected message.

Dictionary keys: two spellings of one key collide

Keys canonicalize, so {"[1,5]":"a","[1,6)":"b"} names the key [1,5] twice.

  • Default options: System.Text.Json keeps the later value, silently. This is the same for Dictionary, IReadOnlyDictionary, ImmutableDictionary, variant keys and RangeSet keys.
  • .NET 10's AllowDuplicateProperties = false: the collision is rejected with a JsonException, because the duplicate check runs on the parsed key.

docs/serialization.md#dictionary-keys now describes this and recommends that setting for keyed data where a dropped entry matters. JsonDictionaryKeyTests pins both behaviours.

Source-generation metadata for value sets

A source-generated context must list a value set's element type as well as the set.

  • If it's left out: you get a NotSupportedException naming the element type, in both directions. That includes families that bring their own element converter.
  • Pinned by SetSourceGenerationTests: the documented context working, and the missing-element error.
  • NativeAOT smoke consumer: it now also runs the documented context for a primitive set, and a range serialized through object.
  • Docs: they also note that serialization with default options (no context) is unavailable under Native AOT for every type, which is System.Text.Json's policy rather than this library's.

Test plan

  • dotnet test: all passing, including the integration tests against a live PostgreSQL
  • ./test/consumer-smoke-test.sh: passes, including both new AOT cases and no trim or AOT warnings
  • CI

The new dictionary and source-generation tests pin existing behaviour; there's no source fix to revert for them. The workflow test was checked by restoring the old condition.

🤖 Generated with Claude Code

CaffeinatedCoder and others added 3 commits October 11, 2026 16:24
A manual non-dry run of the release workflow from a branch would have
published: the tag-versus-version check and the GitHub release (the
SBOMs' permanent home) both run for tag refs only. The `nuget`
environment's deployment policy (v* tags) already refuses such a run,
and a ruleset makes v* tags immutable, but both are repository settings
the YAML cannot show. The publish job's condition now requires a v* tag
ref too, the comments describe the settings instead of contradicting
them, and the --skip-duplicate note says to retry with "Re-run failed
jobs" (same verified artifact) rather than a fresh, rebuilding run.

ReleaseWiringConventionTests.ThePublishJob_RunsOnlyForAReleaseTag reads
the job-level condition; the previous condition fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two behaviours an independent release review asked about, measured and
now documented and pinned:

- Keys canonicalize, so two spellings of one key ("[1,5]", "[1,6)")
  collide. System.Text.Json treats that as any duplicate key: the later
  value silently wins by default, and .NET 10's
  AllowDuplicateProperties = false refuses it because it checks the
  parsed key. docs/serialization.md recommends the latter for keyed data
  where a dropped entry matters; JsonDictionaryKeyTests pins both.
- A source-generated context must list a value set's element type. Left
  out, it is a NotSupportedException naming the element, in both
  directions, even for a family with its own element converter.
  SetSourceGenerationTests pins the documented context and the
  omission. The NativeAOT smoke consumer now also runs the documented
  context for a primitive set and a range through object. The docs note
  that default-options serialization is unavailable under AOT for every
  type (System.Text.Json policy).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CaffeinatedCoder
CaffeinatedCoder merged commit c6bc85d into main Oct 11, 2026
8 checks passed
@CaffeinatedCoder
CaffeinatedCoder deleted the chore/release-readiness branch October 11, 2026 16:04
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.

1 participant