Skip to content

GitLab Next

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Menu
    Projects Groups Snippets
  • Get a free trial
  • Sign up
  • Login
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

GitLab 15.0 is launching on May 22! This version brings many exciting improvements, but also removes deprecated features and introduces breaking changes that may impact your workflow. To see what is being deprecated and removed, please visit Breaking changes in 15.0 and Deprecations.

  • GitLab.org
  • GitLab FOSSGitLab FOSS
  • Merge requests
  • !13194
Project 'gitlab-org/gitlab-ce' was moved to 'gitlab-org/gitlab-foss'. Please update any links and bookmarks that may still have the old path.
Merged
Created Jul 31, 2017 by Shinya Maeda@shinya.maeda🌴Maintainer10 of 10 tasks completed10/10 tasks
  • Review changes

  • Download
  • Email patches
  • Plain diff

Protected runner executes jobs on protected branch [Solution 1]

  • Overview 142
  • Commits 32
  • Pipelines 24
  • Changes 38

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

  • Pro

  • Fast

  • Scalable

  • Con

  • If user changes the ref protection, do we need to update the corresponded data on ci_pipelines? https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13192#note_36334215

  • Alter column on ci_pipelines

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?

  • Changelog entry added, if necessary
  • Documentation created/updated
  • API support added
  • Tests
    • Added for this feature/bug
    • All builds are passing
  • Review
    • [-] Has been reviewed by UX
    • [-] Has been reviewed by Frontend
    • Has been reviewed by Backend
    • [-] Has been reviewed by Database
  • Conform by the merge request performance guides
  • Conform by the style guides
  • Branch has no merge conflicts with master (if it does - rebase it please)
  • Squashed related commits together

What are the relevant issue numbers?

  • https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13192
  • Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/33281
  • Solution 2 => https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13216

/cc @ayufan @godfat

Edited Sep 03, 2017 by Shinya Maeda
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: feature/sm/33281-protected-runner-executes-jobs-on-protected-branch