Repository navigation
Send deleted workflows to Lightning on v1 deploy - #1611
Open
midigofrank wants to merge 1 commit into
Open
midigofrank wants to merge 1 commit into
midigofrank wants to merge 1 commit into
Conversation
toProjectPayload filtered out workflows that mergeSpecIntoState had
marked { id, delete: true }, so the payload omitted them. Lightning's
provisioner casts workflows with on_replace: :raise, so a document
missing an existing workflow raised and returned a 500 instead of
soft-deleting it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Just seen this @midigofrank - I'll try and get to it this afternoon |
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.
Short Description
Removing a workflow from a v1 spec and running
openfn deployfails with a 500. The CLI marks the workflow{ id, delete: true }but then drops it from the payload, so Lightning never receives the delete. This sends it.Follow-up to #1457, which added the
{ id, delete: true }marking and the filter intoProjectPayload(released in@openfn/cli@1.38.1, which Lightning v2.17.0 bundles).Implementation Details
mergeSpecIntoStatemarks a workflow that's in state but not in the spec as{ id, delete: true }.toProjectPayloadthen filtered those out, so the document sent to Lightning omitted an existing workflow.:workflowswithon_replace: :raise. A missing workflow raisesyou are attempting to change relation :workflows of Lightning.Projects.Project but the :on_replace option of this relation is set to :raise, which comes back as a 500.{ id, delete: true }(renamed<name>_del,deleted_atset). The CLI now sends that.The #1457 test only covered
mergeSpecIntoState. The new test covers the payload, and fails without this fix.The
as anyis there becauseProjectPayload['workflows']requiresname/jobs/etc. Widening it to a union breaksgetStateFromProjectPayload, so I kept the cast local.QA Notes
Checked end to end against Lightning
main: I added a test totest/integration/cli_deploy_test.exs(not committed there) that pulls the canonical project, deploys the update fixture withoutworkflow-2and asserts it's soft-deleted.Internal Server Error.To reproduce: pull a project, remove a workflow from
project.yaml, runopenfn deploy.AI Usage
🤖 Generated with Claude Code