Pulp Engine v0.21.1 — Release Notes
Summary
Patch release following v0.21.0. No breaking changes. No schema migrations. No production code changes.
Test isolation hardening: file-mode API tests
Problem: Four tests in editor-session.test.ts were failing on every run after the first,
producing 409 Conflict errors. The root cause was that baseEnv() in both
editor-session.test.ts and auth-scopes.test.ts stubbed TEMPLATES_DIR to '../../templates'
— the real, persistent project templates directory — rather than an isolated temp directory.
Tests that created templates wrote files there and never cleaned them up. On subsequent runs
those files already existed, causing 409 Conflict on the duplicate create attempts. For
delete-audit-tpl specifically, softDelete marks a template inactive in its .meta.json
but does not delete the file, so even a “deleted” template still blocked future creates with
the same key.
The four consistently failing tests were:
| Test | Template key | Failure |
|---|---|---|
| actor: null — API-key write | actor-test-tpl | create → 409, no mutation log emitted |
| actor: Alice — editor-token write | actor-test-tpl2 | create → 409, no mutation log emitted |
| audit log shape — create via editor-token | audit-tpl | expect(statusCode).toBe(201) failed |
| audit log — delete via API key | delete-audit-tpl | soft-delete leaves meta.json; re-create → 409; expect(statusCode).toBe(204) failed |
Fix: baseEnv() now calls mkdtempSync(join(tmpdir(), prefix)) per invocation.
Temp directories are tracked in a module-level string[] and removed entirely in afterEach.
This is the same pattern already used in metrics.test.ts for its template mutation tests.
The fix was applied to both files:
apps/api/src/__tests__/editor-session.test.ts— primary fix (four previously failing tests)apps/api/src/__tests__/auth-scopes.test.ts— proactive fix; that file never creates templates today but had the same anti-pattern
The five test-artifact template directories that had accumulated in the real templates/
directory across previous runs were also removed:
actor-test-tpl, actor-test-tpl2, audit-tpl, delete-audit-tpl, update-audit-tpl
(the last had 15 accumulated version files).
Result: Full API suite is 380 passed, 0 failed on every run. The templates/ directory
contains only the three legitimate seed templates.
Upgrade notes
No action required. This release contains only test code changes. Production behaviour, the wire API, and all storage schemas are identical to v0.21.0.