Repository navigation
chore: remove the committed API reports; the API delta comes from the build - #10957
Conversation
…eport # Conflicts: # docs/architecture/public-component-api.md
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
… and fails on any other
There was a problem hiding this comment.
Approval waits on an engineering owner decision. This pull request deletes the committed api-report.md files and pnpm api:report, which architecture:public-component-api INV24 on main still requires. It relies on the INV24 rewrite and DEC-6 proposed in #10950, which has not landed. An engineering owner records that decision by landing #10950 first or by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.
These need fixing whatever the decision:
- When CI has no built surface of the merge base,
cli.mjs --changeswrites an empty delta and the PR report shows no API line at all, which looks the same as a pull request that changes no API, whileci.yml(lines 1585, 1621-1622, 1645-1646 and 1660) still says it falls back to committed reports; build the merge base's published packages whenever Main kept no API surface, show a visible "not compared" line whenbaseRecordis null, and update those messages. architecture:knowledge-contractsINV28 still defines a public hook as one "a package's committed API report lists", so once every report is deleted the definition names no hook; amend it, here or in #10950, to a source that still exists, such as the built API surface.
Building every published package on both sides finds no added, changed or removed public API.
[Automated review]
…eport # Conflicts: # docs/architecture/list-windowing.md
# Conflicts: # .github/workflows/ci.yml # package.json # packages/core/api-report.md # scripts/api-report/changes.mjs # scripts/api-report/cli.mjs
|
/approve-spec b2b8c3f |
There was a problem hiding this comment.
Changes requested: an engineering owner approved the INV24 and DEC-6 rewrite for this exact head, so removing the committed API reports is decided direction, but two fixes are needed before it can merge.
- When CI has no built surface of the merge base (Main kept its component sizes but not its API surface, or the merge-base build failed),
cli.mjs --changeswrites an empty delta and the PR report shows nothing, exactly as for a pull request with no API change; start the merge-base build whenever Main's API surface is missing (.github/workflows/ci.yml:1648) and render a visible "not compared" line whenbaseRecordis null. architecture:knowledge-contractsINV28 still defines a public hook as one "a package's committed API report lists", which no longer exists after this change; amend it and its verification row, here or in #10950, for example to the hooks a published entry point exports as the built surface lists them.
No published package's public API changes, and CI has not run on this draft head yet.
[Automated review]
…ge a published package; INV28 reads public hooks from the built surface CodeBunny review of #10950: INV28 defined a public hook through the committed API report that INV24 removes; INV24 and DEC-6 failed closed on a missing artifact that CI never uploads for spec, docs or tooling pull requests (spec:AST-030 FR5).
…ith no base surface says it was not compared Without Main's API surface, a pull request that can change a published package builds the merge base for its surface, even when Main kept its component sizes (that record stays). When no surface exists, api-changes.json names each published package whose inputs changed as unknown, never an empty delta, and the report says the API changes were not compared.
… chore/remove-api-reports
|
/approve-spec 35f86ac |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because it runs only for pull requests into main or a release branch, so these workflow changes first run in CI on #10950.
An engineering owner approved the INV24, DEC-6 and INV28 rewrites this removal relies on for this head, and both earlier requests are fixed: a run with no built merge-base surface now says "not compared" and names each changed package, CI builds the merge base when only its API surface is missing, and INV28 defines public hooks by the built surface. Base and head builds of all 11 published packages show no public API change.
- Optional: the merge-base notice in
.github/workflows/ci.yml(line 1816) still says Main kept no record of the merge base when the build ran only for the API surface; branching it onNEED_SIZES, as the failure warnings below it do, keeps it accurate.
[Automated review]
| @@ -1797,9 +1814,11 @@ jobs: | |||
| tail -n 20 base-build.log || true | |||
| if [ -f base-build.done ]; then | |||
| echo "::notice title=Merge base built::Main kept no record of the merge base; it was built beside Storybook (waited ${waited}s after the build)." | |||
There was a problem hiding this comment.
Non-blocking: since the start condition at line 1649 also builds the merge base when Main kept its sizes and only the API surface is missing (NEED_SIZES: false), this success notice can say "Main kept no record of the merge base" when Main did keep one. Branching it on NEED_SIZES, as the two failure warnings below already do, keeps the run log accurate (for example: "Main kept no API surface of the merge base; it was built beside Storybook").
There was a problem hiding this comment.
Changes requested: #10950 needs two record fixes, and #10957, which has no blocking findings, waits for it because a pull request lands only when it and every pull request below it are approved.
#10950: changes requested
docs/architecture/public-component-api.mdINV24 (lines 315-317) and DEC-6 (line 451) say a pull request that changes no published package "carries no artifact", butspec:AST-030FR2, FR5 and FR26 send workflow, shared-configuration and Lab-only changes to broad CI, which uploadsapi-changes.json(.github/workflows/ci.ymllines 1922-1960), so please say instead that such a pull request needs no API delta, the merge gate reads no artifact for it, and its review notes say "New public API: none".- The INV24 verification row (line 478) counts "the merge gate passes when the compare artifact is missing" as a failure for every pull request, so a spec-only pull request that correctly merges without an artifact fires it; please scope it to a pull request that changes a published package.
#10957: no blocking findings; base and head builds show no public API change in any published package.
Whole stack: blocked until #10950's fixes land with a fresh /approve-spec for its new head.
[Automated review]
…ll requests that change a published package CodeBunny review of #10950: broad CI can still upload the artifact for shared changes (spec:AST-030 FR2/FR5); what matters is that the gate reads none for a pull request that changes no published package. Scopes INV24's verification failure signal the same way.
|
/approve-spec 698f5aa |
There was a problem hiding this comment.
Approved pending CI: the heavy CI checks on this head are deferred and run before merge.
#10950: approved. No blocking findings. INV24, DEC-6 and the INV24 verification row now say the merge gate reads the API artifact only for a pull request that changes a published package, which resolves both earlier findings.
#10957: approved. No blocking findings. Base and head builds show no public API change in any published package.
Whole stack: passes. A pull request lands only when it and every pull request below it are approved, so #10950 lands first, then #10957.
[Automated review]
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| CheckboxInput · Storybook | 66.0 kB (0) · 9.2 kB CSS (0) | 441 (0) | — · — · — |
Package size:
- @astryxdesign/build 34.5 kB packed (−30 B); no new dependencies
- @astryxdesign/cli 3.70 MB packed (−32 B); no new dependencies
- @astryxdesign/core 7.30 MB packed (−24 B); no new dependencies
8 more packages
- @astryxdesign/richtext 225.1 kB packed (−18 B); no new dependencies
- @astryxdesign/theme-butter 48.8 kB packed (−15 B); no new dependencies
- @astryxdesign/theme-chocolate 16.3 kB packed (−23 B); no new dependencies
- @astryxdesign/theme-gothic 35.4 kB packed (−25 B); no new dependencies
- @astryxdesign/theme-matcha 28.7 kB packed (−18 B); no new dependencies
- @astryxdesign/theme-neutral 40.7 kB packed (−26 B); no new dependencies
- @astryxdesign/theme-stone 40.3 kB packed (−23 B); no new dependencies
- @astryxdesign/theme-y2k 37.4 kB packed (−25 B); no new dependencies
Wide change (shared styles: packages/themes/butter/package.json, packages/themes/chocolate/package.json, packages/themes/gothic/package.json, and 4 more): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.
CI impact: +5.3 job-min per update · pool +6.2% · time to green −3.2 min · some runners chosen by event or unknown · 6 CI action or script files changed (not measured)
| Before | After | Change | |
|---|---|---|---|
| Job-minutes per PR update | 85.8 | 91.1 | +5.3 |
| Runner pool, runner-minutes a day | 41,048 | 43,575 | +2,527 (+6.2%) |
| Average concurrent jobs | 28.5 | 30.3 | +1.8 |
| Time to green (median → this run) | 19.8 min | 16.6 min | −3.2 min |
| Runs a day | 478 | 478 | 0 |
Changed jobs: build-storybook changed: standard or non-standard by event (4-core-ubuntu) · docsite-build changed: standard
Not measured (the jobs that use these keep their recent minutes above): .github/scripts/ci-docsite-browser.test.mjs, .github/scripts/ci-tooling-routing.test.mjs, .github/scripts/generate-pr-comment.test.mjs, .github/scripts/lib/pr-status.js, .github/scripts/lib/pr-status.test.mjs, .github/scripts/spec-owner-workflow.test.mjs.
Assumptions: before is each job's average over the last 20 pull-request runs; after keeps that for unchanged jobs and uses this run's minutes for added or changed ones, weighted by how often each changed job ran in those runs; runs a day averages the seven whole days before today; time to green compares this run with the median of those runs that ran the same jobs.
Generated by PR Enrichment workflow | View full report
Resolves the one conflict by keeping the deletion of packages/core/api-report.md (main changed it in #10771; that change's API rows are in CI's generated delta).
|
/approve-spec 1780cb5 |
There was a problem hiding this comment.
Approved pending CI: the heavy checks (build, test and docsite-test) are deferred on this head and run before merge, which also runs the new docsite-build API surface step in CI for the first time.
#10950: approved, and already merged into main. Its records are unchanged since its last review and are now the current API-delta records.
#10957: approved. Every change follows those records: no package commits a generated API report, and the API delta comes from comparing builds. Builds of the merge base and of this head show no public API change in any of the 11 published packages.
- Non-blocking: the merge-base success notice in
.github/workflows/ci.yml(line 1816) still says Main kept no record of the merge base when the build ran only for the API surface. Branching it onNEED_SIZES, as the two failure warnings below it already do, would keep the run log accurate.
Whole stack: passes. A pull request in this stack lands only when it and every pull request below it are approved. #10950 is approved and merged, so #10957 is clear once CI passes.
main removed the committed API reports (#10957); the API delta now comes from the build, so this branch's api-report hunk goes with it.
Stack: #10950 → #10957
Maintainer impact
Eleven committed
api-report.mdfiles (about 15,700 lines) had to be regenerated by hand on every public API change, and they drifted whenever a pull request forgot. The pull request's API delta already comes from the build: CI compares the head's build with the merge base's built API surface. This removes the committed copies and everything that existed only to keep them current.Intended invariant
architecture:public-component-apiINV24 and DEC-6 as #10950 rewrites them: a pull request's API delta comes from comparing builds; no API report is committed.Change
packages/{build,cli,core,richtext}/api-report.mdandpackages/themes/{butter,chocolate,gothic,matcha,neutral,stone,y2k}/api-report.md.api:reportscript from the root and the 11 packagepackage.jsonfiles, and the.gitattributesentry for the reports.scripts/api-report/cli.mjskeeps--surface <dir> [--root]and--changes --base <ref> [--base-surface <dir> --base-record main|build] [--out], unrenamed. Removed: the report-write mode,--check,--package, the committed-report fallback (showAt,committedAtBase), and the stale-report computation and warnings. With no base surface,--changescompares nothing and says so:baseRecord: null, and each published package whose report inputs changed since--baseis listed as unknown (baseUnknown: true,baseline: true, no rows), never an empty delta. A pull request that changes no published package lists none (INV24: it carries no delta to compare). A package the base surface lists (built or skipped) but has no report for, and that changed since the merge base, is marked unknown (baseUnknown: true,baseSource: 'unknown',baseline: true, no rows), whichever record the surface came from; a package the surface does not list is new. This keeps main's unknown-base handling, which now replaces the committed-report fallback in every case instead of only for a merge base CI built itself.scripts/api-report/changes.mjs:computeChangesno longer reads a committed report;staleReportWarningsand the stale fields are gone;renderChangeshas one renderer and ignores stale fields an older head may still write. A package the base surface lacks reads "not in the merge base's build"; packages with an unknown base share one headline entry, "unknown (base surface unavailable): …". With no base surface (baseRecord: null), the line reads "API changes: not compared: no built surface of the merge base; unknown: …" (renderChanges(changes, {compared: false}), also used bypr-status.js); with no package listed it renders nothing.api-changes.jsonstaysversion: 2with the fields merge-guard reads:version,baseRecord,packages[].pkg,baseline, androws[].change/entry/section/item/member/line/before(plusbaseSource,counts,usage, andbaseUnknownwhen set). The dropped fields arestale,staleRows,staleOwnRows, andmissing.Start building the merge base without a recordnow also starts when Main kept no API surface of the merge base and the pull request can change a published package (touches, orfull_suite), even when Main kept the component sizes. In that case (NEED_SIZES: false) the size analyzer does not run, and a failed build keeps Main's size record and warns that the API changes are not compared.Report API changeskeeps the surface compare; its comments and notice no longer mention committed reports, and neither do the Main-artifact lookup's missing-surface note, the merge-base build's comments and failure message, nor the CLI-declarations routing test's comment.deploy.yml'scli.mjs --surface api-surfaceis unchanged. The PR report (pr-status.js) drops the "Committed API report behind this build" line through the shared renderer.apps/docsiteexample coverage reads each package's report from the built surface named byASTRYX_API_SURFACE(relative to the repository root). In CI (CI=true) a missing or unreadable surface fails the test with "ASTRYX_API_SURFACE is required in CI: build it with node scripts/api-report/cli.mjs --surface "; outside CI the hook part prints a skip line. The hook list itself stays advisory.ci.ymldocsite-build(the job that runs the docsite data tests): a new step,Write the docsite's API surface, runsnode scripts/api-report/cli.mjs --surface .api-surface-docsiteafter the package and docsite builds, under the same condition as the tests, andtest-docsite (data tests)setsASTRYX_API_SURFACE: .api-surface-docsite. The CLI and build packages, which that job does not build, are listed in the surface as not built.NOT_BUILT_IN_DOCSITE_BUILD = ['@astryxdesign/cli', '@astryxdesign/build']("not built in docsite-build"), printed on each run. Any other package the surface lists as not built fails the test in CI, so a newly unbuilt package cannot drop out of hook coverage quietly. Excluding them was cheaper than building them: in a docsite-build-shaped tree, building their surfaces (@astryxdesign/cli sync:api-typesplus@astryxdesign/build build) took 37 s locally, and neither package exports a public hook (0 hook rows in either report), so the exclusion loses no coverage.CheckboxInput.test.tsx: the "API report has no row" half now checks the source instead: the marker module is imported fromsrc/internal, and the package barrel does not name it.scripts/pre-review.mjs: item a (API delta) now applies to any published package code instead of to changed report rows; the boolean-prop and hook-row routes that read report rows are gone (item c still routes from…Behaviorprops in source, item e from hook exports).scripts/release/changeset-coverage.mjs: unchanged logic. It never used report diffs to require a Changeset; it exempted a package-rootapi-report.mdthatfilesdoes not pack, which also keeps this pull request's deletions free of a Changeset. Comment updated.scripts/api-report/generate.mjs: the surface report's header no longer namespnpm api:report.apps/docsite/src/lib/exampleCoverage.mjs: its header says a public hook is one in the built API surface.docs/architectureordocs/contributing/pull-requests.mdchange (docs(records): pull requests carry an API delta instead of a committed API report #10950 owns them); nothing else indocs/orAGENTS.mdtells people to runpnpm api:report.Evidence
pnpm api:reportleft a committed report behind the build, and every later pull request reported that backlog.changeset-coverage pr --base origin/main: "nothing here ships to consumers", so no Changeset.docsite-build, on the same runner, after the builds it reads. No new job. Measured locally (no CI run exists for this draft branch): "Write the docsite's API surface" took 3.0 s wall in a docsite-build-shaped tree (9 package reports, CLI and build not built), about 0.05 runner-minutes on the job's existing runner. A CI runner is likely slower than the local machine; this is a local figure. When Main kept no API surface of the merge base (Main keeps one for 14 days), a pull request that changes a package now builds the merge base in the background beside the Storybook build, as it already did when the component sizes were missing.Scope
Components: scripts/api-report, PR report, docsite example coverage, pre-review, the committed API reports
Testing
pnpm check:knowledge: aligned.vitest --project nodeafter merging main (through docs(records): pull requests carry an API delta instead of a committed API report #10950):scripts/api-report/api-report.test.mjs,.github/scripts/lib/pr-status.test.mjs,.github/scripts/generate-pr-comment.test.mjs,.github/scripts/ci-tooling-routing.test.mjs,.github/scripts/ci-docsite-browser.test.mjs,.github/scripts/spec-owner-workflow.test.mjs,scripts/release/changeset-coverage.test.mjs,scripts/pre-review.test.mjs,scripts/lib/pre-review-findings.test.mjs: 9 files, 280 tests pass. The unknown-base cases from main run against the surface-only inputs: a listed, changed package with no surface report is unknown; a listed, unchanged one reads this build; an unknown package and a changed one share one headline.pr-status),uncomparedChanges,cli.mjs --changeswith no surface (no--base: every published package unknown;--base HEAD: none, empty report), the base build's start condition andNEED_SIZESenv, an API-only base build that skips the size analyzer, and a failed API-only build that keeps Main's size record. After merging docs(records): pull requests carry an API delta instead of a committed API report #10950's head: everyci-*/*workflow*test plus the files above, 53 files, 1,455 tests pass.bash -non all 217run:blocks ofci.yml(and their nestedbash -cscripts): clean.actionlint: no finding that main does not already have.CheckboxInput.test.tsx"keeps its marker internal" (ui project): passes.example-coverage.test.tsafterpnpm buildandpnpm -F @astryxdesign/docsite generate: withCI=true ASTRYX_API_SURFACE=.api-surface-docsite(CLI and build not built, as in docsite-build), 10/10, the hook list prints, and the run prints "Hook coverage excludes @astryxdesign/build, @astryxdesign/cli: not built in docsite-build."; withCI=trueand no surface, the hook test fails with the required-in-CI message; withoutCI, the skip line. Unit tests cover the CI failure (unset and unreadable), a readable surface relative to the root, the named exclusion passing in CI, an unexpected not-built package failing in CI (and only named outside it), and the local skip.test-docsite (data tests), has the same condition and nocontinue-on-error, and the test step carries the env (ci-docsite-browser,ci-tooling-routing,spec-owner-workflow). Everyci-*and*workflow*test after merging main: 47 files, 1,231 tests pass.pnpm build:cli.mjs --surface <dir>wrote 11 reports in about 9 s; with one hook row removed from and one added to that surface's Core report,cli.mjs --changes --base HEAD --base-surface <dir> --base-record buildwroteapi-changes.json{version: 2, baseRecord: "build"}with 11 packages and Core's rowsadded hook useScrollOverflow,removed hook useRetiredThing, andapi-changes.md"API changes:core+1 · ~0 · −1". Without--base-surface:{version: 2, baseRecord: null, packages: []}.git grep -n -e 'api-report\.md' -e 'api:report', intentional mentions only:scripts/api-report/cli.mjs:REPORT_FILE, each package's report file inside a surface directory;scripts/api-report/api-report.test.mjs: the surface test'spackages/demo/api-report.mdpaths;apps/docsite/src/__tests__/example-coverage.test.ts: the report file inside the surface directory;scripts/release/changeset-coverage.mjsand its test: the package-root report exemption.