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
diff --git a/sru-release b/sru-release
index 5295372..6aaf962 100755
--- a/sru-release
+++ b/sru-release
@@ -37,6 +37,7 @@ import time
37import unittest37import unittest
3838
39from six.moves.urllib.request import urlopen39from six.moves.urllib.request import urlopen
40from urllib.error import HTTPError
40from io import TextIOWrapper41from io import TextIOWrapper
4142
42from launchpadlib.launchpad import Launchpad43from launchpadlib.launchpad import Launchpad
@@ -65,6 +66,21 @@ MISSING_PACKAGES_FROM_GROUP = (
65 "To ignore this message, pass '--skip-package-group-check'.")66 "To ignore this message, pass '--skip-package-group-check'.")
6667
67BZR_HINT_BRANCH = "lp:~ubuntu-sru/britney/hints-ubuntu-%s"68BZR_HINT_BRANCH = "lp:~ubuntu-sru/britney/hints-ubuntu-%s"
69POCKET_FREEZE_URL = "https://git.launchpad.net/~ubuntu-release/britney/+git/" \
70 "hints-ubuntu/plain/sru-freeze?h=%s"
71
72
73def check_pocket_freeze(release):
74 """Check if the release is in a pocket freeze."""
75
76 try:
77 check = urlopen(POCKET_FREEZE_URL % release)
78 if check.getcode() == 200:
79 return True
80 else:
81 return False
82 except HTTPError:
83 return False
6884
6985
70def check_package_sets(packages):86def check_package_sets(packages):
@@ -444,6 +460,10 @@ if __name__ == '__main__':
444 help=('Skip the package set checks that require some packages '460 help=('Skip the package set checks that require some packages '
445 'be released together'))461 'be released together'))
446 parser.add_option(462 parser.add_option(
463 '--override-freeze', action='store_true', default=False,
464 help='Override the freeze check and release package even if the '
465 'release is frozen')
466 parser.add_option(
447 '--britney', action='store_true', default=False,467 '--britney', action='store_true', default=False,
448 help='Use britney for copying the packages over to -updates (only '468 help='Use britney for copying the packages over to -updates (only '
449 'works for regular package releases into updates)')469 'works for regular package releases into updates)')
@@ -483,6 +503,12 @@ if __name__ == '__main__':
483 sys.stderr.write(e.args[0] + '\n')503 sys.stderr.write(e.args[0] + '\n')
484 sys.exit(1)504 sys.exit(1)
485505
506 if not options.override_freeze:
507 if check_pocket_freeze(release):
508 sys.stderr.write(
509 "Release %s is frozen, use --override-freeze to override\n" % release)
510 sys.exit(1)
511
486 options.cache = os.path.expanduser(options.cache)512 options.cache = os.path.expanduser(options.cache)
487 if not os.path.isdir(options.cache):513 if not os.path.isdir(options.cache):
488 if os.path.exists(options.cache):514 if os.path.exists(options.cache):

Subscribers

People subscribed via source and target branches