Merge ~alexmurray/ubuntu-qa-tools:jammy-soft-freeze-check into ubuntu-qa-tools:master

Proposed by Alex Murray
Status: Merged
Approved by: Ray Veldkamp
Approved revision: 0c2430a9bba83e31667da888c86d5e706fd4f881
Merged at revision: 4ec6109cdb45dd0582f8305d7f5f8fa2fd84836e
Proposed branch: ~alexmurray/ubuntu-qa-tools:jammy-soft-freeze-check
Merge into: ubuntu-qa-tools:master
Diff against target: 49 lines (+23/-1)
1 file modified
security-tools/unembargo (+23/-1)
Reviewer Review Type Date Requested Status
Ubuntu Bug Control Pending
Review via email: mp+427589@code.launchpad.net

Description of the change

Try and make sure we don't inadvertently publish to jammy whilst it is in soft-freeze for 22.04.1

To post a comment you must log in.
Revision history for this message
Ray Veldkamp (rayveldkamp) wrote :

lgtm!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/security-tools/unembargo b/security-tools/unembargo
2index ad94ce9..7b5a5a4 100755
3--- a/security-tools/unembargo
4+++ b/security-tools/unembargo
5@@ -18,6 +18,7 @@
6 # ./unembargo --esm $PKG
7
8 from __future__ import print_function
9+import datetime
10 import sys
11 import time
12 import argparse
13@@ -80,6 +81,8 @@ parser.add_argument("--source-pocket", help="The pocket to restrict the copy "
14 metavar="SOURCE_POCKET", action='store', default=None)
15 parser.add_argument("--include-devel", help="Include development release",
16 action='store_true', default=False)
17+parser.add_argument("-f", "--force", help="Force unembargo even if the release is in freeze.",
18+ action='store_true', default=False)
19
20 (opt, args) = parser.parse_known_args()
21 if len(args) < 1:
22@@ -156,7 +159,26 @@ for pkg_name in args:
23 if len(seen[series_name]) > 1:
24 seen[series_name] = sorted(seen[series_name], cmp=lambda x, y: apt_pkg.version_compare(
25 x.source_package_version, y.source_package_version), reverse=True)
26- unembargo.append(seen[series_name][0])
27+ # lookup series milestones and warn if any are approaching
28+ series = ubuntu.getSeries(name_or_version=series_name)
29+ now = datetime.datetime.now()
30+ frozen = False
31+ for milestone in series.all_milestones:
32+ if milestone.date_targeted is None:
33+ continue
34+ if now < milestone.date_targeted and milestone.date_targeted < now + datetime.timedelta(days=7):
35+ print("WARNING: %s is approaching milestone %s (due %s)" %
36+ (series_name, milestone.name,
37+ time.strftime("%Y-%m-%d", milestone.date_targeted.timetuple())))
38+ print("NOTE: Please coordinate with the #ubuntu-release team before releasing.")
39+ if not opt.force:
40+ print("NOTE: To override this check and publish anyway please use the --force flag.")
41+ print("NOTE: unembargo for %s will be skipped." % (series_name))
42+ frozen = True
43+ else:
44+ print("NOTE: unembargo for %s will continue due to use of --force." % (series_name))
45+ if not frozen:
46+ unembargo.append(seen[series_name][0])
47
48 # Publish
49 for source_item in unembargo:

Subscribers

People subscribed via source and target branches