campaigns: Fix publishing campaigns w/ failed jobs
Created by: LawnGnome
I took a slightly different technical approach to the one @eseliger suggested in #10797: instead of adding a flag to omit failed jobs, I've instead extended ListPatchesOpts
with a field called OnlyNotInCampaign
that is essentially a peer to the existing OnlyUnpublishedInCampaign
: it returns patches that have no corresponding changeset_jobs
record in that campaign, regardless of state.
Otherwise, this implements the behaviour suggested in #10797: namely, that publishing a campaign with one or more failed jobs should not result in the jobs being retried. Since #10795 will soon be fixed, users can do that themselves after publishing the campaign via the UI.
Fixes #10797.