Skip to content

Protected runner executes jobs on protected branch [Solution 1]

What does this MR do?

This MR is continued from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13192. To accomplish this feature, we need to implement a mechanism for "Protected runner executes jobs on protected branch. Unprotected runner executes jobs on unprotected branch". However, there is a technical challenge that ci_builds doesn't have data whether the ref is protected or not.

This MR addresses the challenge with Solution 1.

Solution 1. Persists protected(ref) flag on ci_pipelines table. builds_for_shared_runner and builds_for_specific_runner read the flag instead of executing protected_for? one by one.

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13192#note_36332863

Update Aug 21st

We expand ci_biulds instead of ci_pipelines. See https://gitlab.com/gitlab-org/gitlab-ce/issues/33281#note_37674757.

Compared with solution2

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

How should we mark the protected flag on ci_biulds? Do we leverage it by only protected-branch-or-not?

Why was this MR needed?

This is aimed for %10.0

Screenshots (if relevant)

Edit Screen_Shot_2017-08-21_at_4.33.51_PM Show Screen_Shot_2017-08-21_at_4.34.04_PM When there is a only protected runnners and a job was created on a unprotected branch Screen_Shot_2017-09-01_at_8.26.18_PM

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

/cc @ayufan @godfat

Edited by Shinya Maeda

Merge request reports