Update release sdk to net10, and promote "unshipped" APIs for release - #569
Conversation
9 no longer matches global.json's 10.0.101 floor; the pack/push was only working because the runner happens to have a .NET 10 SDK preinstalled already.
Ported from marc's StackExchange.Redis PR #3245: sorts the PublicAPI tracking files and, with --promote, folds Unshipped into Shipped as a release step. Running --promote here also fixes the actual release blocker (CmsInformation.CellSize was left unshipped) and, as a one-off, fully re-sorts the previously unsorted Shipped.txt.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c73cc81de2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| *Promotion* (``--promote`` only). Moves every entry from ``PublicAPI.Unshipped.txt`` into its sibling | ||
| ``PublicAPI.Shipped.txt``. "Shipped" means released and frozen, so doing this mid-cycle would freeze | ||
| API that has not shipped and cannot then be changed without it looking like a break. It is therefore | ||
| opt in, and belongs to the release: ship the package, then promote. |
There was a problem hiding this comment.
Promote APIs before publishing the release
When a release contains unshipped entries, following the documented “ship the package, then promote” sequence makes the release fail: .github/workflows/nuget-release.yml verifies that every PublicAPI.Unshipped.txt is empty before its Build and Publish steps and exits nonzero otherwise. The promotion therefore needs to be run and committed before publishing the GitHub release, not afterward.
Useful? React with 👍 / 👎.
| if not args.check: | ||
| shipped.write(new_shipped) |
There was a problem hiding this comment.
Validate every API pair before writing any of them
When more than one project has API tracking files and a later pair contains a shipped/unshipped clash, earlier pairs have already been written here before problems is checked at the end. The command then exits with status 2 while leaving those earlier shipped files promoted and their unshipped files emptied, producing a partial failed operation; collect and validate all planned changes before performing any writes.
Useful? React with 👍 / 👎.
| print(("would change: " if args.check else "updated: ") + c) | ||
|
|
||
| if args.check: | ||
| print("run 'eng/public-api.py' to fix.", file=sys.stderr) |
There was a problem hiding this comment.
Preserve promotion mode in the suggested fix command
When --promote --check detects pending APIs, this message instructs the caller to run the script without --promote. That command only sorts the files and leaves the unshipped entries in place, so the same check continues to fail indefinitely; the suggested command needs to include --promote whenever promotion mode was requested.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c73cc81. Configure here.
| s = s[len(m):] | ||
| changed = True | ||
| # tie-break on the whole line so the order is total and stable | ||
| return (s, line) |
There was a problem hiding this comment.
Sort key ignores nullability prefix
Medium Severity
sort_key strips experimental [...] annotations and member modifiers so a type's APIs stay in one block, but it never strips the PublicApiAnalyzers ~ prefix for nullability-oblivious members. Those lines then sort after every normal signature, so they are torn out of their type and land at the end of PublicAPI.Shipped.txt.
Reviewed by Cursor Bugbot for commit c73cc81. Configure here.


Note
Low Risk
Changes are limited to release CI SDK version and offline public-API file maintenance; no product runtime or auth/data paths are touched.
Overview
Aligns the NuGet release GitHub workflow with the main build by switching
setup-dotnetfrom .NET 9 to .NET 10.Adds
eng/public-api.py, a release/engineering helper for PublicApiAnalyzersPublicAPI.Shipped.txt/PublicAPI.Unshipped.txtundersrc: it sorts entries in place (stable ordering that strips modifier prefixes for grouping), optionally--promotemoves all unshipped lines into shipped and clears unshipped, and--checkfails CI-style if files would need sorting. The existing release job still blocks publish when unshipped API lines remain; this script is the intended way to sort and promote around ship time (per PR notes), but the workflow diff shown does not yet invoke it.Reviewed by Cursor Bugbot for commit c73cc81. Bugbot is set up for automated code reviews on this repo. Configure here.