Skip to content

Notify security issue assignees when stable branch is created

Reuben Pereira requested to merge rp/notify-stable-branch-creation into master

What does this MR do and why?

Describe in detail what your merge request does and why.

Content

When the monthly stable branch is created, developers working on a security issue need to create a backport targeting the new stable branch, so that the security fix can be backported to the stable branch.

This MR introduces a new class that posts a notification to all notifiable security issues about the creation of the latest stable branch.

The new class will be used in !2672 (merged).

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

Testing

I tested by applying the following diff to my local release-tools repository, and then running the following command in a console: ReleaseTools::Security::NotifyStableBranchCreation.new(ReleaseTools::Security::IssueCrawler.new, ReleaseTools::Project::GitlabEe, '16-3-stable-ee').execute.

The resulting notification posted to the issue can be seen at https://gitlab.com/gitlab-org/security/gitlab/-/issues/971#note_1589701065.

Screenshot_from_2023-10-04_19-00-45

diff --git a/lib/release_tools/security/issue_crawler.rb b/lib/release_tools/security/issue_crawler.rb
index 6c189910..3f5fdba8 100644
--- a/lib/release_tools/security/issue_crawler.rb
+++ b/lib/release_tools/security/issue_crawler.rb
@@ -113,11 +113,15 @@ module ReleaseTools
       end
 
       def notifiable_security_issues_for(project)
-        found_issues = GitlabClient.issues(
-          project.security_path,
-          labels: [SECURITY_NOTIFICATIONS_LABEL],
-          state: OPENED
-        )
+        found_issues = [
+          ReleaseTools::GitlabClient.issue('gitlab-org/security/gitlab', 970),
+          ReleaseTools::GitlabClient.issue('gitlab-org/security/gitlab', 971)
+        ]
+        # found_issues = GitlabClient.issues(
+        #   project.security_path,
+        #   labels: [SECURITY_NOTIFICATIONS_LABEL],
+        #   state: OPENED
+        # )
 
         security_issues_and_merge_requests_for(found_issues)
       end

Author Check-list

  • Has documentation been updated?
Edited by Reuben Pereira

Merge request reports