-
Notifications
You must be signed in to change notification settings - Fork 82
Add go_live/2 and switch_to_draft/2 workflow transitions#4869
Merged
Merged
Conversation
go_live sets a workflow to :live and enables its triggers; switch_to_draft sets it to :draft and disables them. Both go through the existing save_workflow path (snapshot + version recording). No UI wiring yet. Part of #4857
@github-project-automation
github-project-automation
Bot
moved this to New Issues
in Core
Jun 16, 2026
Security Review ✅
- S0 (project scoping): N/A —
go_live/2andswitch_to_draft/2operate on a%Workflow{}passed by the caller; they introduce no new query or web-layer entrypoint that accepts aproject_id. - S1 (authorization): N/A — no new LiveView events or controller actions were added; the new functions are context-layer helpers that callers must continue to gate with the existing
Lightning.Policieschecks. - S2 (audit trail): PASS — both helpers route through
save_workflow/3(workflows.ex:1038, 1052), whoseEcto.Multiincludesmaybe_audit_workflow_state_changes(workflows.ex:228, 546), so the trigger enable/disable flip is recorded as aworkflow_state_changedaudit entry in the same transaction.
Codecov Report
✅ All modified and coverable lines are covered by tests.
sandbox-devx@9da4432). Learn more about missing BASE report.
Additional details and impacted files
@@ Coverage Diff @@ ## sandbox-devx #4869 +/- ## ============================================== Coverage ? 90.5% ============================================== Files ? 445 Lines ? 22723 Branches ? 0 ============================================== Hits ? 20553 Misses ? 2170 Partials ? 0
☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@github-project-automation
github-project-automation
Bot
moved this from New Issues
to Done
in Core
Jun 16, 2026
7 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.
Description
Adds two lifecycle transitions to
Lightning.Workflows:go_live/2: sets a workflow's state to:liveand enables its triggers.switch_to_draft/2: sets it back to:draftand disables its triggers.Both go through the existing
save_workflow/3path, so each transition captures a snapshot and records a version in one transaction. No UI wiring and no read-only lock yet (those are the next slices), so nothing user-facing changes from this PR alone.Part of #4857. Targets the
sandbox-devxintegration branch, notmain.Validation steps
Workflows.go_live/2and confirm the workflow is:liveand all its triggers are enabled.Workflows.switch_to_draft/2and confirm it is:draftand all its triggers are disabled.Additional notes for the reviewer
AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code)
(N/A: no authorization changes in this slice)