Add Ci::Partition 'archived' status and ArchiveService

What does this MR do and why?

Background

As we work on truncating archived partitions (related to #552078), we need a way to track which partitions contain only archived pipelines so that processing data (like p_ci_job_definitions) can be safely truncated to reclaim space.

This MR

Adds a new archived status (value: 4) to the Ci::Partition state machine in app/models/ci/partition.rb.

The status transition flow would be:

  • preparingreadycurrentactivearchived

Adds a new ArchiveService to Ci::PartitioningWorker that checks if all pipelines in a partition are archived (by checking the partition's current_until) and transitions the partition to archived status. See !232501 (comment 3276854075) for why we're not checking the partition's last pipeline instead.

This service is behind a feature flag ci_archive_old_partitions. Roll-out: #597863

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 #592772 (closed)

Edited by Leaminn Ma

Merge request reports

Loading