Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

feat(listener): upsert BuiltAppRoute on Application publish#18

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/builtapproute-lifecycle
May 12, 2026
Merged

feat(listener): upsert BuiltAppRoute on Application publish#18
rubenvdlinde merged 1 commit into
developmentfrom
fix/builtapproute-lifecycle

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Completes the Application publish transition's declarative fallback. ApplicationVersionSnapshotListener already implemented the on_transition.create_relation half (version snapshot); this adds the on_transition.upsert_relation half (the BuiltAppRoute slug → applicationUuid index that GET /api/applications/{slug}/manifest resolves). Without it, only the hello-world seed (whose route SeedHelloWorld creates explicitly) was reachable — user-created apps published through OR got no route. Idempotent. Tests updated + route-skip case added.

Quality gates green (phpcs/phpmd/psalm/phpstan). PHPUnit/Newman CI reds are pre-existing (#11). See follow-up issue for the remaining publish-path gap (a raw PUT setting status=published doesn't make OR fire ObjectTransitionedEvent).

The Application schema's `publish` transition declares
`on_transition.upsert_relation` for the BuiltAppRoute (slug →
applicationUuid) — the index GET /api/applications/{slug}/manifest uses
to resolve a virtual app. OR's lifecycle engine does not execute that
action (ADR-031 §Exceptions(1)), and the existing
ApplicationVersionSnapshotListener only implemented the sibling
`create_relation` (the version snapshot), so user-created apps published
through OR never got a route — only the hello-world seed (which
SeedHelloWorld creates the route for explicitly) was reachable.

ApplicationVersionSnapshotListener now also find-or-creates the
BuiltAppRoute on the draft→published ObjectTransitionedEvent, mirroring
SeedHelloWorld's logic. Idempotent: an existing route already pointing at
this Application is left untouched. Tests updated + a route-skip case
added.

Note: a plain PUT that sets status=published does not currently make OR
fire ObjectTransitionedEvent — see follow-up issue — so this is the
correct fallback for when the transition fires, not a complete fix for
publishing-via-raw-PUT.
@rubenvdlinde rubenvdlinde merged commit 7aa2a1e into development May 12, 2026
16 of 23 checks passed
@rubenvdlinde rubenvdlinde deleted the fix/builtapproute-lifecycle branch May 12, 2026 08:17
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openbuilt @ 2c99592

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 430/430
PHPUnit
Newman
Playwright ⏭️

Coverage: 0% (0/19 statements)


Quality workflow — 2026-05-12 08:19 UTC

Download the full PDF report from the workflow artifacts.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant