3 commits - bodhi/config bodhi/mail.py bodhi/masher.py bodhi/model.py
by Luke Macken
bodhi/config/app.cfg | 4 +---
bodhi/config/f10-updates-testing.mash | 16 ----------------
bodhi/config/f10-updates.mash | 16 ----------------
bodhi/config/f11-updates-testing.mash | 17 -----------------
bodhi/config/f11-updates.mash | 17 -----------------
bodhi/config/f7-updates-testing.mash | 13 -------------
bodhi/config/f7-updates.mash | 13 -------------
bodhi/config/f8-updates-testing.mash | 16 ----------------
bodhi/config/f8-updates.mash | 16 ----------------
bodhi/config/f9-updates-testing.mash | 17 -----------------
bodhi/config/f9-updates.mash | 17 -----------------
bodhi/mail.py | 5 +----
bodhi/masher.py | 13 +------------
bodhi/model.py | 5 +----
14 files changed, 4 insertions(+), 181 deletions(-)
New commits:
commit 4710963d612ad3efa68e258599a3bd360047ac85
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 3 16:12:38 2010 -0400
Remove the F8/F9 era 'newkey' hacks (#336)
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg
index 214808d..e4f9e7a 100644
--- a/bodhi/config/app.cfg
+++ b/bodhi/config/app.cfg
@@ -50,8 +50,6 @@ comps_url = 'git://git.fedorahosted.org/comps.git'
##
file_url = 'http://download.fedoraproject.org/pub/fedora/linux/updates'
master_repomd = 'http://download.fedora.redhat.com/pub/fedora/linux/updates/%d/i386/repoda...'
-master_newkey_repomd = 'http://download.fedora.redhat.com/pub/fedora/linux/updates/%d/i386.newkey...'
-
fedora_master_repomd = 'http://download.fedora.redhat.com/pub/fedora/linux/updates/%d/i386/repoda...'
fedora_epel_master_repomd = 'http://download.fedora.redhat.com/pub/epel/%d/i386/repodata/repomd.xml'
diff --git a/bodhi/mail.py b/bodhi/mail.py
index 8332a9e..2016691 100644
--- a/bodhi/mail.py
+++ b/bodhi/mail.py
@@ -342,10 +342,7 @@ def get_template(update, use_template='fedora_errata_template'):
info['url'] = h[rpm.RPMTAG_URL]
if update.status == 'testing':
info['testing'] = ' Test'
- if update.release.name in ('F9', 'F8'):
- info['yum_repository'] = ' --enablerepo=updates-testing-newkey'
- else:
- info['yum_repository'] = ' --enablerepo=updates-testing'
+ info['yum_repository'] = ' --enablerepo=updates-testing'
else:
info['testing'] = ''
info['yum_repository'] = ''
diff --git a/bodhi/masher.py b/bodhi/masher.py
index 8658dbf..4165d04 100644
--- a/bodhi/masher.py
+++ b/bodhi/masher.py
@@ -749,14 +749,7 @@ class MashTask(Thread):
repomd = join(mashdir, repo, 'i386', 'repodata', 'repomd.xml')
if not exists(repomd):
log.error("Cannot find local repomd: %s" % repomd)
- # Hack, for new gpg key
- repomd = join(mashdir, repo, 'i386.newkey', 'repodata', 'repomd.xml')
- if not exists(repomd):
- log.error("Cannot find local repomd: %s" % repomd)
- return
- else:
- log.info("Found repomd at %s" % repomd)
- master_repomd = config.get('master_newkey_repomd')
+ return
checksum = sha.new(file(repomd).read()).hexdigest()
while True:
sleep(600)
@@ -786,10 +779,6 @@ class MashTask(Thread):
olduinfo = join(config.get('mashed_dir'), '%s.repodata' % repo,
'i386', 'updateinfo.xml.gz')
olduinfo = exists(olduinfo) and olduinfo or None
- if not olduinfo:
- olduinfo = join(config.get('mashed_dir'), '%s.repodata' % repo,
- 'i386.newkey', 'updateinfo.xml.gz')
- olduinfo = exists(olduinfo) and olduinfo or None
repo = join(mashdir, repo)
log.debug("Generating updateinfo.xml.gz for %s" % repo)
uinfo = ExtendedMetadata(repo, olduinfo)
diff --git a/bodhi/model.py b/bodhi/model.py
index 08a4caa..04a2dcb 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -1168,10 +1168,7 @@ class Bugzilla(SQLObject):
message = self.default_msg % (update.get_title(delim=', '), "%s %s" %
(update.release.long_name, update.status))
if update.status == "testing":
- if update.release.name in ('F9', 'F8'):
- repo = 'updates-testing-newkey'
- else:
- repo = 'updates-testing'
+ repo = 'updates-testing'
message += ("\n If you want to test the update, you can install " +
"it with \n su -c 'yum --enablerepo=%s " +
"update %s'. You can provide feedback for this " +
commit 9cf413cf04c936eb285f26787600eb9efc5707fd
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 3 16:09:28 2010 -0400
Remove EOL mash configs
diff --git a/bodhi/config/f10-updates-testing.mash b/bodhi/config/f10-updates-testing.mash
deleted file mode 100644
index 357b1bb..0000000
--- a/bodhi/config/f10-updates-testing.mash
+++ /dev/null
@@ -1,16 +0,0 @@
-# mash config file
-
-[f10-updates-testing]
-rpm_path = %(arch)s/
-source_path = SRPMS/
-debuginfo = True
-multilib = True
-multilib_method = devel
-tag = dist-f10-updates-testing
-inherit = False
-strict_keys = True
-keys = 0B86274E
-repoviewurl = http://download.fedoraproject.org/pub/fedora/linux/updates/testing/10/%(a...
-repoviewtitle = "Fedora 10 Updates Testing - %(arch)s"
-arches = i386 x86_64 ppc ppc64
-hash = sha
diff --git a/bodhi/config/f10-updates.mash b/bodhi/config/f10-updates.mash
deleted file mode 100644
index aa71a63..0000000
--- a/bodhi/config/f10-updates.mash
+++ /dev/null
@@ -1,16 +0,0 @@
-# mash config file
-
-[f10-updates]
-rpm_path = %(arch)s/
-source_path = SRPMS/
-debuginfo = True
-multilib = True
-multilib_method = devel
-tag = dist-f10-updates
-inherit = False
-strict_keys = True
-keys = 4EBFC273
-repoviewurl = http://download.fedoraproject.org/pub/fedora/linux/updates/10/%(arch)s/
-repoviewtitle = "Fedora 10 Updates - %(arch)s"
-arches = i386 x86_64 ppc ppc64
-hash = sha
diff --git a/bodhi/config/f11-updates-testing.mash b/bodhi/config/f11-updates-testing.mash
deleted file mode 100644
index d3099fd..0000000
--- a/bodhi/config/f11-updates-testing.mash
+++ /dev/null
@@ -1,17 +0,0 @@
-# mash config file
-
-[f11-updates-testing]
-rpm_path = %(arch)s/
-source_path = SRPMS/
-debuginfo = True
-multilib = True
-multilib_method = devel
-tag = dist-f11-updates-testing
-inherit = False
-strict_keys = True
-keys = D22E77F2
-repoviewurl = http://download.fedoraproject.org/pub/fedora/linux/updates/testing/11/%(a...
-repoviewtitle = "Fedora 11 Updates Testing - %(arch)s"
-arches = i386 x86_64 ppc ppc64
-delta = True
-delta_dirs = /pub/fedora/linux/releases/11/Everything/%(arch)s/os/,/mnt/koji/mash/updates/f11-updates/%(arch)s/
diff --git a/bodhi/config/f11-updates.mash b/bodhi/config/f11-updates.mash
deleted file mode 100644
index d4879d1..0000000
--- a/bodhi/config/f11-updates.mash
+++ /dev/null
@@ -1,17 +0,0 @@
-# mash config file
-
-[f11-updates]
-rpm_path = %(arch)s/
-source_path = SRPMS/
-debuginfo = True
-multilib = True
-multilib_method = devel
-tag = dist-f11-updates
-inherit = False
-strict_keys = True
-keys = D22E77F2
-repoviewurl = http://download.fedoraproject.org/pub/fedora/linux/updates/11/%(arch)s/
-repoviewtitle = "Fedora 11 Updates - %(arch)s"
-arches = i386 x86_64 ppc ppc64
-delta = True
-delta_dirs = /pub/fedora/linux/releases/11/Everything/%(arch)s/os/,/mnt/koji/mash/updates/f11-updates/%(arch)s/
diff --git a/bodhi/config/f7-updates-testing.mash b/bodhi/config/f7-updates-testing.mash
deleted file mode 100644
index a682452..0000000
--- a/bodhi/config/f7-updates-testing.mash
+++ /dev/null
@@ -1,13 +0,0 @@
-# mash config file
-
-[f7-updates-testing]
-rpm_path = %(arch)s/
-source_path = SRPMS/
-debuginfo = True
-multilib = True
-multilib_method = devel
-tag = dist-fc7-updates-testing
-inherit = False
-strict_keys = False
-keys = 30C9ECF8
-arches = i386 x86_64 ppc ppc64
diff --git a/bodhi/config/f7-updates.mash b/bodhi/config/f7-updates.mash
deleted file mode 100644
index a16c95a..0000000
--- a/bodhi/config/f7-updates.mash
+++ /dev/null
@@ -1,13 +0,0 @@
-# mash config file
-
-[f7-updates]
-rpm_path = %(arch)s/
-source_path = SRPMS/
-debuginfo = True
-multilib = True
-multilib_method = devel
-tag = dist-fc7-updates
-inherit = False
-strict_keys = False
-keys = 4F2A6FD2
-arches = i386 x86_64 ppc ppc64
diff --git a/bodhi/config/f8-updates-testing.mash b/bodhi/config/f8-updates-testing.mash
deleted file mode 100644
index a514e74..0000000
--- a/bodhi/config/f8-updates-testing.mash
+++ /dev/null
@@ -1,16 +0,0 @@
-# mash config file
-
-[f8-updates-testing]
-rpm_path = %(arch)s.newkey/
-source_path = SRPMS.newkey/
-debuginfo_path = %(arch)s.newkey/debug
-debuginfo = True
-multilib = True
-multilib_method = devel
-tag = dist-f8-updates-testing
-inherit = False
-strict_keys = True
-keys = DF9B0AE9
-repoviewurl = http://download.fedoraproject.org/pub/fedora/linux/updates/testing/8/%(ar...
-repoviewtitle = "Fedora 8 Updates Testing - %(arch)s"
-arches = i386 x86_64 ppc ppc64
diff --git a/bodhi/config/f8-updates.mash b/bodhi/config/f8-updates.mash
deleted file mode 100644
index 510af3c..0000000
--- a/bodhi/config/f8-updates.mash
+++ /dev/null
@@ -1,16 +0,0 @@
-# mash config file
-
-[f8-updates]
-rpm_path = %(arch)s.newkey/
-source_path = SRPMS.newkey/
-debuginfo_path = %(arch)s.newkey/debug
-debuginfo = True
-multilib = True
-multilib_method = devel
-tag = dist-f8-updates
-inherit = False
-strict_keys = True
-keys = 6DF2196F
-repoviewurl = http://download.fedoraproject.org/pub/fedora/linux/updates/8/%(arch)s.new...
-repoviewtitle = "Fedora 8 Updates - %(arch)s"
-arches = i386 x86_64 ppc ppc64
diff --git a/bodhi/config/f9-updates-testing.mash b/bodhi/config/f9-updates-testing.mash
deleted file mode 100644
index 8f43ff1..0000000
--- a/bodhi/config/f9-updates-testing.mash
+++ /dev/null
@@ -1,17 +0,0 @@
-# mash config file
-
-[f9-updates-testing]
-rpm_path = %(arch)s.newkey/
-source_path = SRPMS.newkey/
-debuginfo_path = %(arch)s.newkey/debug
-debuginfo = True
-multilib = True
-multilib_method = devel
-tag = dist-f9-updates-testing
-inherit = False
-strict_keys = True
-keys = DF9B0AE9
-repoviewurl = http://download.fedoraproject.org/pub/fedora/linux/updates/testing/9/%(ar...
-repoviewtitle = "Fedora 9 Updates Testing - %(arch)s"
-arches = i386 x86_64 ppc ppc64
-hash = sha
diff --git a/bodhi/config/f9-updates.mash b/bodhi/config/f9-updates.mash
deleted file mode 100644
index 9ee06e7..0000000
--- a/bodhi/config/f9-updates.mash
+++ /dev/null
@@ -1,17 +0,0 @@
-# mash config file
-
-[f9-updates]
-rpm_path = %(arch)s.newkey/
-source_path = SRPMS.newkey/
-debuginfo_path = %(arch)s.newkey/debug
-debuginfo = True
-multilib = True
-multilib_method = devel
-tag = dist-f9-updates
-inherit = False
-strict_keys = True
-keys = 6DF2196F
-repoviewurl = http://download.fedoraproject.org/pub/fedora/linux/updates/9/%(arch)s.new...
-repoviewtitle = "Fedora 9 Updates - %(arch)s"
-arches = i386 x86_64 ppc ppc64
-hash = sha
commit 27a73b5e2e7611a83282b513b11c5933f05b584c
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 3 15:34:46 2010 -0400
Bring our critpath list up to date... nothing has changed
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg
index 5b9b69b..214808d 100644
--- a/bodhi/config/app.cfg
+++ b/bodhi/config/app.cfg
@@ -161,7 +161,7 @@ tgcaptcha.key = 'Y`h`f&s}TZz'
## Critical Path Packages
##
## Hardcoded, until we can query the pkgdb for it.
-## http://kojipkgs.fedoraproject.org/mash/branched-20100429/logs/critpath.txt
+## http://kojipkgs.fedoraproject.org/mash/branched-20100518/logs/critpath.txt
critpath = "ConsoleKit ConsoleKit-libs ConsoleKit-x11 GConf2 GConf2-gtk MAKEDEV ModemManager NetworkManager NetworkManager-glib ORBit2 acl alsa-lib anaconda anaconda-yum-plugins at-spi atk attr audit audit-libs authconfig authconfig-gtk avahi avahi-autoipd avahi-glib basesystem bash binutils bzip2 bzip2-libs c-ares ca-certificates cairo checkpolicy chkconfig cloog-ppl compat-db47 comps-extras control-center control-center-filesystem coreutils coreutils-libs cpio cpp cracklib cracklib-dicts cracklib-python createrepo cronie cronie-anacron crontabs cryptsetup-luks cryptsetup-luks-libs cups-libs curl cyrus-sasl cyrus-sasl-lib dash db4 db4-utils dbus dbus-glib dbus-libs dbus-python dbus-x11 deltarpm desktop-backgrounds-basic desktop-file-utils device-mapper device-mapper-event device-mapper-event-libs device-mapper-libs dhclient diffutils dmidecode dmraid dmraid-events dmz-cursor-themes dnsmasq dosfstools dracut e2fsprogs e2fsprogs-libs efibootmgr eggdbus elfutils elfutils-libelf elfutils-libs enchant evolution-data-server expat fedora-gnome-theme fedora-icon-theme fedora-logos fedora-release file file-libs filesystem findutils fipscheck fipscheck-lib firstboot flac fontconfig freetype gamin gawk gcc gcc-c++ gdbm gdm genisoimage glib2 glibc glibc-common glibc-devel glibc-headers gmp gnome-desktop gnome-icon-theme gnome-keyring gnome-keyring-pam gnome-menus gnome-panel-libs gnome-python2 gnome-python2-canvas gnome-python2-gnome gnome-python2-gnomevfs gnome-session gnome-settings-daemon gnome-themes gnome-vfs2 gnupg2 gnutls gobject-introspection goddard-backgrounds-gnome goddard-backgrounds-single gpgme grep grub grubby gstreamer gstreamer-tools gtk2 gtk2-engines gzip hal hal-filesystem hal-info hal-libs hdparm hesiod hicolor-icon-theme hostname hunspell hwdata info initscripts iptables iptables-ipv6 iputils iscsi-initiator-utils iso-codes isomd5sum jasper-libs kbd kernel kernel-headers keyutils-libs koji kpartx krb5-libs less libICE libIDL libSM libX11 libX11-common libXScrnSaver libXau libXcomposite libXcursor libXdamage libXdmcp libXext libXfixes libXfont libXft libXi libXinerama libXmu libXrandr libXrender libXres libXt libXtst libXv libXvMC libXxf86misc libXxf86vm libacl libarchive libart_lgpl libasyncns libattr libblkid libbonobo libbonoboui libcanberra libcanberra-gtk2 libcap libcap-ng libcom_err libcroco libcurl libdaemon libdrm libedit libffi libfontenc libgail-gnome libgcc libgcrypt libglade2 libgnome libgnome-keyring libgnomecanvas libgnomekbd libgnomeui libgomp libgpg-error libgsf libgudev1 libgweather libical libidn libjpeg libmcpp libnih libnl libnotify libogg libpcap libpciaccess libpng libproxy librsvg2 libselinux libselinux-python libselinux-utils libsemanage libsepol libsexy libsndfile libsoup libss libssh2 libstdc++ libstdc++-devel libtasn1 libtdb libthai libtiff libtool-ltdl libudev libusb libuser libuser-python libutempter libuuid libvorbis libwnck libx86 libxcb libxfce4util libxfcegui4 libxkbfile libxklavier libxml2 libxml2-python libxslt linux-firmware livecd-tools logrotate lua lvm2 lvm2-libs m4 makebootfat mash mcpp mdadm mesa-dri-drivers metacity mingetty mobile-broadband-provider-info module-init-tools mpfr mtools mysql-libs ncurses ncurses-base ncurses-libs net-tools newt newt-python notification-daemon notification-daemon-engine-slider nspr nss nss-softokn nss-softokn-freebl nss-sysinit nss-util ntp ntpdate openldap openssh openssh-clients openssh-server openssl pam pango parted passwd patch pciutils-libs pcre perl perl-Crypt-PasswdMD5 perl-Digest-SHA1 perl-Module-Pluggable perl-Pod-Escapes perl-Pod-Simple perl-libs perl-version pinentry pixman pkgconfig plymouth plymouth-core-libs plymouth-gdm-hooks plymouth-scripts plymouth-utils pm-utils policycoreutils polkit polkit-desktop-policy polkit-gnome popt postfix ppl ppp procmail procps psmisc pth pulseaudio-gdm-hooks pulseaudio-libs pulseaudio-libs-glib2 pungi pyOpenSSL pycairo pygobject2 pygpgme pygtk2 pygtk2-libglade pykickstart pyparted python python-bugzilla python-cryptsetup python-decorator python-deltarpm python-ethtool python-imgcreate python-iniparse python-kid python-krbV python-libs python-meh python-nss python-pyblock python-pycurl python-slip python-urlgrabber pyxf86config radeontool rarian rarian-compat readline redhat-menus redhat-rpm-config repoview rootfiles rpm rpm-build rpm-libs rpm-python rsyslog sed selinux-policy selinux-policy-targeted sendmail setserial setup setuptool sgml-common sgpio shadow-utils shared-mime-info slang sound-theme-freedesktop sqlite squashfs-tools startup-notification sudo sysklogd syslinux system-config-date system-config-firewall-base system-config-keyboard system-config-users system-setup-keyboard sysvinit-tools tar tcp_wrappers-libs tigervnc-server tzdata udev unique unzip upower upstart usermode usermode-gtk ustr util-linux-ng vbetool vim-minimal which wpa_supplicant xcb-util xdg-utils xfce4-notifyd xfconf xkeyboard-config xml-common xorg-x11-drivers xorg-x11-drv-acecad xorg-x11-drv-aiptek xorg-x11-drv-apm xorg-x11-drv-ast xorg-x11-drv-ati xorg-x11-drv-cirrus xorg-x11-drv-dummy xorg-x11-drv-elographics xorg-x11-drv-evdev xorg-x11-drv-fbdev xorg-x11-drv-fpit xorg-x11-drv-geode xorg-x11-drv-glint xorg-x11-drv-hyperpen xorg-x11-drv-i128 xorg-x11-drv-i740 xorg-x11-drv-intel xorg-x11-drv-keyboard xorg-x11-drv-mach64 xorg-x11-drv-mga xorg-x11-drv-mouse xorg-x11-drv-mutouch xorg-x11-drv-neomagic xorg-x11-drv-nouveau xorg-x11-drv-nv xorg-x11-drv-openchrome xorg-x11-drv-penmount xorg-x11-drv-r128 xorg-x11-drv-rendition xorg-x11-drv-s3virge xorg-x11-drv-savage xorg-x11-drv-siliconmotion xorg-x11-drv-sis xorg-x11-drv-sisusb xorg-x11-drv-synaptics xorg-x11-drv-tdfx xorg-x11-drv-trident xorg-x11-drv-v4l xorg-x11-drv-vesa xorg-x11-drv-vmmouse xorg-x11-drv-vmware xorg-x11-drv-void xorg-x11-drv-voodoo xorg-x11-drv-wacom xorg-x11-font-utils xorg-x11-fonts-misc xorg-x11-server-Xorg xorg-x11-server-common xorg-x11-server-utils xorg-x11-xauth xorg-x11-xinit xorg-x11-xkb-utils xz xz-libs yum yum-metadata-parser yum-utils zenity zlib"
# The number of admin approvals it takes to be able to push a critical path
13 years, 9 months
bodhi/config bodhi/jobs.py bodhi/model.py bodhi/tests
by Luke Macken
bodhi/config/app.cfg | 11 ++++-
bodhi/jobs.py | 31 +++++++++++++++
bodhi/model.py | 80 +++++++++++++++++++++++++++++++++++++---
bodhi/tests/test_client.py | 6 +--
bodhi/tests/test_controllers.py | 68 ++++++++++++++++++++++++++++++++++
5 files changed, 185 insertions(+), 11 deletions(-)
New commits:
commit cd090b61c980e7b209b4cdfdd8679173935b591f
Author: Luke Macken <lmacken(a)redhat.com>
Date: Tue Aug 3 15:19:15 2010 -0400
Bring bodhi up to speed with the Package Update Acceptance Criteria policy.
https://fedoraproject.org/wiki/Package_update_acceptance_criteria
- Allow for a 'mandatory_days_in_testing' configurable variable to be set for
each release. If it exists, bodhi will prevent updates from being pushed to
stable until it either reaches the 'stable karma' defined by the submitter,
or spends a certain amount of time in testing (defaults to 7 days for Fedora,
14 days for EPEL).
- Add an `approve_testing_updates` job that runs every night and approves
updates that have reached this minimum amount of testing
- Add a unit test that exercies this workflow
diff --git a/bodhi/config/app.cfg b/bodhi/config/app.cfg
index 419bcb1..5b9b69b 100644
--- a/bodhi/config/app.cfg
+++ b/bodhi/config/app.cfg
@@ -38,8 +38,8 @@ mash_conf = '%(top_level_dir)s/config/mash.conf'
createrepo_cache_dir = "/var/tmp/createrepo"
## Our periodic jobs
-#jobs = 'clean_repo nagmail fix_bug_titles cache_release_data'
-jobs = 'cache_release_data refresh_metrics'
+#jobs = 'clean_repo nagmail fix_bug_titles cache_release_data approve_testing_updates'
+jobs = 'cache_release_data refresh_metrics approve_testing_updates'
## Comps configuration
comps_dir = '/usr/share/bodhi/comps'
@@ -171,7 +171,12 @@ critpath.num_admin_approvals = 1
# The net karma required to submit a critial path update to a pending release)
critpath.min_karma = 2
-# The commented out values below are the defaults
+# The minimum amount of time an update must spend in testing before
+# it can reach the stable repository
+fedora.mandatory_days_in_testing = 7
+fedora_epel.mandatory_days_in_testing = 14
+
+testing_approval_msg = "This update has reached %d days in testing and can be pushed to stable now if the maintainer wishes"
# The number of days worth of updates/comments to display
feeds.num_days_to_show = 7
diff --git a/bodhi/jobs.py b/bodhi/jobs.py
index 6af78a2..125b205 100644
--- a/bodhi/jobs.py
+++ b/bodhi/jobs.py
@@ -166,6 +166,30 @@ def refresh_metrics():
log.exception(e)
+def approve_testing_updates():
+ """
+ Scan all testing updates and approve ones that have met the per-release
+ testing requirements.
+
+ https://fedoraproject.org/wiki/Package_update_acceptance_criteria
+ """
+ log.info('Running approve_testing_updates job...')
+ for update in PackageUpdate.select(
+ AND(PackageUpdate.q.status == 'testing',
+ PackageUpdate.q.request == None)):
+ # If this release does not have any testing requirements, skip it
+ if not update.release.mandatory_days_in_testing:
+ continue
+ # If this has already met testing requirements, skip it
+ if update.met_testing_requirements:
+ continue
+ if update.meets_testing_requirements:
+ log.info('%s now meets testing requirements' % update.title)
+ update.comment(
+ config.get('testing_approval_msg') % update.days_in_testing,
+ author='bodhi')
+
+
def schedule():
""" Schedule our periodic tasks """
@@ -209,3 +233,10 @@ def schedule():
taskname='Refresh our metrics',
initialdelay=7200,
interval=86400)
+
+ # Approve updates that have been in testing for a certain amount of time
+ if 'approve_testing_updates' in jobs:
+ log.debug("Scheduling approve_testing_updates job")
+ scheduler.add_weekday_task(action=approve_testing_updates,
+ weekdays=range(1,8),
+ timeonday=(0,0))
diff --git a/bodhi/model.py b/bodhi/model.py
index 1bdff4b..08a4caa 100644
--- a/bodhi/model.py
+++ b/bodhi/model.py
@@ -109,6 +109,11 @@ class Release(SQLObject):
else:
return '%s-updates-testing' % id
+ @property
+ def mandatory_days_in_testing(self):
+ return config.get('%s.mandatory_days_in_testing' %
+ self.id_prefix.lower().replace('-', '_'))
+
def __json__(self):
return dict(name=self.name, long_name=self.long_name,
id_prefix=self.id_prefix, dist_tag=self.dist_tag,
@@ -446,11 +451,35 @@ class PackageUpdate(SQLObject):
log.info('Forcing critical path update into testing')
action = 'testing'
+ # Ensure this update meets the minimum testing requirements
+ flash_notes = ''
+ if action == 'stable' and not self.critpath:
+ # Check if we've met the karma requirements
+ if self.karma >= self.stable_karma:
+ pass
+ else:
+ # If we haven't met the stable karma requirements, check if it has met
+ # the mandatory time-in-testing requirements
+ if self.release.mandatory_days_in_testing:
+ if not self.met_testing_requirements:
+ flash_notes = 'This update has not yet met the minimum testing requirements defined in the <a href="https://fedoraproject.org/wiki/Package_update_acceptance_criteria">Package Update Acceptance Criteria</a>'
+ if self.status == 'testing':
+ self.request = None
+ flash_log(flash_notes)
+ return
+ elif self.request == 'testing':
+ flash_log(flash_notes)
+ return
+ else:
+ action = 'testing'
+
self.request = action
self.pushed = False
#self.date_pushed = None
notes = notes and '. '.join(notes) or ''
- flash_log("%s has been submitted for %s. %s" %(self.title,action,notes))
+ flash_notes = flash_notes and '. %s' % flash_notes
+ flash_log("%s has been submitted for %s. %s%s" % (self.title,
+ action, notes, flash_notes))
self.comment('This update has been submitted for %s by %s. %s' % (
action, identity.current.user_name, notes), author='bodhi')
mail.send_admin(action, self)
@@ -985,22 +1014,63 @@ class PackageUpdate(SQLObject):
self.status)
@property
- def time_in_testing(self):
+ def days_in_testing(self):
""" Return the number of days that this update has been in testing """
timestamp = None
for comment in self.comments:
if comment.text == 'This update has been pushed to testing':
timestamp = comment.timestamp
if self.status == 'testing':
- return datetime.utcnow() - timestamp
+ return (datetime.utcnow() - timestamp).days
else:
break
if not timestamp:
return
for comment in self.comments:
if comment.text == 'This update has been pushed to stable':
- return comment.timestamp - timestamp
- return datetime.utcnow() - timestamp
+ return (comment.timestamp - timestamp).days
+ return (datetime.utcnow() - timestamp).days
+
+ @property
+ def meets_testing_requirements(self):
+ """
+ Return whether or not this update meets the testing requirements
+ for this specific release.
+
+ If this release does not have a mandatory testing requirement, then
+ simply return True.
+ """
+ if self.critpath:
+ return self.critpath_approved
+ num_days = self.release.mandatory_days_in_testing
+ if not num_days:
+ return True
+ return self.days_in_testing >= num_days
+
+ @property
+ def met_testing_requirements(self):
+ """
+ Return whether or not this update has already met the testing
+ requirements.
+
+ If this release does not have a mandatory testing requirement, then
+ simply return True.
+ """
+ min_num_days = self.release.mandatory_days_in_testing
+ num_days = self.days_in_testing
+ if min_num_days:
+ if num_days < min_num_days:
+ return False
+ else:
+ return True
+ for comment in self.comments:
+ if comment.author == 'bodhi' and \
+ comment.text.startswith('This update has reached') and \
+ comment.text.endswith('days in testing and can be pushed to'
+ ' stable now if the maintainer wishes'):
+ return True
+ return False
+
class Comment(SQLObject):
diff --git a/bodhi/tests/test_client.py b/bodhi/tests/test_client.py
index 2213e6b..7892fd3 100644
--- a/bodhi/tests/test_client.py
+++ b/bodhi/tests/test_client.py
@@ -146,7 +146,7 @@ class TestClient(testutil.DBTest):
assert PackageUpdate.byTitle(self.build)
bodhi.request(update=self.build, request=opts.request)
update = PackageUpdate.byTitle(self.build)
- assert update.request == 'stable'
+ assert update.request == 'testing'
opts.request = 'testing'
bodhi.request(update=self.build, request=opts.request)
update = PackageUpdate.byTitle(self.build)
@@ -209,5 +209,5 @@ close_bugs=True
testutil.print_log()
update = bodhi.query()['updates'][0]
assert update and isinstance(update, dict)
- assert bodhi.update_str(update).startswith(u'================================================================================\n TurboGears-1.0.3.2-1.fc7\n================================================================================\n Release: Fedora 7\n Status: pending\n Type: bugfix\n Karma: 0\n Request: stable\n Bugs: 12345 - None\n : 6789 - None\n Notes: foo\n Submitter: guest\n')
- assert bodhi.update_str(update).endswith(u' (karma 0)\n This update has been submitted for stable by guest.\n\n http://localhost:8084/updates/TurboGears-1.0.3.2-1.fc7\n')
+ assert bodhi.update_str(update).startswith(u'================================================================================\n TurboGears-1.0.3.2-1.fc7\n================================================================================\n Release: Fedora 7\n Status: pending\n Type: bugfix\n Karma: 0\n Request: testing\n Bugs: 12345 - None\n : 6789 - None\n Notes: foo\n Submitter: guest\n')
+ assert bodhi.update_str(update).endswith(u' (karma 0)\n This update has been submitted for testing by guest.\n\n http://localhost:8084/updates/TurboGears-1.0.3.2-1.fc7\n')
diff --git a/bodhi/tests/test_controllers.py b/bodhi/tests/test_controllers.py
index 4a86638..96ce0fd 100644
--- a/bodhi/tests/test_controllers.py
+++ b/bodhi/tests/test_controllers.py
@@ -2246,3 +2246,71 @@ class TestControllers(testutil.DBTest):
assert False, "Update with duplicate packages was saved!"
except SQLObjectNotFound, e:
pass
+
+ def test_week_in_testing(self):
+ from bodhi.jobs import approve_testing_updates
+ session = login()
+ create_release()
+ params = {
+ 'builds' : 'TurboGears-1.0.8-1.fc7',
+ 'release' : 'Fedora 7',
+ 'type_' : 'bugfix',
+ 'bugs' : '',
+ 'notes' : 'foobar',
+ 'request' : 'Stable',
+ 'suggest_reboot' : True,
+ 'autokarma' : True,
+ 'stable_karma' : 5,
+ 'unstable_karma' : -5
+ }
+ self.save_update(params, session)
+ up = PackageUpdate.byTitle(params['builds'])
+
+ # Ensure we can't push directly to stable
+ assert up.request == 'testing'
+
+ # Pretend it's pushed to testing
+ up.status = 'testing'
+ up.status_comment()
+ assert not up.days_in_testing
+
+ # Run the approve_testing_updates job, which shouldn't do anything
+ approve_testing_updates()
+
+ # Fake almost a week of testing
+ assert len(up.comments) == 2, up.comments
+ up.comments[1].timestamp -= timedelta(days=6)
+ assert up.days_in_testing == 6
+
+ # Run the approve_testing_updates job, which shouldn't do anything
+ approve_testing_updates()
+
+ # Ensure it can't be pushed, and that there are no comments
+ testutil.create_request('/updates/request/stable/%s' % params['builds'],
+ method='POST', headers=session)
+ up = PackageUpdate.byTitle(params['builds'])
+ assert not up.request
+ assert len(up.comments) == 2, up.comments[-1].text
+
+ # Fake a week of testing
+ up.comments[0].timestamp -= timedelta(days=1)
+ assert up.days_in_testing == 7, up.days_in_testing
+
+ # Run the approve_testing_updates job, which should approve this update
+ approve_testing_updates()
+
+ # assert approval comment in comments
+ up = PackageUpdate.byTitle(params['builds'])
+ assert len(up.comments) == 3
+ assert up.comments[-1].text == 'This update has reached 7 days in testing and can be pushed to stable now if the maintainer wishes'
+
+ # ensure it's not auto pushed to testing
+ assert up.status == 'testing'
+ assert not up.request
+
+ # ensure we can push it to testing
+ testutil.create_request('/updates/request/stable/%s' % params['builds'],
+ method='POST', headers=session)
+ up = PackageUpdate.byTitle(params['builds'])
+ assert up.request == 'stable'
+ assert up.comments[-1].text == u'This update has been submitted for stable by guest. '
13 years, 9 months