Skip to content

Deleting a Patch

Terminal window
ringctl patch delete <patch_id> -e <cellsdev|cellsprod>

A failed patch might have been partially applied, so we need to revert the patch along with deleting the failed patch.

To revert a failed patch, make the following changes in a single MR:

  1. Delete the failed patch

    Terminal window
    ringctl patch delete <patch_id> -e <cellsdev|cellsprod>

    This will create a branch on the remote and commit to it. Push the following changes to the same branch.

  2. Introduce a new patch reverting the attribute(s) that were changed in the failed patch to its previous value. You can determine the previous value of the attribute(s) by looking at the commit that applied the patch to the ring (example).

    Make sure you set the following attributes correctly:

    • Set the ring key in the new patch to the same ring where the previous patch failed.

    • Set the completed_after_ring key in the new patch to the same value as the ring key, so that the new patch is only applied to the ring where the previous patch failed.

    • Set a higher priority for the new patch, so that it is executed first, before any patches that are already in the queue. For example, if the first patch in the queue has a priority of 4, set the priority of the new patch to 3, so that it is placed at the front of the queue.

For a patch that modifies only prerelease_version and has only_gitlab_upgrade: true, it is safe to just delete the failed patch file if the next patch in the queue is also an auto-deploy patch. If not, you can follow the above steps to revert the failed patch.