Merge ~racb/ubuntu-archive-tools:sru-release-freeze into ubuntu-archive-tools:main

Proposed by Robie Basak
Status: Needs review
Proposed branch: ~racb/ubuntu-archive-tools:sru-release-freeze
Merge into: ubuntu-archive-tools:main
Diff against target: 35 lines (+10/-0)
1 file modified
sru-release (+10/-0)
Reviewer Review Type Date Requested Status
Ubuntu Stable Release Updates Team Pending
Ubuntu Package Archive Administrators Pending
Review via email: mp+448828@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote :

Before landing, we need to decide where the freeze information should live, push my example freeze data repository there, and update the URL in sru-release.

This introduces a dependency on python3-yaml as that's the easiest way to load a set. I think that should be OK.

We're locking in the format of the data file a little bit here, but I don't think that should be a problem. In the future we might want freeze information bounded by dates, for example. But this should do for now, and if we do change the data format in the future, it shouldn't be a big deal just to ask SRU team members to update their checkout of ubuntu-archive-tools.

Unmerged commits

cb7dca7... by Robie Basak

sru-release: deny release for frozen series

We keep having accidents where SRU team members forget that a particular
release is in freeze and release to it anyway.

Instead of just remembering freeze emails, we should fix this in
tooling. Now, as long as the release team mark a release as frozen,
sru-release will refuse to release to it unless --force is used. --force
is intended to allow release team members to allow SRU releases through
that are intended for a point release.

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 a72eef3..814ef23 100755
--- a/sru-release
+++ b/sru-release
@@ -35,6 +35,7 @@ import subprocess
35import sys35import sys
36import time36import time
37import unittest37import unittest
38import yaml
3839
39from six.moves.urllib.request import urlopen40from six.moves.urllib.request import urlopen
40from io import TextIOWrapper41from io import TextIOWrapper
@@ -443,6 +444,9 @@ if __name__ == '__main__':
443 parser.add_option(444 parser.add_option(
444 '-C', '--cache', default='~/.cache/sru-release',445 '-C', '--cache', default='~/.cache/sru-release',
445 help='Cache directory to be used for the britney hints checkout')446 help='Cache directory to be used for the britney hints checkout')
447 parser.add_option(
448 '--force', default=False, action='store_true',
449 help='Override some errors that otherwise block release')
446450
447 options, args = parser.parse_args()451 options, args = parser.parse_args()
448452
@@ -478,6 +482,12 @@ if __name__ == '__main__':
478 sys.exit(1)482 sys.exit(1)
479 os.makedirs(options.cache)483 os.makedirs(options.cache)
480484
485 with urlopen('https://git.launchpad.net/~racb/+git/sru-freezes/plain/sru-freezes.yaml?h=main') as request:
486 frozen_releases = yaml.safe_load(request.read(2**10))
487 if release in frozen_releases and not options.force:
488 print("Release %s is in freeze and --force not specified" % release)
489 sys.exit(1)
490
481 launchpad = Launchpad.login_with(491 launchpad = Launchpad.login_with(
482 'ubuntu-archive-tools', options.launchpad_instance, version='devel')492 'ubuntu-archive-tools', options.launchpad_instance, version='devel')
483 ubuntu = launchpad.distributions['ubuntu']493 ubuntu = launchpad.distributions['ubuntu']

Subscribers

People subscribed via source and target branches