Commit Graph
82 Commits
Author SHA1 Message Date
Donkie 0f3a3918c1 auth: focused integration test suite
101 tests covering the authentication system, run against a server with
SPOOLMAN_AUTH_ENABLED as a separate suite from the regression sweep.

Deliberately one SQLite variant rather than a fifth pass of the existing
four-database matrix. Nothing in spoolman/auth is database-specific, so
re-running the whole regression suite with auth on would quadruple the CI
bill to re-prove something none of those tests are about.

The tests live in tests_integration/tests_auth, a sibling of the regression
suite rather than a subdirectory of it, and the compose file mounts that
directory at the path the tester image's fixed entrypoint collects from. So
the auth suite runs exactly when asked and the regression runs can never
pick it up -- no entrypoint override, no collection guard, no way for the
two to interfere.

"sqlite-auth" is accepted by run.py but is not in the default target list,
so `poe itest` keeps meaning what it meant and `poe itest sqlite-auth` is
opt-in. CI gets its own small job for it, and the release gate now depends
on that job alongside the others.

Coverage:
  test_unauthenticated  every non-public route answers 401 without a
                        credential -- the black-box counterpart to the
                        import-time coverage assertion, and the test most
                        likely to catch a future route added without a gate
  test_setup            first claim succeeds, second is refused, username
                        stored lowercased
  test_login            success, wrong password, unknown user returning an
                        identical message, lockout with Retry-After, and
                        remember-me controlling cookie Max-Age
  test_csrf             cookie-authenticated writes need the header
  test_levels           the owner reaches read, edit and manage routes
  test_anonymous_read   the setting opens reads without opening writes, and
                        leaves the bulk exports closed
  test_websocket        rejection arrives as close code 4401, not as a failed
                        handshake -- the regression test for the uvicorn
                        behaviour that dictated the whole websocket design
  test_password         change requires the current password and takes effect

One test asserted that using 10 g leaves used_weight at 10. It is a running
total, and the spool was created with remaining_weight below the filament's
net weight, so it already stood at 500. Rewritten to assert the delta.

Verified by running both suites against a live server: 101 auth tests pass
with auth on, and the existing 372 regression tests still pass with auth off
and no test file edited.
2026-07-28 13:10:55 +02:00
Donkie 638466bc70 Bake client_v2 into the image and serve it by default
Build the new Svelte client (client_v2) in CI, bake it into the Docker
image alongside the legacy React client, and serve it by default. Set
SPOOLMAN_LEGACY_CLIENT=TRUE to fall back to the old client.

SinglePageApplication is generalized to serve either client: the React
client keeps its index.html + base-path rewriting, while the Svelte
client uses a 200.html SPA fallback, serves prerendered per-route pages,
and serves relative-path assets verbatim. The tweaked-HTML store is moved
off self.html, which StaticFiles uses as its HTML-mode flag.

The Playwright frontend suite targets the React DOM, so it's pinned to
the legacy client via SPOOLMAN_LEGACY_CLIENT for now.

Claude-Session: https://claude.ai/code/session_01VQQtwPBPiMCoZCpBbbqS64
2026-07-18 23:05:00 +02:00
Donkie 2c638da22a Auto-merge Weblate translation PRs on green CI
Weblate opens a PR for every translation sync. These are machine-generated,
always scoped to client/public/locales/, and gated by the full CI suite, so
hand-merging each one is pure friction. This enables GitHub auto-merge on
Weblate-authored PRs so they merge themselves once required checks pass.

A scope-guard step reads the PR's file list from the API and refuses to enable
auto-merge unless every changed file is a .json under client/public/locales/,
so the trust is in the diff, not just the author: a compromised Weblate token
can open a PR but can only be auto-merged if it is confined to translations.

Claude-Session: https://claude.ai/code/session_01BQjJiwEbu6bHbeDjPPDm3V
2026-07-07 10:11:28 +02:00
Donkie 48ad01b09b Add CI guard blocking manual edits to non-English translations
Non-English locales are managed exclusively through Weblate; any manual
edit to an existing translation file gets silently overwritten on the
next Weblate sync. This workflow fails any PR (except Weblate's own,
detected via PR author login) that modifies or deletes an existing
non-English file under client/public/locales/. Adding a brand-new
language file is still allowed so contributors can bootstrap a new
language alongside the client/src/i18n.ts entry.

Claude-Session: https://claude.ai/code/session_01BQjJiwEbu6bHbeDjPPDm3V
2026-07-07 09:35:12 +02:00
Donkie d9fd44eab9 Add Playwright frontend integration tests; fix broken SPA static serving
Add a browser-driven integration suite (tests_frontend/) that runs against
the real production image + PostgreSQL and drives the UI with Playwright:
a smoke test that navigates every page via the sidebar with no console
errors, and a CRUD test that creates a vendor -> filament -> spool entirely
through the UI. Wired up as `poe itest-frontend` and a new `test-frontend`
CI job (reusing the image built for the backend tests, gating releases).

Navigation goes through real UI buttons (language-independent link targets)
and the app language is forced to English so label matchers are stable
regardless of the runner's browser locale.

This immediately caught a real regression: Starlette 1.3.1 (pulled by a
recent dep bump) removed the `method` kwarg from FileResponse, so
SinglePageApplication 500'd on every static asset and the whole UI was dead.
Drop the removed kwarg — Starlette now derives HEAD handling from the scope.

