Checking pipeline status widget should be invisible if pipeline isn't designed to run for merge requests

Summary

Merge request pipelines need jobs to be configured to run on merge requests. This is explained in the Prerequisites section of the Merge Request Pipelines page. However when we configure CI/CD to NOT run for merge requests, Checking pipeline status keeps spinning even though the Pipelines must succeed merge check is not enabled (This setting is in the project's Settings > General. Expand Merge Requests* and you will see the checkbox in Merge checks). This spinning widget is very confusing while it does not affect the user's ability to merge the merge request.

Steps to reproduce

1. Go to Settings > General. Expand Merge Requests*. Disable Pipelines must succeed in the Merge checks. 2. In .gitlab-ci.yml, add workflow.rules to not run on merge requests:

workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      when: never
    - if: $CI_COMMIT_TAG
    - if: '$CI_COMMIT_BRANCH != "main" || $CI_COMMIT_BRANCH != "master"'
      when: never

3. Commit changes and create a merge request. 4. Checking pipeline status will keep spinning.

.gitlab-ci.yml
workflow:
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
      when: never
    - if: $CI_COMMIT_TAG
    - if: '$CI_COMMIT_BRANCH != "main" || $CI_COMMIT_BRANCH != "master"'
      when: never
    - if: $CI_COMMIT_BRANCH


variables:
  CI_COMMIT_TAG_IF_EMPTY: '(if [[ "${CI_COMMIT_TAG}" == "" ]]; then echo $CI_COMMIT_SHORT_SHA; else echo $CI_COMMIT_TAG; fi);'
  CS_ANALYZER_IMAGE: registry.gitlab.com/security-products/container-scanning:4

cache:
  key: $CI_COMMIT_REF_SLUG
  paths:
    - image.tar

stages:
  - build
  - container_scan

build container:
  stage: build
  script:
    - echo "$CI_JOB_NAME"
    - echo "$CI_COMMIT_BRANCH"
  rules:
    - if: '$CI_COMMIT_BRANCH != "master"'
  allow_failure: false
  when: on_success
  
container_scan:
  stage: container_scan
  script:
    - echo "$CI_JOB_NAME"
    - echo "$CI_COMMIT_BRANCH"
  needs:
    - job: build container
      artifacts: false

Actual behavior

Although I don't want any pipelines for merge requests, Checking pipeline status widget keeps spinning.

Expected behavior

Checking pipeline status widget should not be displayed.

Relevant logs and/or screenshots

checking-pipeline-status_ready-to-merge2022-08-17

job log
Add the job log

Environment description

config.toml contents
Add your configuration here

Used GitLab Runner version

Possible fixes

In the project's Settings > General expand Merge Requests* and you will see the checkbox Pipelines must succeed in Merge checks. Uncheck this option so that it doesn't prevent the MR from being merged.