Skip to content

Add Rake task for automatically tagging RCs

Yorick Peterse requested to merge schedule-release-candidates into master

When run, this task will try to determine what MAJOR.MINOR version to tag an RC for, and invoke release:tag with the appropriate tag version if an RC is to be tagged.

For the RC identifier we generate one based on the current time, in the format YmdHMS. This results in a version such as "12.8.0-rc20200213161059.ee.0". This ensures that no two RCs will ever conflict, even when running this job manually many times on the same day.

If the release managers schedule or a release version can't be obtained, the Rake task will log an error and terminate. Since the requests to the schedule sometimes time out, we use the retriable Gem to retry the download operation a few times.

To ensure the stable branches used for RCs are always up to date, we make use of the refs created when a deployment is recorded in GitLab. Using these refs we can create a temporary branch, used as the source of the merge request that will update the stable branch. This ensures that we only merge changes into the stable branches if they have been deployed. These merge requests are approved and merged by gitlab-bot, as MR authors can't self-approve their merge requests.

See gitlab-com/gl-infra/delivery#638 (closed) for more information.

An example merge request produced by this code: gitlab!27227 (merged)

TODO

  • Make sure all tests pass
  • Add CI config to run this job, and make sure it only runs when the right ENV variable is set
  • Set up daily CI schedule for this job
  • Hide the task behind a feature flag
Edited by Yorick Peterse

Merge request reports