Claude-Session: https://claude.ai/code/session_01BQjJiwEbu6bHbeDjPPDm3V
2026-07-07 09:12:42 +02:00
Donkie c033a3ffe6 Fix trigger release ci 2026-01-23 21:09:39 +01:00
Donkie 1974d4b8d2 Version bump updates 2026-01-23 21:07:45 +01:00
Donkie 8a29ce063a Update ci.yml 2026-01-18 17:30:55 +01:00
Donkie fa6343c368 Fix artifact job 2026-01-18 17:11:54 +01:00
Donkie 1cd8c7a962 Added ci job to produce artifact package for all builds 2026-01-18 17:05:00 +01:00
Donkie b361aee956 CI fixes 2026-01-18 16:55:31 +01:00
Donkie 8af6013331 Add issue manager workflow for automated issue handling 2025-06-16 19:23:26 +02:00
Donkie 7b7d73224d Set github ci permissions 2025-06-08 12:23:37 +02:00
Donkie 11a74e2197 Use env for ci ghcr_image since vars is not accessible in PRs 2025-04-12 19:42:53 +02:00
Donkie ec5173067e Add push to dockerhub 2025-03-19 19:05:17 +01:00
Donkie 590b0df191 Fixed release zip missing dot-files 2024-09-23 19:26:29 +02:00
Donkie 909d8c38bd Test stage now only downloads the relevant images 2024-09-08 22:17:46 +02:00
Donkie 13a038cb3e Updated all action versions 2024-09-08 13:29:27 +02:00
Donkie b70cfb0e79 Bump artifact action versions 2024-09-07 19:54:01 +02:00
Donkie 694e4b9f61 Update compose-action to try fix CI issue 2024-08-05 19:35:17 +02:00
Donkie 4f49481475 Update PDM lockfile
This updates all dependencies, as well as makes it compatible with latest PDM which now complains about the cross_platform strategy choice, we instead use inherit_metadata now.
2024-08-05 19:15:34 +02:00
Donkie fc532ff697 Update bug_report.md 2024-05-06 19:30:37 +02:00
Donkie b6b6fcf6bd Remove .venv in CI build job 2024-02-01 20:04:00 +01:00
Donkie f7c9c44ea7 Write build info earlier when we still have git 2024-01-25 22:58:25 +01:00
Donkie 721733551f Fix git commit in ci.yml 2024-01-25 22:54:26 +01:00
Donkie b40da6e2ee Updated commit and build date capturing
It's now written to a build.txt file instead of using environment variables internally. Standalone installs now has this properly as well.
2024-01-25 22:03:18 +01:00
Donkie 1479e13d94 Some script permission fixes 2024-01-25 20:49:16 +01:00
Donkie 2786eff3da Fixed release publishing happening outside tag push 2024-01-25 20:21:42 +01:00
Donkie 44d3ed72b0 CI job now builds a requirement.txt into the spoolman.zip 2024-01-25 20:11:12 +01:00
Donkie d424383ebb Fixed CI zip not including dot-files 2023-12-29 20:18:45 +01:00
Donkie dc84c8cd08 Moved to tmp dir instead 2023-12-29 12:42:05 +01:00
Donkie dec34df6bd Fixed some release publish issues 2023-12-29 12:33:51 +01:00
Donkie 96f1c86616 Update ci.yml 2023-12-29 12:13:21 +01:00
Donkie 0dfaa0ede4 Trigger release with PAT
This is needed because the regular GITHUB_TOKEN does allow repo write, but it doesn't trigger any new actions.
2023-12-29 12:00:48 +01:00
Donkie f083ed9c5c Updated push method in trigger release to hopefully push the tag also 2023-12-29 11:43:21 +01:00
Donkie 64528b08e6 Added git name and email to release trigger job 2023-12-29 11:36:08 +01:00
Donkie 57ea0f5af9 Combine release workflow into CI 2023-12-29 11:18:25 +01:00
Donkie 66189caeb4 Update issue templates 2023-12-29 00:41:38 +01:00
Donkie 3ee7d355b6 Added new CI jobs for release automation 2023-12-29 00:35:51 +01:00
Donkie 86af6434a9 Fixed CI name collision with built docker images 2023-12-28 11:43:16 +01:00
Donkie 75a8128f19 New CI step to produce a full Spoolman build zip 2023-12-28 11:23:34 +01:00
Donkie 4287b2d6bc Delete build-client.yml
It's now redundant since the CI job does it as well
2023-12-17 23:07:20 +01:00
Donkie b66a2c5242 Removed unnecessary zip in ci client build 2023-12-17 23:01:25 +01:00
Donkie 60b67ee758 Dockerfile no longer builds client
This proved to be extremely slow on emulated hardware to build e.g. the linux/arm/v7 image.
Since the built client is architecture agnostic, it's instead now built on the native hardware and inserted into the docker image.
2023-12-17 22:53:17 +01:00
Donkie fe6422597f Updated to node 20 in build client workflow 2023-12-17 22:51:56 +01:00
Donkie e59eb816ed Added client building pipeline 2023-10-14 13:28:48 +02:00
Donkie 64416f2ec2 Create FUNDING.yml 2023-10-14 11:02:53 +02:00
Donkie 1a3efd9ea9 Added git commit and build date env and API 2023-09-17 10:51:28 +02:00
Donkie a1a4ad6b45 Revert "Add git hash to version for master builds"
This reverts commit af1f3b45c5.
2023-09-17 09:43:25 +02:00
Donkie af1f3b45c5 Add git hash to version for master builds 2023-09-16 20:06:14 +02:00