Skip to content

Add barebones for release calculator

Mayra Cabrera requested to merge add-calculator-logic into main

What does this MR do?

Add barebones for release dates calculator:

Introduces the following classes:

  • ReleaseVersion - Wrap up to handle valid GitLab versions
  • ReleaseVersions - Service to handle a series of ReleaseVersion instances.
  • VersionCalculator - Service to calculate the version based on the version and the previous date
  • DateCalculator - Service to calculate the release date based on the version and on a given date

Classes handle two scenarios:

  • Before 16.6, they return the 22nd as release date
  • After the 16.6, they calculate the third Thursday of the month.

Related to gitlab-com/gl-infra/delivery#19542 (closed)

Example:

[1] pry(ReleaseDates)> result
=> {"16.2"=>"2023-07-22",
 "16.3"=>"2023-08-22",
 "16.4"=>"2023-09-22",
 "16.5"=>"2023-10-22",
 "16.6"=>"2023-11-16",
 "16.7"=>"2023-12-21",
 "16.8"=>"2024-01-18",
 "16.9"=>"2024-02-15",
 "16.10"=>"2024-03-21",
 "16.11"=>"2024-04-18",
 "17.0"=>"2024-05-16",
 "17.1"=>"2024-06-20",
 "17.2"=>"2024-07-18"}¡
Edited by Mayra Cabrera

Merge request reports