Skip to content

Add validation to Ci::CommitStatus#ci_stage

Max Orefice requested to merge morefice/add-build-ci-stage-validation into master

Ref: #371196 (closed)

What does this MR do and why?

Following the our guidelines to add a NOT NULL constraint to an existing table.

This MR does 2 things:

  • Add validation to Ci::CommitStatus#ci_stage
  • Add NOT NULL constraint at the database level

It fixes invalid records in production where build#stage_id is nil.

We currently have 4 records to fix for gitlab.com

We verified that we all existing records have an attached stage_id 👇

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 Max Orefice

Merge request reports