~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

The pages' writes are checked end to end in a browser

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:harness/e2e

What changes

A seventh check, e2e. It drives the pages in Chromium, as bob and then alice, over a world seeded as the shots' is (just e2e, harness/e2e/flows.spec.mjs). It logs in through the PDS's own approval page, then stars and unstars, follows and unfollows, opens an issue, comments, reacts, closes and reopens. It labels as the repository's owner, logged in to a second account, then switches back and logs out of each. Each write is checked three ways: on the page at once, as a record in the PDS, and on the page read anew from the index. A flow that fails leaves its page among the check's outputs.

How it logs in. knotless-serve serves the world again as a gateway (--public-url, --oauth-url), behind harness/tls-proxy.mjs, as a PDS sends a login back only over https. Chromium maps the harness's gateway hostname to 127.0.0.1 and takes its certificate. serve() in world.mjs takes a gateway option for this. With E2E=1, the world takes three ports of its own, so it runs beside shots-up.

deploy, release and publish-lexicons wait for e2e with the other six. AGENTS.md and docs/development.md say seven, and the latter has a section on the flows.

Why

The 100% gate counts only Rust, and the shots draw pages from fixtures without clicking anything. Nothing ran the roughly 25 components in web/src/lib that write: a button that sent the wrong method or record, or a page that never showed what it wrote, got past every check. Several of them (StarButton, FollowButton) swallow errors, so such a bug shows only as a button that does nothing. The check runs only on pulls that change the pages, the server or client, or the harness it runs over.

How it was checked

just e2e here: 9 of 9 flows, three runs in a row, about 40 s each with seeding. To see that it catches what it is meant to, StarButton's write was pointed at a method that does not exist. The page drew without complaint, and the starring flow failed. node harness/docs.mjs: 0 problems. The workflow itself, Chromium's apt dependencies in the rust image included, is first run here.

Shortcomings

Forking, rerunning a check, starting an organization, merging and the settings pages have no flow yet. Each run seeds its own world, which takes most of its time. Chromium's system libraries come from apt on every run.

🤖 Generated with Claude Code

Approved

This adds a seventh check, e2e. It drives the pages in Chromium through login, star, follow, issue, comment, reaction, close/reopen, label and logout. Each write is read back from the page, from the PDS and from the page reloaded. The pull also adds a gateway option to serve(), a just e2e recipe, and updates deploy, release and publish-lexicons and the docs to wait for seven checks.

I found nothing that must change. The wiring matches how harness/scenarios.mjs already runs the gateway behind tls-proxy.mjs. The default shots world is unchanged unless E2E=1, and the docs and AGENTS.md are updated with the code.

Two things to watch:

  • The e2e workflow is still queued, so I could not read its result. This is its first run in CI, and it needs the node step to work with /opt/node and apt Chromium dependencies in the rust image. deploy now waits on it, so check that it is green before merging.
  • In harness/e2e/setup.mjs, if tls-proxy.mjs exits before printing its port, line is undefined and .trim() throws. This happens before the try, so the proxy and world are left running. It is a small fix: wrap that part in the same cleanup, as scenarios.mjs does by rejecting on exit.
Approved

The new commit caches Chromium's apt libraries in /opt/chromium-debs. It uses playwright install-deps --dry-run to list the packages, downloads the .deb files only when the OS version or package list changes, and installs them with dpkg -i. I found nothing that must change.

Two things from my earlier review are still open:

  • Proxy start-up: in harness/e2e/setup.mjs, if tls-proxy.mjs exits before printing its port, line is undefined and line.trim() throws before the try. The proxy and world are left running. This is unchanged. It only matters when the proxy fails, but it is a small fix.
  • CI result: the e2e check is still running, so I could not read its result. The caching step has not run in CI yet, so wait for it to go green. deploy now waits on e2e.

One thing I did not verify: if the .deb cache is empty after the download, dpkg -i $debs/*.deb would receive the literal glob and fail. This can happen if every package is already installed in the image. The CI run will show it.

Merged as 0555388