Merge ubuntu-archive-tools:frozen-for-release into ubuntu-archive-tools:main

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 9e5028255183905c5427ba4e9d3847f4733c6ca1
Proposed branch: ubuntu-archive-tools:frozen-for-release
Merge into: ubuntu-archive-tools:main
Diff against target: 58 lines (+26/-0)
1 file modified
sru-release (+26/-0)
Reviewer Review Type Date Requested Status
Chris Halse Rogers Needs Fixing
Review via email: mp+448823@code.launchpad.net

Commit message

Add means to define a stable series to be frozen and let sru-release disallow releasing packages for that series.

Description of the change

This is just a proposal. I thought about putting this into hints as this is basically how we currently do per-package migration hints. This approach depends on creating a file in the given series in the hints git repository. This should have no effect on anything else.

If the file is there (HEAD of git having it), then we consider the series frozen. We can then remove it when we're out of freeze.

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

FYI: I did not test this, just a quick brain dump.

Revision history for this message
Steve Beattie (sbeattie) wrote :

FYI, the security team would like something generally queryable so that we also know not to publish security updates during a point release freeze. Our team's current publishing tool uses a lookup in launchpad that looks for milestones in the series to be published that are targeted in the net 7 days, but release team does not seem to use these consistently.

Whatever approach the archive and release teams decide here, please communicate that approach more broadly to the community, so that people outside those specific teams can rely on that as well.

Thanks.

Revision history for this message
Steve Beattie (sbeattie) wrote :

Sorry, mention to point to the existing code the security team's package publication tool uses: https://git.launchpad.net/ubuntu-qa-tools/tree/security-tools/unembargo#n118

Revision history for this message
Robie Basak (racb) wrote :

I think this would be fine in principle. A couple of things I'm unsure about:

1) It fails unsafe. If for example Launchpad has an issue that returns 500, then release will be permitted. Should we instead require positive confirmation that the series is not in freeze? Not being able to release if git.launchpad.net is unavailable doesn't seem too bad to me, especially because --override-freeze exists.

2) Is the britney hints directory the right place to do this? For now, doesn't britney consider all stable releases as inactive? It seems a bit strange to overload this, but I don't feel strongly about this.

But also, if this works, it's better than the current situation, so let's land it and fixes and improvements can come later.

Revision history for this message
Robie Basak (racb) wrote :

> If for example Launchpad has an issue that returns 500, then release will be permitted.

Ah I was just guessing. Maybe you'll get an exception instead? Then it's fine.

Revision history for this message
Chris Halse Rogers (raof) wrote (last edit ):

This doesn't do what you think it does; urllib.request.urlopen will *throw an exception* on HTTP error; you only get a status object back if the HTTP call doesn't fail.

So, in its current state, this makes it so that sru-release will fail with an exception when the release is not frozen, and successfully warn you that the release is frozen when it *is* frozen ☺.

review: Needs Fixing
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Whoops, you're right! Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/sru-release b/sru-release
2index 5295372..6aaf962 100755
3--- a/sru-release
4+++ b/sru-release
5@@ -37,6 +37,7 @@ import time
6 import unittest
7
8 from six.moves.urllib.request import urlopen
9+from urllib.error import HTTPError
10 from io import TextIOWrapper
11
12 from launchpadlib.launchpad import Launchpad
13@@ -65,6 +66,21 @@ MISSING_PACKAGES_FROM_GROUP = (
14 "To ignore this message, pass '--skip-package-group-check'.")
15
16 BZR_HINT_BRANCH = "lp:~ubuntu-sru/britney/hints-ubuntu-%s"
17+POCKET_FREEZE_URL = "https://git.launchpad.net/~ubuntu-release/britney/+git/" \
18+ "hints-ubuntu/plain/sru-freeze?h=%s"
19+
20+
21+def check_pocket_freeze(release):
22+ """Check if the release is in a pocket freeze."""
23+
24+ try:
25+ check = urlopen(POCKET_FREEZE_URL % release)
26+ if check.getcode() == 200:
27+ return True
28+ else:
29+ return False
30+ except HTTPError:
31+ return False
32
33
34 def check_package_sets(packages):
35@@ -444,6 +460,10 @@ if __name__ == '__main__':
36 help=('Skip the package set checks that require some packages '
37 'be released together'))
38 parser.add_option(
39+ '--override-freeze', action='store_true', default=False,
40+ help='Override the freeze check and release package even if the '
41+ 'release is frozen')
42+ parser.add_option(
43 '--britney', action='store_true', default=False,
44 help='Use britney for copying the packages over to -updates (only '
45 'works for regular package releases into updates)')
46@@ -483,6 +503,12 @@ if __name__ == '__main__':
47 sys.stderr.write(e.args[0] + '\n')
48 sys.exit(1)
49
50+ if not options.override_freeze:
51+ if check_pocket_freeze(release):
52+ sys.stderr.write(
53+ "Release %s is frozen, use --override-freeze to override\n" % release)
54+ sys.exit(1)
55+
56 options.cache = os.path.expanduser(options.cache)
57 if not os.path.isdir(options.cache):
58 if os.path.exists(options.cache):

Subscribers

People subscribed via source and target branches