Skip to content

Add a service to deploy the blog post

Mayra Cabrera requested to merge add-service-to-deploy-blog-post into master

What does this MR do and why?

The DeployBlogPost class was added to publish the security release blog post. This class:

  • Fetches the blog post opened in the canonical repository. The blog post will be previously moved from security handbook to the canonical handbook repository via security release pipeline.
  • Assigns the current release managers
  • Approves the merge request
  • Adds the merge request to the merge-train.

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

Testing

Prework

A test merge request was created gitlab-com/www-gitlab-com!130577 (closed), this one was authored by the gitlab-release-tools-bot.

Executing the DeployBlogPost service via command line

[1] pry(main)> service = ReleaseTools::Security::Publish::DeployBlogPost.new
2023-10-23 11:15:13.794591 I ReleaseTools::Security::Publish::BlogPostFinder -- Searching for the blog post on the GitLab handbook repository
2023-10-23 11:15:14.200651 D ReleaseTools::GitlabClient -- [HTTParty] [2023-10-23 11:15:14 -0600] 200 "GET https://gitlab.com/api/v4/projects/gitlab-com%2Fwww-gitlab-com/merge_requests" -
2023-10-23 11:15:14.201228 I ReleaseTools::Security::Publish::BlogPostFinder -- Security release blog post found -- {:web_url=>"https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_requests/130577"}
2023-10-23 11:15:25.062956 I ReleaseTools::Security::Publish::DeployBlogPost -- Assigning the blog post to the active release managers
2023-10-23 11:15:25.062993 I ReleaseTools::Security::Publish::DeployBlogPost -- Approving the blog post -- {:blog_post=>"https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_requests/130577"}
2023-10-23 11:15:25.360961 D ReleaseTools::GitlabClient -- [HTTParty] [2023-10-23 11:15:25 -0600] 200 "GET https://gitlab.com/api/v4/projects/gitlab-com%2Fwww-gitlab-com/merge_requests" -
2023-10-23 11:15:25.724345 D ReleaseTools::GitlabClient -- [HTTParty] [2023-10-23 11:15:25 -0600] 201 "POST https://gitlab.com/api/v4/projects/gitlab-com%2Fwww-gitlab-com/merge_requests/130577/approve" 4513
2023-10-23 11:15:25.724800 I ReleaseTools::Security::Publish::DeployBlogPost -- Adding blog post to the merge train -- {:blog_post=>"https://gitlab.com/gitlab-com/www-gitlab-com/-/merge_requests/130577"}
2023-10-23 11:15:26.410304 D ReleaseTools::GitlabClient -- [HTTParty] [2023-10-23 11:15:26 -0600] 201 "POST https://gitlab.com/api/v4/projects/7764/merge_trains/merge_requests/130577" 31253

The service:

  • Found the blog post
  • Assigned it to release managers
  • Approved it
  • Added the blog post to the merge train
Approval and merge train actions
Screenshot_2023-10-23_at_11.59.12

Author Check-list

  • [-] Has documentation been updated?
Edited by Mayra Cabrera

Merge request reports