Skip to content

Keep the libraries' public API in api/ and verify it in CI - #99

Merged
Mpdreamz merged 2 commits into
mainfrom
dogfood-api
Nov 14, 2026
Merged

Mpdreamz merged 2 commits into
mainfrom
dogfood-api

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The libraries now use their own feature. api/ holds the public API of Nullean.PublicApi and Nullean.PublicApi.Diff as .api files, written by the tool built from this checkout. So from now on, a change to either library's API shows up in its pull request as a diff of those files.

  • Two files for Nullean.PublicApi: its API differs between netstandard2.0 and net10.0. Covariant return types need .NET 5 or later, so on netstandard2.0 the records' <Clone>$ returns the base type (public override ApiTypeReference <Clone>$() instead of public override ApiArrayType <Clone>$()). Generating these files is how Read a covariant return override as an override #98 was found.
  • ./build.sh ci and CI's build job run verifyapi: CI calls the targets one by one, so verifyapi is its own step there, and the run on this branch printed [api] api matches the build: 3 files on Linux. The target fails when the build no longer matches api/. mise run api regenerates the files after an intended change, and AGENTS.md says to commit them with that change. CI runs the tool from the checkout, because the released verify-api action can't run api until the next release.
  • The update command --verify prints now carries the --project, --include-tests and --include-unpackable options it was run with.

Checked locally: verifyapi passes on this branch. With a public method added to ApiWriter it fails with exit 5:

[api] Nullean.PublicApi.net10.0: 1 change since the committed files, suggested version change: Minor
  api/Nullean.PublicApi.net10.0.api:457  Nullean.PublicApi › ApiWriter › Probe()  added public static int Probe()  [minor]
[api] Nullean.PublicApi.netstandard2.0: 1 change since the committed files, suggested version change: Minor
  api/Nullean.PublicApi.netstandard2.0.api:457  Nullean.PublicApi › ApiWriter › Probe()  added public static int Probe()  [minor]
[api] api does not match the build. Suggested version change: Minor

🤖 Generated with Claude Code

api/ holds Nullean.PublicApi's and Nullean.PublicApi.Diff's public API as .api files, written by the tool built from
this checkout; Nullean.PublicApi has one per target framework, because on netstandard2.0 the records' <Clone>$
cannot return the derived type. The ci target now runs verifyapi, which fails when the build no longer matches them,
and `mise run api` regenerates them after an intended change.

The update command api --verify prints now carries the --project, --include-tests and --include-unpackable options
it was run with.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Mpdreamz Mpdreamz added the chore Internal change, no user-visible effect (patch) label Nov 14, 2026
@Mpdreamz
Mpdreamz merged commit 8b164df into main Nov 14, 2026
6 checks passed
@Mpdreamz
Mpdreamz deleted the dogfood-api branch November 14, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Internal change, no user-visible effect (patch)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant