External commit status behave inconsistently
What we know now
- Pipelines feature must be enabled to avoid 404's in various build links, and to view external build results.
- Even with pipelines enabled, there are problems:
- The second build on the same commit doesn't change the status of the MR
- A third build on a new commit on the same MR, creates a new pipeline with an incorrect status, both for the pipeline and the MR.
- The order of the external builds is not as one would expect (should be latest first).
- No time-stamps next to the external build links (this would make 2. less relevant).
Steps to reproduce:
- Create merge request
- API-Post pending/running/failed
- MR page status is failed, clicking on the pipeline number shows the pipeline page, clicking the External button takes you to Jenkins.
So far, so good!
- API-post :"pending". The MR status is "running", which isn't quite correct.
- API-post "running". The MR status remains "running"
- API-post "success". The MR status becomes "failed", which clearly is not correct. Clicking on the "pipeline" numbers leads to the pipeline page, showing two external build buttons. The top one is the oldest (one would expect the latest one at the top). The second build is now visible, but at the button.
- Push a new commit to the same MR
- API-Post pending/running/success to the latest commit#. A new pipeline is created, however the status of this new pipeline is "failed" and so is the MR status. This is clearly very incorrect!
Original summary
Summary
Our Jenkins build jobs use the GitLab API call "statuses" to post the build result to the commit of a Merge Request. This causes pipeline artifacts to appear in the Merge Request. Despite the fact that we disabled CI build support for the project.
Steps to reproduce
- Disable build support in the project's properties.
- Create an MR
- Use the API to post the build result: https://gitlab.comp.com/api/v3/projects/PROJECT_ID/statuses/COMMIT_HASH?target_url=JENKINS_JOB_URL&name=JENKINS_BUILD_NUMBER&ref=BRANCH_NAME&state=success
- Check the MR page
- Repeat posting build results
Expected behavior
- The MR status box contains the latest build status and a link to the Jenkins build
- One or more entries in the Builds tab, each containing a status and a link to Jenkins
- No Pipelines tab
Actual behavior
- The MR status box contains a reference to a pipeline that doesn't exist (incorrect) and a status (correct)
- The Pipelines tab is filled with fantasy numbers and links leading to 404 pages (incorrect)
- The Builds tab contains one line with a status and a link to the Jenkins job (correct)
- Only the last build result is visible in the Builds tab (incorrect)
- The older builds are not reachable at all (incorrect)
Relevant logs and/or screenshots
The attachments show the Pipelines and Builds tabs after 4 builds:
1 : The Pipelines tab
2 : The Builds tab
Output of checks
None.
Results of GitLab application Check
None.
Results of GitLab environment info
None.