ubuntu-bugcontrol team mailing list archive
-
ubuntu-bugcontrol team
-
Mailing list archive
-
Message #04604
Re: [Merge] ~sbeattie/ubuntu-qa-tools:unembargo-milestone-fixups into ubuntu-qa-tools:master
Review: Approve
Apologies for introducing the original bug this is fixing - thanks Steve, only minor nitpicks from me.
Diff comments:
> diff --git a/security-tools/unembargo b/security-tools/unembargo
> index 433fc2e..de192d1 100755
> --- a/security-tools/unembargo
> +++ b/security-tools/unembargo
> @@ -113,6 +113,31 @@ if opt.esm or opt.esm_apps or opt.esm_infra:
> else:
> opt.ppa = UBUNTU_SECURITY_PPA if opt.ppa is None else opt.ppa
>
> +# given an archive + release name, find any milestones that are upcoming.
> +# return either the first milestone within the window or None.
> +def find_milestone(ubuntu, release):
Perhaps a better name would be pending_milestone()?
> +
> + # number of days within a milestone deadline to be considered as frozen
> + MILESTONE_WINDOW = 7
> +
> + milestone = None
> + now = datetime.datetime.utcnow()
> + series = ubuntu.getSeries(name_or_version=release)
> +
> + for _milestone in series.all_milestones:
> + if _milestone.date_targeted is None:
> + continue
> + # add one extra day since the milestone may be released at any
> + # time
> + milestone_date = _milestone.date_targeted + datetime.timedelta(days=1)
> + if now < milestone_date and milestone_date < now + datetime.timedelta(days=MILESTONE_WINDOW):
> + milestone = _milestone
> + break
> +
> + return milestone
> +
> +
> +
> print("Loading Ubuntu Distribution ...")
> lp_version = "devel"
>
> @@ -159,29 +184,23 @@ for pkg_name in args:
> if len(seen[series_name]) > 1:
> seen[series_name] = sorted(seen[series_name], cmp=lambda x, y: apt_pkg.version_compare(
> x.source_package_version, y.source_package_version), reverse=True)
> +
> # lookup series milestones and warn if any are approaching
> - series = ubuntu.getSeries(name_or_version=series_name)
> - now = datetime.datetime.utcnow()
> - frozen = False
> - for milestone in series.all_milestones:
> - if milestone.date_targeted is None:
> - continue
> - # add one extra day since the milestone may be released at any
> - # time
> - milestone_date = milestone.date_targeted + datetime.timedelta(days=1)
> - if now < milestone_date and milestone_date < now + datetime.timedelta(days=7):
> - print("WARNING: %s is approaching milestone %s (due %s)" %
> - (series_name, milestone.name,
> - time.strftime("%Y-%m-%d", milestone.date_targeted.timetuple())))
> - print("NOTE: Please coordinate with the #ubuntu-release team before releasing.")
> - if not opt.force:
> - print("NOTE: To override this check and publish anyway please use the --force.")
> - print("NOTE: unembargo for %s will be skipped." % (series_name))
> - frozen = True
> - else:
> - print("NOTE: unembargo for %s will continue due to use of --force." % (series_name))
> - if not frozen:
> + milestone = find_milestone(ubuntu, series_name)
> + if milestone is None:
> unembargo.append(seen[series_name][0])
> + else:
> + print("WARNING: %s is approaching milestone %s (due %s)" %
> + (series_name, milestone.name,
> + time.strftime("%Y-%m-%d", milestone.date_targeted.timetuple())))
> + print("NOTE: Please coordinate with the #ubuntu-release team before releasing.")
> + if opt.force:
> + print("NOTE: unembargo for %s will continue due to use of --force." % (series_name))
> + unembargo.append(seen[series_name][0])
> + else:
> + print("NOTE: To override this check and publish anyway please use the --force.")
Since Marc feels strongly about it, we may as well change this to add a sys.exit(1) here then as well as part of this MR.
> + print("NOTE: unembargo for %s will be skipped." % (series_name))
> +
>
> # Publish
> for source_item in unembargo:
--
https://code.launchpad.net/~sbeattie/ubuntu-qa-tools/+git/ubuntu-qa-tools-1/+merge/427845
Your team Ubuntu Bug Control is subscribed to branch ubuntu-qa-tools:master.
Follow ups
References