Ensure that ci_runner_versions is populated when new cell is created
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
TL;DR: The ci_runner_versions table caches the upgrade recommendation for each of the known runner versions present in the ci_runner_machines table. If a cell is created, or an org is moved to a new cell, we should ensure that all versions that are new to that cell are processed and added to ci_runner_versions.
The following discussion from !155731 (merged) should be addressed:
-
@tkuah started a discussion: (+5 comments) Important note: Whenever we move an organization to a different cell, we should call
Ci::Runners::ProcessRunnerVersionUpdateWorkerwith the versions of the moved runners, so thatci_runner_versionsin the target cell is ensured to be populated with the necessary versions (I'll create aAssuming we move a
ci_runnersfor an organization to another cell. But we have not runCi::Runners::ProcessRunnerVersionUpdateWorker.- What happens to the application ? Does it break completely, can it recover gracefully ?
Proposals
-
If we have code that runs on cell creation, we could run the following code at that point:
Ci::RunnerManager.distinct.where.not(version: nil).pluck(:version).each do |version| Ci::Runners::ProcessRunnerVersionUpdateWorker.perform_async(version) end -
Otherwise, we could create a cronjob that runs daily for self-healing purposes, executing the code above.