Do not expire the PreviousChangesetSpec of a changeset
Created by: mrnugget
We expire CampaignSpecs
and ChangesetSpecs
in repo-updater
:
When do we expire?
-
CampaignSpecs
are expired when they're not attached to aCampaign
anymore. -
ChangesetSpecs
are expired when they're not attached to aCampaignSpec
.
But since we extended ApplyCampaign
we now have a CurrentSpecID
and a PreviousSpecID
on Changesets
and set those:
That means ApplyCampaign
can leave us in a state where a Changeset
has a PreviousSpecID
that points to a ChangesetSpec
that is attached to a CampaignSpec
that's not attached to a campaign.
What we need to do:
- Continue to expire
campaignSpec
that are not attached tocampaigns
anymore. - But don't clean up the
ChangesetSpecs
if they're attached to aChangeset
, either as aCurrentSpecID
or aPreviousSpecID
.
For that we need to find out whether the deletion of a campaign_spec
also deletes the associated changeset_specs
. if that's the case, we need to stop.
And then, in DeleteExpiredChangesetSpecs
, we need to not delete ChangesetSpecs
that are attached to a changeset
.