Skip to content

Make Ci::JobDefinition model insert only

What does this MR do and why?

Context

From issue description #519972 (closed):

With the idea of adding p_ci_job_definitions table we need to ensure that the model Ci::JobDefinition is insert-only and can never be updated once created. We have to protect the crucial invariant that the job definition is immutable because it will be shared across multiple jobs. Modifying it to suit a single job configuration will break other job configurations.

This MR

We set Ci::JobDefinition model so that readonly is true once the record is persisted.

References

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #519972 (closed)

Edited by Leaminn Ma

Merge request reports

Loading