Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
5.0 KiB
5.0 KiB
Scratchpad
Status
- Converted all scaffolded workflow-harness fixtures into business-valid, notification-based fixtures with deterministic DB assertions and cleanup.
Notes / Decisions
- Harness “channels” confirmed:
- Session+tenant context:
Cookie+x-tenant-idinjected intools/workflow-harness/lib/http.cjs(createHttpClient, lines ~22–36). - Optional REST API auth: auto-injects
x-api-keyfromWORKFLOW_HARNESS_API_KEY/ALGA_API_KEYif not already set (tools/workflow-harness/lib/http.cjs, lines ~32–36). - DB assertions + cleanup:
ctx.dbread-only guard andctx.dbWritewrite-enabled client (tools/workflow-harness/lib/db.cjs, lines ~5–48; wired intools/workflow-harness/run.cjs, lines ~126–190).
- Session+tenant context:
- Failure artifacts confirmed:
- Root:
<artifactsDir>/workflow-harness/<fixture>/<timestamp>[-<runId>]/...(tools/workflow-harness/lib/artifacts.cjs, lines ~15–37). - Failure payloads written in
tools/workflow-harness/run.cjscatch block (starts ~262), includingfailure.context.jsonandfailure.error.txt.
- Root:
- Inventory results:
- Found 139 scaffolded fixtures (bundle description contains “Scaffolded catalog fixture…” AND
test.cjsuses_lib/scaffolded-fixture.cjs). - Scaffolded fixtures currently hardcode
payload.TicketCreated.v1regardless of event; conversion must fix schema refs first. - Unique event types across scaffolded fixtures include several not present in runtime schema registry today (need new
payload.*.v1refs + schemas):APPOINTMENT_REQUEST_*(CREATED/APPROVED/DECLINED/CANCELLED)SCHEDULE_ENTRY_*(CREATED/UPDATED/DELETED)PROJECT_ASSIGNED,PROJECT_CLOSEDTIME_ENTRY_APPROVED,TIME_ENTRY_SUBMITTEDTASK_COMMENT_ADDED,TASK_COMMENT_UPDATEDTICKET_COMMENT_ADDED,TICKET_ADDITIONAL_AGENT_ASSIGNEDPROJECT_TASK_ADDITIONAL_AGENT_ASSIGNED
- Note:
/api/workflow/eventsingestion auto-injectstenantId+occurredAtviabuildWorkflowPayload(...)before schema validation (server/src/lib/actions/workflow-runtime-v2-actions.ts, aroundsubmitWorkflowEventAction), so tests can omit those fields.
- Found 139 scaffolded fixtures (bundle description contains “Scaffolded catalog fixture…” AND
- Conversion approach (scale decision):
- Implemented a generic notification-based fixture template using
notifications.send_in_appas the persisted side effect. - Standardized fixture-only payload fields:
payload.fixtureNotifyUserId(recipient user id)payload.fixtureDedupeKey(deterministic marker/correlation + action idempotency)payload.fixtureBadUserId(try/catch fixtures only)payload.fixtureVariant(multi-branch fixtures only)
- Control-flow patterns applied by fixture name:
- default/idempotent:
control.if - foreach*:
control.forEach - trycatch*:
control.tryCatch - multi-branch*: nested
control.if - callworkflow*/subworkflow*:
control.callWorkflow+ child workflow, patched/published insidetest.cjs
- default/idempotent:
- Assertion target:
internal_notificationsrows containing[fixture <name>]and thefixtureDedupeKey.
- Implemented a generic notification-based fixture template using
- Added runtime schema refs for legacy event types needed by the converted fixtures:
- Scheduling legacy:
payload.ScheduleEntry*,payload.AppointmentRequest* - Projects legacy:
payload.ProjectAssigned,payload.ProjectClosed,payload.ProjectTaskAdditionalAgentAssigned,payload.TaskComment* - Tickets legacy:
payload.TicketCommentAdded,payload.TicketAdditionalAgentAssigned - Time legacy:
payload.TimeEntrySubmitted,payload.TimeEntryApproved
- Scheduling legacy:
Commands / Runbook
- Find scaffolded fixtures:
rg -l "_lib/scaffolded-fixture" ee/test-data/workflow-harness/*/test.cjs | xargs -n1 dirname | sed 's|^ee/test-data/workflow-harness/||' | sortrg -l "Scaffolded catalog fixture" ee/test-data/workflow-harness/*/bundle.json | xargs -n1 dirname | sed 's|^ee/test-data/workflow-harness/||' | sort- Both produced 139 identical fixture ids.
- Summarize scaffolded trigger event types:
cat /tmp/scaffolded-by-bundle.txt | while read -r f; do jq -r '.workflows[0].metadata.trigger.eventName' "ee/test-data/workflow-harness/$f/bundle.json"; done | sort | uniq -c | sort -nr
- Convert all scaffolded fixtures (one-time):
node tools/workflow-harness/convert-scaffolded-fixtures.cjs
- Quick sanity checks:
rg "_lib/scaffolded-fixture" ee/test-data/workflow-harness -S(expect none)rg "Scaffolded catalog fixture" ee/test-data/workflow-harness -S(expect none)node --test tools/workflow-harness/tests/runner-stubbed.test.cjs
Gotchas
transform.assignevaluation order gotcha: don’t build a string fromvars.markerinside the same assign map unless split into multiple steps (marker can be omitted).- Zod validation in
submitWorkflowEventActionchecks success but does not replace payload withvalidation.data, so unknown payload keys remain available to workflows (useful for fixture-only fields likepayload.fixtureNotifyUserId). notifications.send_in_appis idempotent;forEachfixtures must varydedupe_keyper iteration or inserts collapse to 1.