Commit 06ea581
committed
feat(demo): the seed data ships with the extension, and screenshots need no ddev
Three things were tangled together, and untangling them is what this is.
THE SEED WAS TIED TO ONE LOCAL TOOL. It lived under .ddev/ as two MySQL dumps
plus a raw-PDO script hard-wired to host `db`, database `v14` and root/root.
Nothing else could use it: not the functional suite, which runs on SQLite, and
not a documentation screenshot run, which needs the same rows to exist
somewhere it can serve TYPO3 from. The data now lives in
Resources/Private/Demo/DemoData.php and `nrllm:demo:seed` writes it through the
ConnectionPool, so the DBMS is whatever the instance uses.
Relations are named by IDENTIFIER. The SQL resolved them through MySQL session
variables that looked up "whatever is default right now", so the graph depended
on insert order and on flags it did not set itself.
THE NUMBERS ARE REAL AND REPRODUCIBLE. Every value in the usage history is
derived from (seed, day, model) rather than drawn from a seeded global stream.
Two things break the global stream and both did: a value depends on how many
numbers were drawn before it, so the history changes when iteration order does
— and PHP-CS-Fixer rewrites mt_srand/mt_rand to srand/random_int, which is
cryptographically seeded and ignores the seed entirely. The reproducible
history would have been silently un-reproducible from the first `-s cgl` run.
Verified by checksum: cgl now leaves the file byte-identical.
The demo graph also gained a priced stream. The local Ollama models are free,
so every cost surface read $0.00 — the functional test caught exactly that, and
`cost_input`/`cost_output` are CENTS per 1M tokens, which the first formula had
wrong by five orders of magnitude.
SCREENSHOTS NO LONGER NEED DDEV, AND NO LONGER SHOW THE MENU.
Build/Scripts/screenshots.sh installs TYPO3 on SQLite, seeds it, serves it with
PHP's built-in server and drives Playwright at it. Every piece already existed;
the only local answer to "a running TYPO3" was E2E_BASE_URL pointing at a ddev
site, which is why taking a screenshot needed a tool meant for humans.
screenshots.spec.ts captures the module IFRAME, not the window. TYPO3 v14
renders module content in an iframe, so that element IS the module without the
menu. This is not cosmetic: all sixteen full-window PNGs went stale the day the
modules moved into the AI section, because each showed `Administration > LLM`
in the sidebar. A module-only shot cannot go stale that way.
Five things had to be fixed to make that pipeline run, each found by a failure
that named something else:
- a router script, because handing index.php to `php -S` makes it the router
for /_assets/* too and the backend renders with no stylesheet at all
- trustedHostsPattern, because the container reaches the server by a name the
install never saw and TYPO3 answers 500, which reads as "server not up"
- loginRateLimit off and a fresh database each run, because eight logins from
one address plus one early wrong password locks the rest out with a 403
- PHP_CLI_SERVER_WORKERS, because the built-in server is single-threaded and
parallel browser workers queue until the navigation times out
- --workers=1, for the same reason
One upstream bug is worked around rather than fixed here:
netresearch/typo3-ci-workflows v1.6.0 uses ${IMAGE_PLAYWRIGHT} at line 715 and
assigns it nowhere, while every sibling IMAGE_* is set around line 540 — so
`-s e2e` feeds docker an empty image and dies with "invalid reference format".
It can never have started a container. screenshots.sh supplies the image,
pinned to the version package-lock.json resolves because the image ships
matching browsers. Reported separately.
Tests: Tests/Functional/Command/SeedDemoDataCommandTest.php, 5 tests / 23
assertions, on SQLite — which is itself the evidence that the seed left ddev.
It asserts the counts against the shipped data rather than repeating them, that
every relation resolves to a real uid, that a second run updates rather than
duplicates, and that the same --days produces identical totals twice.
Gates: unit 7318 / 24770, functional (sqlite) for the new class, cgl, phpstan
level 10 — all green on PHP 8.4. The screenshot pipeline ran end to end: 8
passed, all eight PNGs rewritten. Rector NOT run: pinned to 8.2, this .Build is
resolved at 8.4, platform_check fatals. CI covers it.
Assisted-by: claude-code:claude-opus-5
Agent-Session: https://claude.ai/code/session_01MNg1MysJVugv1xo2husknU
Agent-Host: 0493f0
Signed-off-by: Sebastian Mendel <sebastian.mendel@netresearch.de>1 parent 719e652 commit 06ea581
31 files changed
Lines changed: 1477 additions & 1239 deletions
File tree
- .ddev
- commands
- host
- web
- scripts
- sql
- Build/Scripts
- Classes/Command
- Configuration
- Documentation
- Administration
- Images
- Resources/Private
- Demo
- Language
- Tests
- E2E/Playwright
- Functional/Command
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
52 | | - | |
| 51 | + | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
106 | 102 | | |
107 | 103 | | |
108 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
107 | 103 | | |
108 | 104 | | |
109 | 105 | | |
| |||
0 commit comments