Build of a multi-build (e.g. tagged) commit is considered 'failed' if there are no build jobs defined for one of the builds
As the title is probably not clear enough, I'll bring an example (gitlab 8.8.1):
- consider you've defined build stages, all of which are marked as "only: branches"
- Push a new commit which builds fine
- Check the "Commits" page of the project, and see that the last commit is marked green (built successfully)
- Tag the commit and push again. Since no build job is defined for tags, no new builds will happen
- Check the "Commits" page again. The commit is now marked with a red cross (Commit: failed). If you click on the cross, a page opens which shows all builds for the commit. On top, it says: "Builds for 2 pipelines failed in .. minute .. seconds ". There are no other errors. And there is a line saying something like "Pipeline #654 (closed) with 0 builds for test_tag".
But in step 5, you should still see that the commit has been built successfully. This will also cause the branch's build status to become red (build status badge will say that it has failed too).
Note: It also fails the other way around: if we only build on tags (but not on branches), tagged commits still is marked as failed. Also, if we build on tags, build badge of branches doesn't show their build status even if the HEAD of the branch is tagged & built successfully.