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
1diff --git a/sru-release b/sru-release
2index a72eef3..814ef23 100755
3--- a/sru-release
4+++ b/sru-release
5@@ -35,6 +35,7 @@ import subprocess
6 import sys
7 import time
8 import unittest
9+import yaml
10
11 from six.moves.urllib.request import urlopen
12 from io import TextIOWrapper
13@@ -443,6 +444,9 @@ if __name__ == '__main__':
14 parser.add_option(
15 '-C', '--cache', default='~/.cache/sru-release',
16 help='Cache directory to be used for the britney hints checkout')
17+ parser.add_option(
18+ '--force', default=False, action='store_true',
19+ help='Override some errors that otherwise block release')
20
21 options, args = parser.parse_args()
22
23@@ -478,6 +482,12 @@ if __name__ == '__main__':
24 sys.exit(1)
25 os.makedirs(options.cache)
26
27+ with urlopen('https://git.launchpad.net/~racb/+git/sru-freezes/plain/sru-freezes.yaml?h=main') as request:
28+ frozen_releases = yaml.safe_load(request.read(2**10))
29+ if release in frozen_releases and not options.force:
30+ print("Release %s is in freeze and --force not specified" % release)
31+ sys.exit(1)
32+
33 launchpad = Launchpad.login_with(
34 'ubuntu-archive-tools', options.launchpad_instance, version='devel')
35 ubuntu = launchpad.distributions['ubuntu']

Subscribers

People subscribed via source and target branches