Project /runners API lies about active runners

Summary

The project runners API lies about the active runners for that project.

It's arguable that the Web UI is also incorrect (or at least very ambiguous).

Steps to reproduce

  1. Create a project
  2. Enable shared runners for the project and ensure that there is at least one shared runner.
  3. (Optional) Assign a group runner to the group in which the project lives, and ensure group runners are enabled for the project.
  4. Assign a specific runner to the project.
  5. GET /projects/:id/runners
  • Observe all three runners in the JSON
  1. Click the orange Disable shared runners button. It will change to green and read Enable shared runners.
  • This implies that shared runners are disabled. (UX: This is very confusing, and GitLab should use the toggle switch control which is much less ambiguous!)
  1. (Optional) Click the orange-outline Disable group runners button. It will change to green-outline and read Enable group runners.
  • Same note as above

What is the current bug behavior?

GET /projects/:id/runners

  • Observe all three runners are still in the JSON and marked "active": true

What is the expected correct behavior?

GET /projects/:id/runners

  • Observe the shared runners and group runners are missing

Results of GitLab environment info

Version: GitLab ce 11.3.4 (30f019d)