Skip to content

Fix MR widget with external CI services/integrations

What does this MR do?

EE MR, https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2922

  • Fix MR widget throwing errors with external CI services/integrations
  • Fix up some logic where it would allow merge when "Only allow merge requests to be merged if the pipeline succeeds" was set

External integration/service

Pipeline Status Only allow merge requests to be merged if the pipeline succeeds Before After
'failed' true
'canceled' true
'running' true
'pending' true
'success' true
'success_with_warnings' true
'skipped' true
'not_found' true
--- --- ---
'failed' false
'canceled' false
'running' false
'pending' false
'success' false
'success_with_warnings' false
'skipped' false
'not_found' false

GitLab CI pipeline

Should be no change...

Pipeline Status Only allow merge requests to be merged if the pipeline succeeds Before After
'running' true
'failed' true
'success' true
'skipped' true
'running' false
'failed' false
'success' false
'skipped' false

Are there points in the code the reviewer needs to double check?

  • Link to external builds, https://gitlab.com/gitlab-org/gitlab-ce/issues/37305
  • Added "The pipeline for this merge request has not succeeded yet." state for running, pending, etc otherwise it would say "The pipeline for this merge request failed. Please retry the job or push a new commit to fix the failure"

Use the MockCI service/integration

Checkout the MockCI service for easy testing of states.

Get the TeamCity service/integration running

  1. Download TeamCity
  2. Run it, /Users/eric/Downloads/TeamCity/bin/runAll.sh start
  3. Visit and follow guided steps, http://localhost:8111
  4. Create a TeamCity admin account, http://localhost:8111/setupAdmin.html
  5. Create a project/repo on your local GDK. I just copied over the gitter-ios-app xcode project
  6. Follow the steps here using the repo you just created, https://confluence.jetbrains.com/display/TCD9/Configure+and+Run+Your+First+Build
  7. Add the TeamCity integration to your GitLab project, Settings -> Integrations -> JetBrains TeamCity CI (make sure to check the "Active" checkbox)
    Teamcity url: http://localhost:8111/
    Build type: TeamCityIntegrationTest_SomeBuildConfig (you can grab this from the "General Settings" of the TeamCity project)
    Username/Password: Use the TeamCity admin account you created above
  8. When you are done, you can stop it with /Users/eric/Downloads/TeamCity/bin/runAll.sh stop

Why was this MR needed?

  • MR widget is broken with external services/integrations.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #33287 (closed)

Edited by Eric Eastwood

Merge request reports