Skip to content

Persist runner feature cancelable into runner_features attribute of Ci::Metadata

John Cai requested to merge jc-validate-runner-features into master

What does this MR do and why?

In order to protect against abuse of this column by api callers, we will expose certain methods to save specific fields that come from Gitlab Runner that indicate features that it supports. This MR adds methods to set/get the cancelable feature.

fixes: #341141

How to set up and validate locally

Example below:

  1. Select any build object
    b = Ci::Builds.find(<id>)
  2. See if cancelable is supported
    b.runner_features_cancelable?
  3. Try setting the feature
    b.set_runner_features_cancelable
    b.save!
    Ci::Builds.find(<id>).runner_features_cancelable?
  4. Observe it is saved correctly

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by John Cai

Merge request reports

Loading