Something went wrong while fetching comments. Please try again.
Created by: mrnugget
This is stacked on top of #13591 and is the next bit needed for #12827 (closed).
This implements the behavior described in this comment:
ApplyCampaign first loads the spec/campaign from the database and checks whether applying a new spec is possibleThe reason why we wait for the changesets to finish processing is that we have consistent data when we later in ApplyCampaign need to, for example, decide whether to close or simply delete a changeset. That depends on the external state of the changeset and we might make a wrong decision if we didn't finish for the changeset to finish processing.
@efritz I didn't see a way to make the "cancel all enqueued/retryable/processing changesets" query work with skip locked ... returning ID. If I were to call that in a loop, since I skip the locked ones I wouldn't know when I should exit the loop, since I don't cancel all changesets.