Skip to content

WIP: Avoid duplicate bridge status update

Fabio Pitino requested to merge avoid-duplicate-bridge-status-update into master

What does this MR do?

Related to #207234 (closed) (post-regression issue)

Related to #198354 (closed) (original issue)

Related to #202239 (closed) (related issue)

Scenario: Let's consider a pipeline that is triggered by a bridge job. The same pipeline can have downstream pipelines subscribed to it (new feature) so they get triggered any time the pipeline completes. When the pipeline completes we run Ci::PipelineBridgeStatusService (on EE::Ci::Pipeline). The PipelineBridgeStatusService does not have a guard clause to only run if the bridge is dependent (like using strategy:depend in the CI yaml) and can cause status updates on the upstream bridge even if the bridge does not dependent.

Fix: Add guard clause to PipelineBridgeStatusService to avoid it updating bridge status regardless.

Goal

The goal is to avoid the following errors from being reported: https://sentry.gitlab.net/gitlab/gitlabcom/?query=transaction%3A%22Sidekiq%2FCi%3A%3ACreateCrossProjectPipelineWorker%22&statsPeriod=14d

In the Sentry report we the fact that PipelineBridgeStatusService runs anyway updates the bridge status to failed. Then the CreateCrossProjectPipelineService also tries to fail the bridge but it's already failed.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Fabio Pitino

Merge request reports