Skip to content

Refactor deploy validator class to be usable for both monthly and patch releases

Mawreen Dela Cruz requested to merge madelacruz/verify-release-deployment into master

What does this MR do and why?

Describe in detail what your merge request does and why.

The ReleaseDeployValidator was introduced to verify the deployment to the release.gitlab.net of the latest patch release version. This MR refactors the class so that it can also be used for the monthly release.

Related issue: gitlab-com/gl-infra/delivery#20449 (closed)

Content

  • Refactor DeployValidator to handle both monthly and patch

Testing

  • Success:
[7] pry(main)> validator = ReleaseTools::Tasks::ReleaseGitlabNet::DeployValidator.new("17.4.0")
=> #<ReleaseTools::Tasks::ReleaseGitlabNet::DeployValidator:0x0000000126d311d0 @ee_version="17.4.0-ee", @version="17.4.0">
[8] pry(main)> validator.execute
KeyError: key not found: "CI_JOB_URL"
from /Users/mawreendelacruz/SRE/Tickets/release-tools/lib/release_tools/slack/release_job_end_notifier.rb:43:in `fetch'
2024-09-24 12:37:12.309473 D ReleaseTools::GitlabReleaseClient -- [HTTParty] [2024-09-24 12:37:12 +0800] 200 "GET https://release.gitlab.net/api/v4/version" - 
2024-09-24 12:37:12.309718 I ReleaseTools::Tasks::ReleaseGitlabNet::DeployValidator -- Release.gitlab.net is running the expected monthly version -- {:version=>"17.4.0-ee"}
2024-09-24 12:37:12.309754 I ReleaseTools::Slack::ReleaseJobEndNotifier -- Posting slack message -- {:job_type=>"Validate release.gitlab.net running 17.4.0-ee", :status=>:success}
  • Failure:
[9] pry(main)> validator = ReleaseTools::Tasks::ReleaseGitlabNet::DeployValidator.new("17.3.3")
=> #<ReleaseTools::Tasks::ReleaseGitlabNet::DeployValidator:0x00000001259b9030 @ee_version="17.3.3-ee", @version="17.3.3">
[10] pry(main)> validator.execute
2024-09-24 12:37:28.074054 D ReleaseTools::GitlabReleaseClient -- [HTTParty] [2024-09-24 12:37:28 +0800] 200 "GET https://release.gitlab.net/api/v4/version" - 
2024-09-24 12:37:28.074466 W ReleaseTools::Tasks::ReleaseGitlabNet::DeployValidator -- Release.gitlab.net is not running the expected patch version. Retrying -- {:expected=>"17.3.3-ee", :actual=>"17.4.0-ee"}

Author Check-list

  • Has documentation been updated?
Edited by Mawreen Dela Cruz

Merge request reports

Loading