Skip to content

Cleanup detached changesets

Administrator requested to merge rc/cleanup-changesets into main

Created by: Piszmog

Closes #16122.

  • Created a DB migration to add a new column detached_at to the changesets table to track when a Changeset becomes detached
  • Set the detached_at value when the ReconcilerOperationDetach is ran
  • Added a new janitor job (NewChangesetDetachedCleaner) to delete Changesets that are "old" (runs every 24 hours)

Test plan

Go unit tests and manual testing.

Manual Testing Steps

  1. Create a Batch Change
  2. Apply and Publish the Changeset
  3. Modify the Batch Spec to where the Changeset will no longer exist
  4. Rerun spec and Apply the Changes
  5. Changeset is now Archived/Deleted
  6. Detach the Changeset
  7. In the DB, ensure detached_at is set
  8. Update detached_at to 2 or so weeks out
  9. Wait for the periodic job to cleanup the Changeset (may need to restart the app since runs once a day)

Merge request reports

Loading