Which pipelines are considered when we use "Pipeline must succeed" in merge checks?

We just introduced code quality using code climate for our repository. We used pipeline for merge request for the same. We also use pipeline must succeed from the merge checks

If we use merge when pipeline succeeds feature, Gitlab only considers the new detached code quality pipeline. It ignores the output of other build pipelines even when pipelines must succeed is marked.

Is there a way to lower the precedence of detached code quality pipeline or some config to allow merge only if all the pipelines (code quality and build pipelines) succeed?