Repository navigation
dev containers: contributor fixes, headless dev mode and the extension-author container #1487
Description
Why
Three things share the same pieces (.devcontainer, docker/, querya-ext-tester, action test-extension, release.yml) and are cheaper to design together:
- the contributor dev container has real defects (found while writing
docs/dev-containers.md, docs: dev container and local database stack guide #1486); - there is no defined headless way to develop and test Querya: what runs without a display is accidental;
- the 0.5.0 Marketplace needs an extension-author dev container (the plan: Feature + test database images + template + registry CI).
1. Contributor dev container: defects
- Databases are unreachable from the container. The stack runs on the host daemon (docker-outside-of-docker), so nothing listens on the container's loopback;
forwardPortssuggests otherwise. - Flutter differs from CI. The image is
ghcr.io/cirruslabs/flutter:3.41.6, CI pins3.47.1, and the registry has no 3.47.x tag (latest 3.44.0). - The stack's MySQL does not fit the app and the tests. Compose runs
mysql:8.4(caching_sha2_password, needs TLS); the live teststream_take_drain_test.dartconnects without TLS and skips. CI usesmysql:8.0+mysql_native_password. bubblewrapis missing, so the extension sandbox tests skip.postStartCommandhides failures (up -d || echo) and does not wait for health.
Fixes: join the container to querya-dev_default on start and fix forwardPorts / portsAttributes to what works; install Flutter 3.47.1 in the Dockerfile from the version in ci.yml and warn on a mismatch; a compose profile live-tests with mysql:8.0 native password on its own port (documented MYSQL_PORT); bubblewrap in the image; docker compose up -d --wait with a clear status.
2. Headless dev mode
Define it as levels, each runnable in a container or on a CI runner with no display, and make each one a single documented command:
| Level | What | Needs | State |
|---|---|---|---|
| L0 | flutter test sections, e2e, guards |
Flutter only | works (scripts/ci/test_sections.sh) |
| L1 | querya-ext-tester against a test database, --sandbox |
the tester binary, a database, bubblewrap | works; exit codes only correct since 0.4.19 (the main return value was ignored before) |
| L2 | the real app under Xvfb in portable mode: smoke start, MCP end-to-end through querya-mcp, screenshots |
Xvfb, a debug / release bundle | not defined: nothing starts Xvfb, no script, no CI job |
Scope:
scripts/dev/headless_app.sh: start Xvfb, run the bundle withQUERYA_PORTABLE=1in an isolated data directory, wait for the window, optionally take a screenshot (import -window root) and stop cleanly; reuse it for a CI smoke job.- A
docker compose --profileper level so one command brings up exactly what the level needs (no GUI services, no seeds that a level does not use). - One short table in
docs/dev-containers.mdfor the three levels. - Open question: should L2 grow a real "headless Querya" (core services without a window) for the MCP server? Today
querya-mcpneeds a running Desktop. Out of scope here, decide after L2 exists.
3. Extension-author container (0.5.0)
Existing: querya-ext-tester (--target-version, --connect, --query, --table, --database, --sandbox, --junit, --tap; release assets querya-ext-tester-v<ver>-<target> and SHA256SUMS.txt), .github/actions/test-extension (to be published as QueryaHub/action-test-extension), the docker/ seeds.
Missing:
- Dev Container Feature
ghcr.io/queryahub/features/querya-ext-tester(version: latest): downloads the tester from the release, checks SHA-256 againstSHA256SUMS.txt, puts it inPATH. Source in this repository (devcontainer-features/src/querya-ext-tester), published to GHCR on release. Must require a tester >= 0.4.19. - Test database images
ghcr.io/queryahub/querya-testdb-<db>built fromdocker/<db>with the seeds baked in (no bind mounts), tagged with the Querya version andlatest; the build matrix is the list ofdocker/*directories, so a new database appears automatically. extension-templaterepository:.devcontainer/devcontainer.json(the Feature + docker-in-docker),testenv/compose.ymlwith the images above, a CI workflow with a matrix of host versions using the action andservices:.- Registry (
extensions): record schema,compat.json,index.jsonon Pages, PR CI (schema,manifest.jsonin the archive, SHA-256, onlygithub.com/.../releases/download/..., matrix byenginesandtestEnv,querya-ext-tester --sandbox),StaticRegistryRepositoryin the app (todaylib/core/markethasHttpMarketplaceRepository). - release.yml hooks after a release: build and publish the Feature and the
querya-testdb-*images (<version>andlatest),repository_dispatchto the registry (compat.json, re-run all extensions) and to the template (a bot PR raises the version indevcontainer.json). - Nightly check in the registry: asset present and hash equal, otherwise an issue and
yanked.
Order
- Section 1 fixes and the
live-testsprofile (small, unblocks the rest). - L2 headless script and the level table (reusable by the Feature's own CI).
- The Feature and the
querya-testdb-*images, thenextension-template(0.5.0). - Registry CI and
StaticRegistryRepository(0.5.0). release.ymlhooks and the nightly check (0.5.x).
Acceptance
- In a fresh container
psql -h localhost -U querya querya,redis-cli -h localhost pingand the Querya connection form work without manual steps;flutter --versionprints3.47.1. -
stream_take_drain_test.dartruns (does not skip) with the documented profile. -
scripts/dev/headless_app.shstarts the app under Xvfb, finds the window and exits 0; a CI job uses it. -
devcontainer upon a template that uses the Feature and the compose file reachesquerya-ext-tester ./dist --connect ... --sandboxgreen with no manual install. -
docs/dev-containers.mdhas no "not checked" parts.
Activity
[-]fix(devcontainer): databases unreachable from the container, Flutter and MySQL differ from CI[/-][+]dev containers: contributor fixes, headless dev mode and the extension-author container[/+]