Draft: POC Deduplicate intrinsic immutable data to Ci::JobInfo

What does this MR do and why?

This is a POC for moving immutable, intrinsic data into a new model Ci::JobInfo. Details:

  1. The Ci::JobInfo model mirrors Ci::JobDefinition. The difference is that there is no separate association table (like ci_job_definition_instances). Instead, ci_builds has a direct belongs_to relationship to ci_job_infos.

  2. Attempts to move the following columns from ci_builds into ci_job_infos:

  • allow_failure --> Cannot move. This field is mutated when job transitions to failed.
  • when --> Cannot move. This field is mutated in Ci::ProcessBuildService.
  • scheduling_type
  • stage_idx --> Indexed column; need to further evaluate query performance impact
  • name --> Indexed column; need to further evaluate query performance impact
  1. Attempts to move ci_build_names data into ci_job_infos.name column, which is set up with a search_vector column.

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 #577211

Edited by Leaminn Ma

Merge request reports

Loading