Skip to content

Add job to move security blog post to canonical

Steve Abrams requested to merge delivery19732-move-blog-post-job into master

What does this MR do and why?

We are automating the security release blog post. This MR introduces a new stage to the security release pipeline security_release:publish that will be used for all jobs on the publish day of the release. This MR adds the standard start job that will kick off the stage and a job to move the security release blog post MR from the security repo to the canonical repo.

The MR URL is printed in the 2nd to last line in the job log. Not the greatest, but everyone who was assigned to the security MR will be assigned to the new MR, so release managers should be able to easily find it. As a followup we could add a slack notification with the new MR url, but that shouldn't be necessary since the idea is to auto-merge it and not even need release managers to do anything.

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

Testing

To test this, I pushed a modified branch to the ops instance that would only notify test slack channels and ran the pipeline with SECURITY_RELEASE_PIPELINE=publish so only the new stage would be included.

This test MR was used: https://gitlab.com/gitlab-org/security/www-gitlab-com/-/merge_requests/155

git diff
diff --git a/lib/release_tools/slack/release_job_end_notifier.rb b/lib/release_tools/slack/release_job_end_notifier.rb
index 6adcf2f5..753bea69 100644
--- a/lib/release_tools/slack/release_job_end_notifier.rb
+++ b/lib/release_tools/slack/release_job_end_notifier.rb
@@ -20,7 +20,7 @@ module ReleaseTools
        logger.info('Posting slack message', job_type: job_type, status: status)

        ReleaseTools::Slack::Message.post(
          channel: ReleaseTools::Slack::F_UPCOMING_RELEASE,ReleaseTools::Slack::NOTIFICATION_TESTS,
          message: fallback_message,
          blocks: slack_blocks
        )
diff --git a/lib/release_tools/slack/release_pipeline_start_notifier.rb b/lib/release_tools/slack/release_pipeline_start_notifier.rb
index ace34e1a..d62634d1 100644
--- a/lib/release_tools/slack/release_pipeline_start_notifier.rb
+++ b/lib/release_tools/slack/release_pipeline_start_notifier.rb
@@ -18,7 +18,7 @@ module ReleaseTools
        logger.info("Notifying the stage of a #{release_type} pipeline", stage: stage, release_manager: user_name, pipeline_url: pipeline_url)

        ReleaseTools::Slack::Message.post(
          channel: ReleaseTools::Slack::F_UPCOMING_RELEASE,ReleaseTools::Slack::NOTIFICATION_TESTS,
          message: slack_message,
          blocks: slack_blocks
        )
Description Reference
Pending pipeline Screenshot_2023-10-20_at_3.16.19_PM
Successful pipeline https://ops.gitlab.net/gitlab-org/release/tools/-/pipelines/2434295
Successful move job https://ops.gitlab.net/gitlab-org/release/tools/-/jobs/11594456
Successful slack notification Screenshot_2023-10-20_at_8.39.01_PM
Successfully moved MR gitlab-com/www-gitlab-com!130600 (closed)
Failed pipeline https://ops.gitlab.net/gitlab-org/release/tools/-/pipelines/2433647
Failed move job (see output in job that the test blog MR was not found) https://ops.gitlab.net/gitlab-org/release/tools/-/jobs/11592607
Failed slack notification Screenshot_2023-10-20_at_3.19.35_PM

Author Check-list

  • [-] Has documentation been updated?
Edited by Steve Abrams

Merge request reports