allow_failure builds generate TODO messages on failure

On GitLab.com 8.12.0-rc3-ee

Summary

Failed builds with allow_failure set to true still cause GitLab to generate todo's.

Steps to reproduce

  1. Create, commit, and push a job in .gitlab-ci.yml in that will fail but has allow_failure enabled. It is best to have the job take a while in order to allow the build to fail after the MR is created. (How one can reproduce the issue - this is very important).
  2. Before the builds complete (if an MR for the branch does not already exist), create an MR for the branch.

Example .gitlab-ci.yml:

image: busybox:latest
will-succeed:
  script:
    - /bin/true

will-fail:
  allow_failure: true
  script:
    - sleep 60
    - /bin/false

Expected behavior

No TODO is received when the will-fail build completes.

Actual behavior

When the will-failbuild completes, the user receives a TODO informing them of the failure.

Possible fixes

The TODO on build failure code was added in this commit: 6b834f2c. I believe the issue has to do with this line not checking the allow_failure status.