Repository navigation
Verify frontend distribution parity and document usage - #1512
Merged
Merged
Conversation
Red: the python and node distcheck flows must run the installed `dirsql server --frontend` with and without -c, compare the served page and script with the bundled sources, run a real query, and stop cleanly on SIGTERM. The probe is a stub, so its tests fail on their assertions.
…istribution parity The python and node flows run the installed dirsql server --frontend with and without -c, require the bundled page and script, a real query, and exit 0 on SIGTERM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1490
Verifies
dirsql server --frontendthrough every distribution and documents it. There are no runtime changes: the frontend already ships in every artifact. This PR proves it and keeps it proven.What changed
internals/distcheck: a newfrontend/probe. Both thepython(installed wheel) andnode(installed npm package) flows run the installeddirsql server --frontend --port 0twice, once without and once with-c. Each run must:Frontend at <url>;/and/frontend.jsbyte-equal topackages/rust/src/cli/frontend.{html,js};POST /query(a path-table query without-c, a declared-table query with it);0onSIGTERM.packages/rust/tests/cli_e2e.rs: the standalone binary runs the same page, script, and query checks with and without-c, and confirms a graceful stop.SIGTERMand requires exit0.Windows testsjob runscargo test --features cli --tests) covers serving and queries, not the signal path.packages/rust/tests/crate_contents.rs: the crate archive must list both asset files.docs/reference/cli.mdadds the startup output, invocation parity across npx/uvx/cargo, a path-table and a declared-table example, and shutdown.docs/context/usage.mdadds a short "Browser" section. It uses inline code only, because fenceduvx dirsqlblocks are executed bycontext_examples_e2e.PARITY.mdnow separates shared CLI support from programmatic server APIs; there are none in the Python or TS SDKs.internals/distcheck/README.mddescribes the new probe.No new Python or TS APIs.
Packaging evidence
Asset inclusion. Each artifact contains exactly one embedded copy (from
grep -aover each artifact for a marker unique to the page and one unique to the script):_dirsql.abi3.sodirsql.linux-x64-gnu.nodeThe main npm tarball and the wheel contain no
frontend.*files. The sdist carriespackages/rust/src/cli/frontend.{html,js}, as source to compile.cargo package --listlists both files, andcrate_contents.rsasserts it.Size deltas. Method: HEAD compared with the same tree built with both assets truncated to 0 bytes. Both builds used the release profile on linux-x64. The raw assets are 13,228 B, or 4,654 B gzip -9.
That is about 0.13% per compressed artifact, with no duplication.
Manual verification
All checks ran in a fixture with
posts/{hello,second}.jsonand a.dirsql.tomldeclaringposts(on-file = "cat").target/release/dirsql server --frontend --port 7311 -c .dirsql.toml. It printedFrontend at http://localhost:7311/and thenRunning at localhost:7311.curl /returned 200text/html, 3607 B./frontend/statereturned the root andposts(title TEXT, author TEXT).POST /querywithSELECT title, author FROM postsreturned both rows, and the path-tableSELECT basename, size FROM './posts'returned both files.SIGTERMended it with exit0.postsand then Run showed2 rows returned(Hello/alice, Second/bob).SELECT nope FROM postsshowedQuery error (HTTP 400): ... no such column: nope.dirsql server --frontend -c bad.tomlwith invalid TOML./frontend/statereturned 503 with the TOML parse diagnostic, and the browser showed "Configuration could not load", the diagnostic, and the restart hint.uv run --project internals/distcheck dirsql-distcheck python(wheel built with maturin, installed into a fresh venv) printedpython packaging distcheck: OK.pnpm build, thenuv run --project internals/distcheck dirsql-distcheck node(packed and installed tarballs) printednode packaging distcheck: OK.Choices made
packages/rust/**change.SIGTERMor Ctrl-C to a child on Windows, so there it kills the process. The signal path is proven on unix incli_e2eand in distcheck.E2E Verification
No receipt is owed. The diff touches no scoped source: nothing under
packages/rust/src, the bindings, orpackages/*/tests/e2e. Commands run:cargo test -p dirsql --features cli --test cli_e2e --test crate_contents --test context_integration --test context_examples_e2e: pass.Changelog / Migrations
packages/rust/tests(exempt); the rest isinternals/and docs.