Skip to content

Automatically set a due date for patch releases.

What does this MR do and why?

  • Automatically set a due date for patch releases.

As part of transforming patch releases to be SLO-driven. A method was introduced on the gitlab-releases gem to calculate the next patch release date (details on gitlab-com/gl-infra/delivery#19977 (closed)). This commit updates the following logic to use the automated date:

  • Security tracking issues are automatically created using the calculated due date.
  • Due date on the security tasks issue is set based on the tracking issue
  • One checkbox was removed from the security template.

Changes are under a feature flag.

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

Test

The code was modified to enforce the feature flag and to prevent assigning current release managers

Diff:

Click to expand
diff --git a/lib/release_tools/patch_release/issue.rb b/lib/release_tools/patch_release/issue.rb
index 98f0658c..eba3c089 100644
--- a/lib/release_tools/patch_release/issue.rb
+++ b/lib/release_tools/patch_release/issue.rb
@@ -32,7 +32,8 @@ module ReleaseTools
       end

       def assignees
-        ReleaseManagers::Schedule.new.active_release_managers.collect(&:id)
+       # ReleaseManagers::Schedule.new.active_release_managers.collect(&:id)
+        nil
       rescue ReleaseManagers::Schedule::VersionNotFoundError
         nil
       end
diff --git a/lib/release_tools/patch_release/security_issue.rb b/lib/release_tools/patch_release/security_issue.rb
index 601fa8d6..80b8ac92 100644
--- a/lib/release_tools/patch_release/security_issue.rb
+++ b/lib/release_tools/patch_release/security_issue.rb
@@ -33,6 +33,14 @@ module ReleaseTools
         ReleaseTools::SharedStatus.critical_security_release?
       end

+      def exists?
+        false
+      end
+
+      def create?
+        true
+      end
+
       def regular?
         !critical?
       end
@@ -64,6 +72,8 @@ module ReleaseTools

       def new_patch_release_process?
         Feature.enabled?(:new_patch_release_process)
+
+        true
       end

       def due_date
diff --git a/lib/release_tools/security/tracking_issue.rb b/lib/release_tools/security/tracking_issue.rb
index 7a141348..b9f31338 100644
--- a/lib/release_tools/security/tracking_issue.rb
+++ b/lib/release_tools/security/tracking_issue.rb
@@ -40,17 +40,25 @@ module ReleaseTools
       end

       def due_date
-        return unless Feature.enabled?(:new_patch_release_process)
+       # return unless Feature.enabled?(:new_patch_release_process)

         gitlab_releases_client.next_patch_release_date
       end

       def assignees
-        release_managers.collect(&:id)
+       # release_managers.collect(&:id)
       rescue ReleaseManagers::Schedule::VersionNotFoundError
         nil
       end

+      def exists?
+        false
+      end
+
+      def create?
+        true
+      end
+ 
Item Description Link / Screenshot
Security tracking issue Fake security tracking issue created using the date calculated by the releases gem https://gitlab.com/gitlab-org/gitlab/-/issues/451034
Security task issue Fake security release task issue created using the date from the security tracking issue https://gitlab.com/gitlab-org/release/tasks/-/issues/9212
Security template The first steps of the security task issue did not include the steps to set the date Screenshot_2024-03-20_at_10.18.45

Author Check-list

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

Merge request reports