Skip to content

a8n: Count CampaignJobs as completed even if they didn't produce diff

Warren Gifford requested to merge a8n/fix-campaign-plan-status into master

Created by: mrnugget

This is a fix for the issue discussed in #7064 (closed) where a CampaignPlan launches N CampaignJobs but only X produce a diff or an error. The result was that the state of the CampaignPlan BackgroundProcessStatus was COMPLETED instead of the desired ERRORED.

This change here fixes that behavior by essentially reverting what I previously introduced in d270de30a173c47ecb3b9bcea3caa16ba3dfb8e1 with the motivation of keeping the invariant of campaignPlan.changesets.totalCount == campaignPlan.status.completed.

The problem is that we often launch way more CampaignJobs than we actually produce diffs. These jobs do complete, just without a diff.

As discussed in #7064 (closed) we're fine with reporting them as completed.

Merge request reports

Loading