feat: add configurable preview job tag override in default tags settings
Merged
RU
8mo ago+120+120+012345678901234567890123456789-36-36-01234567890123456789
Summary
Add a new toggle in the "Default tags" superadmin settings that routes all preview jobs (script previews and flow previews) to a dedicated preview tag instead of their normal language-based tag.
Changes
- Add
preview_tags_overrideglobal setting (constant, static, load/hot-reload, instance config) - Add
JobKind::is_preview()helper method - Override tag resolution in
push_innerto use"preview"tag when setting is enabled - Override re-tagging path for
FlowPreviewjobs pulled by workers - Add toggle and preview tag row in the
DefaultTagsInner.svelteUI component - Respects per-workspace suffix (
preview-{workspace_id}) when both settings are enabled - User-provided explicit tags are never overridden
Test plan
- Navigate to superadmin settings > Workers page > Manage tags drawer. Enable the "route preview jobs to dedicated preview tag" toggle and save. Verify a "preview" row appears in the tag list
- Run a script preview and check the job's tag is
"preview"(not the language tag) - Run a flow preview and check the job's tag is
"preview"(not"flow") - Enable both "workspace specific" and "preview override" toggles — verify preview jobs get tag
"preview-{workspace_id}" - Disable the toggle — verify preview jobs return to their normal language-based tags
Generated with Claude Code
Summary by cubic
Add a new superadmin toggle to route all preview jobs (script and flow) to a dedicated preview tag, so you can isolate preview traffic to specific workers. Supports per‑workspace suffix and hot‑reloads on change.
- New Features
- Global setting
preview_tags_override(dynamic load/hot‑reload). - When enabled, preview jobs use
previewinstead of language/flow tags. - Respects per‑workspace tags:
preview-{workspace_id}when that setting is on. - User‑provided explicit tags are never overridden.
- UI: toggle in Superadmin → Workers → Default tags, plus a “preview” mapping row.
- Backend: added
JobKind::is_preview(), updated push/pull paths to apply the preview tag, and skip re‑tagging forFlowPreviewwhen the override is on.
- Global setting