Compare commits

...
Author SHA1 Message Date
Antigravity AI aff9bfafd7 fix(ci): stub seeder interval+fetch + drop redundant compose mount
Companion to wwv-data-engine fix/ci-stub-interval-fetch. The source-of-truth
stub (docker/ci/stub-seeder) used cron+fn and called ctx.setLiveSnapshot,
which the seeder ctx ({ redis }) does not expose — the snapshot never landed.
Switch to interval+fetch (return the array; scheduler auto-wraps + stores it).

Also remove the plugin-CI compose's ./stub-seeder volume mount and the stale
'Known foundation gap (deferred)' comment: the stub is now baked into the :ci
image at /app/seeders/stub, so the compose needs no host path and a consumer
repo can run it with only this YAML.
2026-06-04 23:50:39 +12:00
3 changed files with 18 additions and 19 deletions

No files matched your search

+8 -14
View File
@@ -18,18 +18,12 @@
# Reuse the pattern from worldwideview/tests/global.setup.ts. DB migrations
# are handled automatically by the wwv-app entrypoint at container start.
#
# ─── Known foundation gap (deferred) ───
# ─── Stub seeder source ───
#
# The stub-seeder is mounted via `./stub-seeder:/app/seeders/community/stub-seeder`
# below — a path RELATIVE to this compose file. When a consumer repo downloads
# only this YAML, that path resolves to nothing. The clean fix is to bake the
# stub-seeder into the `wwv-data-engine:ci` image at /app/seeders/community/__ci-stub__/
# so the compose only needs to set STUB_PLUGIN_ID. That requires a coordinated
# Dockerfile change in the wwv-data-engine repo — tracked as the next session's
# first task.
#
# Until then, this compose only works when the worldwideview source tree
# (with docker/ci/stub-seeder/) is the working directory.
# The stub seeder is baked into the `wwv-data-engine:ci` image at
# /app/seeders/stub (see wwv-data-engine/Dockerfile.ci). The compose only needs
# to set STUB_PLUGIN_ID — no volume mount, so a consumer repo can download just
# this YAML and run it without the worldwideview source tree present.
#
# Expected env vars from consuming workflow:
# PLUGIN_ID — kebab-case id of the plugin under test (e.g. "aviation")
@@ -71,9 +65,9 @@ services:
STUB_PLUGIN_ID: ${PLUGIN_ID}
WWV_SKIP_WS_AUTH: "true"
NODE_ENV: ci
volumes:
# Mount only the stub seeder — no other seeders to avoid contamination
- ./stub-seeder:/app/seeders/community/stub-seeder:ro
# No volume mount: the stub seeder is baked into the :ci image at
# /app/seeders/stub, so the engine discovers it as id "stub" with no host
# path dependency.
depends_on:
wwv-redis:
condition: service_healthy
+9 -4
View File
@@ -10,6 +10,11 @@ const pluginId = process.env.STUB_PLUGIN_ID;
// When unconfigured (e.g. seeder-CI, where this stub is baked into the shared
// :ci image but unused), export a nameless module so the seeder-loader skips
// it instead of crashing the engine.
//
// Uses the interval+fetch seeder contract: fetch() RETURNS the array and the
// scheduler auto-wraps it into a snapshot stored under the seeder id. The
// cron+fn contract would require the engine-internal setLiveSnapshot, which is
// NOT exposed on the seeder ctx (ctx is only { redis }).
function makeEntities() {
const now = new Date().toISOString();
@@ -40,11 +45,11 @@ function makeEntities() {
export default pluginId
? {
name: pluginId,
cron: "*/10 * * * * *",
fn: async (ctx) => {
interval: 10000,
fetch: async () => {
const entities = makeEntities();
await ctx.setLiveSnapshot(pluginId, entities, 300);
console.log(`[stub-seeder] emitted ${entities.length} entities for ${pluginId}`);
console.log(`[stub-seeder] emitting ${entities.length} entities for ${pluginId}`);
return entities;
},
}
: {};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "worldwideview",
"version": "2.48.20",
"version": "2.48.21",
"private": true,
"type": "module",
"packageManager": "[email protected]",