Skip to content

Don't detach merged/closed changesets on update

Warren Gifford requested to merge campaigns/keep-merged-changesets into master

Created by: eseliger

This closes #8981 (closed) by doing two things:

When we previously updated a Campaign that had a patch set with patches for repositories A, B, C to use a patch set with patches for repositories A, B and D, we would remove the patch for repository C and if a changeset was already created on the code host, we would close it and detach it from the campaign.

Now we check whether the changeset we're about to close & detach has already been merged or closed (signifying a success!) and if so, we don't detach it, but keep it around.

That means you can keep re-running an src action exec command with the same action definition while the changesets in the campaign are being merged or closed. If a repository doesn't produce a patch anymore (because the requested changes have been accepted!) you can still update your campaign with the new patch set without the merged changeset being lost.

The other thing this PR does is to change our "clean up of old patch sets"-behavior. Previously we deleted old PatchSets that weren't attached to a Campaign. Now we delete PatchSets that are either (a) not attached to a campaign and (b) don't have patches that are associated with ChangesetJobs/Changests that are associated with another campaign.

We had to add the second condition, (b), because if we keep closed/merged changesets around a Campaign can now contain changesets that originate from different PatchSets.

Merge request reports

Loading