free legacy soft-deleted workflow names#4844
Closed
elias-ba wants to merge 2 commits into
Closed
Conversation
Workflows soft-deleted before merges renamed on delete still hold their original (name, project_id), which the uniqueness rule uses to block a later merge from recreating that name. Add a release task, Lightning.Release.backfill_deleted_workflow_names/1 with a bin wrapper, that renames them to name_del the same way the app now does, reusing resolve_name_for_pending_deletion so freed names match. Idempotent, with a dry_run option. Removed in the follow-up cleanup PR once the cutover has run.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## sandbox-merge-followups #4844 +/- ##
=======================================================
Coverage 90.4% 90.4%
=======================================================
Files 444 444
Lines 22632 22632
=======================================================
Hits 20453 20453
Misses 2179 2179 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Security Review ✅
|
Contributor
Author
|
Closing this. The team's conclusion is that the real fix is the missing workflow purge lifecycle (#4163), not a one-off backfill. Renaming the existing rows just patches one symptom (merge name collisions); #4163 will purge soft-deleted workflows properly once their history has aged out under the project's retention, and can weigh the partial-index option that removes the rename approach altogether. Folding the intent into #4163 rather than shipping the bandaid. |
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
A one-off release task to free the names of workflows soft-deleted before merges renamed on delete. They still hold their original name, which the uniqueness rule uses to block a later merge from recreating it (~900 such workflows in prod). #4842 stops new ones forming; this clears the existing ones.
Lightning.Release.backfill_deleted_workflow_names/1(viabin/backfill_deleted_workflow_names) renames each toname_del, reusing the app's existing logic. Idempotent, with adry_run: trueoption.Validation steps
In
iex -S mix, seed a few soft-deleted workflows including a collision:Then:
Lightning.Release.backfill_deleted_workflow_names(dry_run: true)reports the count and writes nothing.Lightning.Release.backfill_deleted_workflow_names()frees the names:Patient SyncbecomesPatient Sync_del,ReportbecomesReport_del1(sinceReport_delis taken),Live Oneis untouched.{:ok, 0}.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)
(e.g.,
:owner,:admin,:editor,:viewer)