Skip to content

Add AutoDeploy::CheckPackage class to check if commit being deployed is older than commit already on environment

Reuben Pereira requested to merge rp/check_package1 into master

What does this MR do?

AutoDeploy::CheckPackage can check if the commit being deployed is older than the commit already on the environment and raise an error when this happens.

The compare API returns commits: [] when the same commit is compared to itself, or when commits are compared in the wrong order. If the same commit is compared with itself, the API also returns compare_same_ref: true.

AutoDeploy::CheckPackage fetches the latest deployed commit using the deployments API, and compares it with the commit that is currently being deployed. It raises an error if the compare API returns commits: [], compare_same_ref: false, since this means that the latest deployed commit is newer than the one currently being deployed.

This MR also adds a rake task and a job that can be called by deployer.

gitlab-com/gl-infra/delivery#2265 (closed)

Author Check-list

  • Has documentation been updated?
Edited by Reuben Pereira

Merge request reports