Skip to content

Adding in Perma-Failing Job.

Cauhx Milloy requested to merge addingJobThatFails into master

Adding in CI Job that always fails.

The issue is that the 2 pipelines are started, but only the most recent is acknowledged. The pipelines are:

  1. Jobs that run within the branch (not in the Merge Request). Link
  2. Jobs that run only within the Merge Request. Link

The Merge Request pipeline (2) is the pipeline used for determining this Merge Request's state.

Despite the fact that, in this Merge Request, the code being added will always fail, that failing code is not checked in merge_request-only jobs. Thus, the Merge Request looks ok and is able to be merged. One must manually switch over to the Pipelines tab to have a chance to see that this Merge Request is broken.

The Merge Request seems to only infer its state from the last ran pipeline for the given SHA (ignoring other blocking states like WIP, approvers, etc). This is seems more true when looking at the REST api call for this Merge Request. Calling curl https://gitlab.com/api/v4/projects/cauhxmilloy%2Fpipelines-ignored-in-mr/merge_requests/1 shows

{
  "id": 35462335,
  "iid": 1,
  "project_id": 13908837,
  "title": "Adding in Perma-Failing Job.",
  ...
  "pipeline": {
    "id": 77435423,
    "sha": "9524841d2f333c50775915815dd9e740dca172b6",
    "ref": "refs/merge-requests/1/head",
    "status": "success",
    "web_url": "https://gitlab.com/CauhxMilloy/pipelines-ignored-in-mr/pipelines/77435423"
  },
  "head_pipeline": {
    "id": 77435423,
    "sha": "9524841d2f333c50775915815dd9e740dca172b6",
    "ref": "refs/merge-requests/1/head",
    "status": "success",
    "web_url": "https://gitlab.com/CauhxMilloy/pipelines-ignored-in-mr/pipelines/77435423",
    "before_sha": "0000000000000000000000000000000000000000",
    ...
    }
  },
  ...
  "merge_error": null,
  "user": {
    "can_merge": true
  },
  "approvals_before_merge": null

No mention of the failing pipeline is made at all. The other pipeline(s) are ignored just the same if they are running or canceled instead of failed.

Edited by Cauhx Milloy

Merge request reports