feat(dashboard): add durable_dashboard package + engine and tooling overhaul#7
Merged
feat(dashboard): add durable_dashboard package + engine and tooling overhaul#7
Conversation
Embeddable web dashboard for Durable: Plug.Router entry → Phoenix Router → per-page LiveViews (Overview, Workflows, Workflow detail, Inputs, Schedules, Settings) with a single ReactFlow island for the workflow graph. Mounted into a host app via the `use DurableDashboard.Router` macro.
The overview page had two visible bugs:
- "View all" rendered as `<button href>` and never navigated, because
Core.button always emitted a `<button>` regardless of the
href/patch/navigate attrs already declared in :rest. Make button/1
delegate to `<.link>` when navigation attrs are present, which also
unbreaks the same call sites in stub_live.ex and workflow_live.ex.
- The Recent workflows row only navigated when clicking the workflow
name; the rest of the row was dead space. Make the entire `<tr>` a
click target via JS.dispatch("durable:goto", ...), matching the
pattern DataTable already uses for the same forwarded-sub-router
reason (see data_table.ex:506-511).
Also reorder the Recent workflows columns to ID, Workflow, Status,
Queue, Started, and reorder WorkflowsLive's column spec to match so
the overview stays a faithful preview of the full list.
- Three bug-report docs under docs/bug-reports/ covering the parallel-context-and-serialization investigation, fix plan, and follow-up audit. - CLAUDE.md gains a "Dashboard UI work" pointer to durable_dashboard/DESIGN.md so contributors codify visual decisions before applying them. - .gitignore picks up node_modules/ and package-lock.json so dashboard asset development doesn't leak into the repo.
Introduces Durable.PubSub, an optional Phoenix.PubSub-backed broadcaster the engine uses to publish workflow_started / resumed / waiting / completed / failed / cancelled events. Configuration is opt-in: - `pubsub: :start` — Durable starts and owns its own Phoenix.PubSub. - `pubsub: MyApp.PubSub` — reuse one already started by the host. - omit `:pubsub` — broadcasting is disabled. `phoenix_pubsub` is added as an optional dependency so existing users who don't need broadcasting are unaffected. The supervisor adds the PubSub child only when Durable owns it; a clear error message guides users who opted in without adding the dep.
Adds V20260413000000AddSchedulerResilience migration that extends the scheduled_workflows schema with state needed to survive scheduler crashes mid-trigger. Scheduler API/runtime and the schema are updated to use the new fields; a host-side migration template is included for the demo app. Also adds a scheduler_resilience_test covering the recovery paths.
A bundle of incremental engine work and the tests that go with it: - Executor / step runner: crash-mode coverage and error sanitization, retry-context refinements. - Queue / postgres adapter: worker-level tests, stale-job recovery integration test, adapter behaviour tweaks. - Wait primitives: timeout-worker integration test plus broader wait_test coverage. - Log capture, query, orchestration, DSL/step, repo: assorted improvements pulled from the parallel-context bug fixes referenced in docs/bug-reports/. - Test support: shared TelemetryHandler, SinkWorkflow fixture, and a beefier DataCase that boots the full Durable supervision tree.
Adds six new operator-facing Mix tasks plus shared helpers: - durable.doctor — health check across config, queue, scheduler, db. - durable.inspect — drill into a single workflow execution. - durable.pending — list workflows waiting on input or events. - durable.provide_input — feed input to a paused workflow. - durable.retry — re-run a failed workflow. - durable.send_event — trigger a wait_for_event from the CLI. Existing cancel/cleanup/list/run/status tasks pick up minor consistency fixes via the new lib/mix/helpers.ex shared module.
- Replace the document/approval LiveViews with a richer set of pages: home, executions, pending-events, pending-inputs, schedules, plus a redesigned workflow_detail and a workflow_form component. - Add seven sample workflows (content moderation, drip email, expense approval, hourly metrics cron, order fulfillment, payment, payment reconciliation) that exercise different Durable features. - Add a seed_workflows mix task for populating demo data. - Update layouts, router, application, configs, and asset CSS to match the new page layout. - Bump mix.exs deps to pull in dashboard + new sample workflow needs.
Move :durable into durable/ as a sibling to durable_dashboard, modeled on elixir-nx/nx. Each package keeps its own mix.exs, mix.lock, _build/, and Hex publishing pipeline; cross-references go through path: deps. A thin root mix.exs fans out setup/compile/test/format/precommit to each published package. CI is rewritten as per-package jobs gated by dorny/paths-filter with a single ci-status aggregator for branch protection.
The new dashboard CI job runs `mix format --check-formatted`, which caught two committed files that were never run through the formatter.
Plug 1.19 dropped this helper. Use put_in/2 on the conn struct, which is what cookie_session does internally. Caught by the new dashboard mix compile --warnings-as-errors step.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
chore: restructure into path-dep monorepo workspace): moved:durableintodurable/as a sibling todurable_dashboard, modeled onelixir-nx/nx. Each package keeps its ownmix.exs,mix.lock,_build/, and Hex publishing pipeline; cross-references go throughpath:deps. A thin rootmix.exsfans outsetup/compile/test/format/precommitto each published package. CI rewritten as per-package jobs gated bydorny/paths-filterwith a singleci-statusaggregator for branch protection.durable_dashboardHex package: a LiveView-driven web UI (sidebar, command palette, workflow detail tabs, ReactFlow graph island, schedules/inputs lists, settings) backed bydashboard_counts/1andlist_executions_with_total/1. Design language codified indurable_dashboard/DESIGN.md.Durable.PubSubmodule that broadcasts workflow lifecycle events viaPhoenix.PubSub.mix durable.*task suite:doctor,gen.upgrade,inspect,migrations,pending,provide_input,retry,send_eventplus existing tasks aligned around shared helpers.examples/phoenix_demo) rebuilt around the new dashboard, with seed workflows and a fresh set of LiveViews (executions, pending inputs/events, schedules, home, workflow detail).v20260413000000_add_scheduler_resilience) andmix durable.gen.upgradeflow for shipping schema upgrades.Test plan
cd durable && mix precommit(format, compile --warnings-as-errors, credo --strict, test)cd durable_dashboard && mix testcd durable_dashboard/assets && pnpm install && pnpm buildcd examples/phoenix_demo && mix testand smoke-test the demo against the dashboardcd durable && mix durable.doctor/durable.migrations/durable.gen.upgradeagainst a clean Postgresmix setup && mix compile && mix test(workspace coordinator fans out to both packages)