8000 Packaging: every crate ships complete, with an end-to-end check and CI by ynishi · Pull Request #11 · ynishi/evalhub · GitHub
[go: up one dir, main page]

Skip to content
< 8000 /div>

Packaging: every crate ships complete, with an end-to-end check and CI - #11

Merged
ynishi merged 4 commits into
mainfrom
chore/packaging-ci
Sep 21, 2026
Merged

ynishi merged 4 commits into
mainfrom
chore/packaging-ci

Conversation

@ynishi
@ynishi ynishi commented Sep 21, 2026
Copy link
Copy Markdown
Owner

Three commits that make the workspace publishable and put a CI in front of it.

Packaging (2f8b833)

cargo package --workspace did not produce publishable crates:

  • the workspace manifest lacked documentation and readme, and authors had no email;
  • LICENSE sat at the repository root, which cargo package never reads;
  • the sqlx offline data sat at the root too, so the packaged store crate could not compile without a database;
  • the web UI was built to web/build, outside the server crate, so the published server would have served the placeholder page.

Now every crate carries LICENSE and README; .sqlx/ lives in crates/evalhub-store/; the SvelteKit build lands in crates/evalhub-server/web-dist, gitignored there and shipped through the crate's include list (the Kellnr / SQLPage shape). A build.rs refuses a release build without the UI, as Tauri does for frontendDist, with DOCS_RS and EVALHUB_ALLOW_MISSING_UI as the explicit opt-outs; debug builds keep the placeholder. A justfile adds web-build, check, sqlx-check, package and package-gate, which opens every .crate and fails unless LICENSE, README, the UI and the offline data are inside and the size is under the crates.io limit. Publishing stays a hand-typed command.

End to end (75526c1)

just e2e boots the release binary against a throwaway Postgres from outside the source tree, fetches the embedded UI, an immutable asset, a deep link and the API, then runs a Playwright suite (web/tests/browser) against the same server. just e2e-install fetches the Chromium headless shell without root and checks the host has its shared libraries.

CI (76ade6d)

.github/workflows/ci.yml: rust (fmt, clippy, cargo-deny, per-crate tests, sqlx check), web (svelte-check, prettier), e2e (just e2e), package (just package). web/package.json pins pnpm@12.5.1 through packageManager.

Verified locally

cargo package --workspace verifies all five crates and the gate passes with the UI and fails without it; cargo check --release fails without web-dist and passes with the opt-out; cargo test -p evalhub-server is green with the UI embedded; cargo sqlx prepare --check passes from the store crate; just e2e passes 16 checks; the installed release binary serves the embedded UI. The workflow has not run yet: this PR is its first run.

… ship in the .crate

`cargo package --workspace` did not produce publishable crates. The
workspace manifest had no `documentation` and no `readme`; LICENSE sat at
the repository root, which `cargo package` never reads; the sqlx offline
data sat at the root too, so the packaged store crate could not compile
without a database; and the web UI was built to `web/build`, outside the
server crate, so the published server would have served the placeholder.

- `[workspace.package]`: add `documentation`, `readme`, and the author
  email. Each crate points `documentation` at its docs.rs page.
- Copy LICENSE into every crate; cargo only packages files under the
  crate root.
- Move `.sqlx/` into `crates/evalhub-store/`, where the macros find it and
  `cargo package` ships it. `cargo sqlx prepare` now runs from that crate.
- Build the SvelteKit UI into `crates/evalhub-server/web-dist`, gitignored
  there and put in the .crate through the crate's `include` list, the
  Kellnr / SQLPage shape. A new `build.rs` refuses a release build without
  it, as Tauri does for `frontendDist`, with `DOCS_RS` and
  `EVALHUB_ALLOW_MISSING_UI` as the explicit exceptions; debug builds keep
  `allow_missing` and the placeholder.
- Add a `justfile`: `web-build`, `check`, `sqlx-check`, `package`, and
  `package-gate`, which opens every .crate and fails unless LICENSE,
  README, the UI and the offline data are inside and the size is under the
  crates.io limit. Publishing stays a hand-typed command.
- README, web/README, CONTRIBUTING and AGENTS follow the new locations.

Verified: `cargo package --workspace` verifies all five crates; the gate
passes with the UI and fails without it; `cargo check --release` fails
without `web-dist` and passes with the opt-out; `cargo test -p
evalhub-server` is green with the UI embedded; `cargo sqlx prepare --check`
passes from the store crate against a migrated Postgres; the installed
release binary serves the embedded index.html, immutable assets and deep
links from outside the source tree.

Signed-off-by: Yutaka Nishimura <ytk.nishimura@gmail.com>
…ight suite

The integration tests drive an in-process router; nothing exercised the
binary a user runs. `e2e/smoke.sh` now starts a throwaway Postgres, runs
`evalhub migrate`, serves the release build from outside the source tree
(so the UI has to be inside the binary), and asks it for what a browser
would: the embedded index.html, an immutable asset with its year-long
cache header, a deep link, the API and its 404 boundary. It then runs the
Playwright suite in `web/tests/browser` against the same server: the
bundle boots, the masthead settles once `whoami` answers, a deep link
renders as its page, and a client-side navigation paints a list the API
filled.

`just e2e` builds the UI and the release binary and runs both halves.
`just e2e-install` fetches the Chromium headless shell into the user's
cache without root and checks with `ldd` that the host has the libraries
it links against, naming the fix when it does not. `playwright.config.ts`
has no `webServer` on purpose: the harness is the shell script, and the
suite takes the hub's URL from `EVALHUB_E2E_BASE_URL`.

Verified on the shared dev host: 16 checks pass (curl and browser), no
containers left behind; svelte-check and prettier are clean.

Signed-off-by: Yutaka Nishimura <ytk.nishimura@gmail.com>
…package`

Four jobs on every push to main and every pull request. `rust` runs fmt,
clippy, cargo-deny, the tests crate by crate (never `--workspace`), and
the sqlx offline check against a Postgres service. `web` runs svelte-check
and prettier. `e2e` installs the Chromium headless shell with its system
libraries (the runner has root) and runs `just e2e`, keeping the
Playwright report as an artifact on failure. `package` runs `just
package`, so a crate that would not verify or ship without its LICENSE,
README, offline data or UI fails before anyone publishes it.

`web/package.json` now names `pnpm@12.5.1` in `packageManager`, so
corepack resolves the same pnpm on every machine; pnpm records that pin
in the lockfile.

Verified locally: the workflow parses; `cargo metadata --locked` is
satisfied; the sqlx step (`sqlx migrate run --source ...` then `just
sqlx-check`) passes against a throwaway Postgres; a frozen-lockfile
install passes with the pin. The workflow itself has not run: nothing is
pushed.

Signed-off-by: Yutaka Nishimura <ytk.nishimura@gmail.com>
With DATABASE_URL set for the whole job, the sqlx macros went online and
checked every query against the Postgres service before it had been
migrated, so clippy failed on evalhub-store with 73 "relation does not
exist" errors. Only the offline-data check needs the database; clippy
and the tests use the committed .sqlx data.

Signed-off-by: Yutaka Nishimura <ytk.nishimura@gmail.com>
@ynishi
ynishi merged commit 7e9f8e8 into main Sep 21, 2026
4 checks passed
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

0