Skip to content

Commit

Permalink
Merge branch 'release/0.7.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphbean committed Apr 6, 2016
2 parents f81d22a + edfcce2 commit 8592f57
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 20 deletions.
47 changes: 47 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@

0.7.3
-----

Pull Requests

- (@phracek) #108, Fixes #107: Detect if file exists or is not empty
https://github.com/fedora-infra/the-new-hotness/pull/108
- (@ralphbean) #109, Correct another instance of mis-used six.iteritems().
https://github.com/fedora-infra/the-new-hotness/pull/109
- (@phracek) #111, Fixes #110: This does not really fix the problem. Log about attaching is
https://github.com/fedora-infra/the-new-hotness/pull/111
- (@ralphbean) #112, This dict expects a 4-tuple everywhere else in the code.
https://github.com/fedora-infra/the-new-hotness/pull/112
- (@phracek) #114, Fix #113 Text in bugzilla has to be clear.
https://github.com/fedora-infra/the-new-hotness/pull/114
- (@ralphbean) #115, Handle OSError from 'rm'.
https://github.com/fedora-infra/the-new-hotness/pull/115
- (@phracek) #118, Check if dir exists before deleting
https://github.com/fedora-infra/the-new-hotness/pull/118
- (@ralphbean) #120, Check if rawhide_version == upstream_version first.
https://github.com/fedora-infra/the-new-hotness/pull/120

Commits

- 71d7b2151 Fixes #107: Detect if file exists or is not empty
https://github.com/fedora-infra/the-new-hotness/commit/71d7b2151
- 1a88414ea Correct another instance of mis-used six.iteritems().
https://github.com/fedora-infra/the-new-hotness/commit/1a88414ea
- a99c1fbda Fixes #110: This does not really fix the problem. Log about attaching is valid only in case really attach.
https://github.com/fedora-infra/the-new-hotness/commit/a99c1fbda
- c6459c2cc This dict expects a 4-tuple everywhere else in the code.
https://github.com/fedora-infra/the-new-hotness/commit/c6459c2cc
- d7e91ba3f Fix #113 Text in bugzilla has to be clear.
https://github.com/fedora-infra/the-new-hotness/commit/d7e91ba3f
- 38ee2caf6 Update text once again with feedback from @pnemade.
https://github.com/fedora-infra/the-new-hotness/commit/38ee2caf6
- 83f524842 Handle OSError from 'rm'.
https://github.com/fedora-infra/the-new-hotness/commit/83f524842
- 77e30b3a9 Check if dir exists instead.
https://github.com/fedora-infra/the-new-hotness/commit/77e30b3a9
- 53cbda5df Check if dir exists before deleting
https://github.com/fedora-infra/the-new-hotness/commit/53cbda5df
- 48bcd0048 Check if rawhide_version == upstream_version first.
https://github.com/fedora-infra/the-new-hotness/commit/48bcd0048
- 3a2b1b834 .. but do also publish in this case.
https://github.com/fedora-infra/the-new-hotness/commit/3a2b1b834
A bugfix to the last release which should attach more information to bugs when
rebase-helper fails to bump things.

Expand Down
11 changes: 6 additions & 5 deletions hotness/bz.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import logging

import bugzilla

import os

class Bugzilla(object):
base_query = {
Expand Down Expand Up @@ -123,10 +123,11 @@ def follow_up(self, text, bug):
self.log.info("Followed up on bug: %s" % bug.weburl)

def attach_patch(self, filename, description, bug):
self.log.debug("Attaching patch to bug %r" % bug.bug_id)
self.bugzilla.attachfile(bug.bug_id, filename, description,
is_patch=True)
self.log.info("Attached patch to bug: %s" % bug.weburl)
if os.path.exists(filename) and os.path.getsize(filename) != 0:
self.log.debug("Attaching patch to bug %r" % bug.bug_id)
self.bugzilla.attachfile(bug.bug_id, filename, description,
is_patch=True)
self.log.info("Attached patch to bug: %s" % bug.weburl)

def ftbfs_bugs(self, name):
""" Return all FTBFS bugs we find for a package """
Expand Down
32 changes: 19 additions & 13 deletions hotness/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,6 @@ def _handle_anitya_update(self, upstream, package, msg):

# Is it something that we're being asked not to act on?
is_monitored = self.is_monitored(package)
if not is_monitored:
self.log.info("Pkgdb says not to monitor %r. Dropping." % package)
self.publish("update.drop", msg=dict(trigger=msg, reason="pkgdb"))
return

# Is it new to us?
fname = self.yumconfig
Expand All @@ -236,8 +232,9 @@ def _handle_anitya_update(self, upstream, package, msg):
# nothing reasonable we can do. Notify the world of our failure
# and go back to the event loop.
self.log.warn("No rawhide version found for %r" % package)
self.publish("update.drop", msg=dict(
trigger=msg, reason="rawhide"))
if is_monitored:
self.publish("update.drop", msg=dict(
trigger=msg, reason="rawhide"))
return

self.log.info("Comparing upstream %s against repo %s-%s" % (
Expand All @@ -249,6 +246,11 @@ def _handle_anitya_update(self, upstream, package, msg):
self.log.info("OK, %s is newer than %s-%s" % (
upstream, version, release))

if not is_monitored:
self.log.info("Pkgdb says not to monitor %r. Dropping." % package)
self.publish("update.drop", msg=dict(trigger=msg, reason="pkgdb"))
return

bz = self.bugzilla.handle(
projectid, package, upstream, version, release, url)
if not bz:
Expand Down Expand Up @@ -284,27 +286,27 @@ def _handle_anitya_update(self, upstream, package, msg):
else:
self.new_triggered_task_ids[task_id] = [bz, None, str(upstream), str(package)]
else:
note = 'Patching or scratch build for %s and version %s FAILED.\n' \
'See for details' % (package, version)
note = 'Patching or scratch build for %s-%s failed.\n' % (package, version)
self.bugzilla.follow_up(note, bz)
if 'logs' in rh_stuff['build_logs']:
for log in six.iteritems(rh_stuff['build_logs']['logs']):
for log in rh_stuff['build_logs']['logs']:
note = 'Build log %s.' % log
self.bugzilla.attach_patch(log, note, bz)
# Attach rebase-helper logs for another analysis
if 'logs' in rh_stuff:
for log in rh_stuff['logs']:
rebase_helper_url = 'https://github.com/phracek/rebase-helper/issues'
note_logs = 'Rebase-helper %s log file.\n' \
' See for details and report the eventual error to rebase-helper %s.' % \
'See for details and report the eventual error to rebase-helper %s.' % \
(os.path.basename(log), rebase_helper_url)
self.bugzilla.attach_patch(log, note_logs, bz)

if 'patches' in rh_stuff:
for patch in rh_stuff['patches']:
self.bugzilla.follow_up(patch, bz)
os.chdir(cwd)
shutil.rmtree(tmp)
if os.path.exists(tmp):
shutil.rmtree(tmp)

except Exception as ex:
self.log.info('Customer.py: Rebase helper failed with an unknown reason. %s' % str(ex))
Expand All @@ -318,16 +320,20 @@ def _handle_anitya_update(self, upstream, package, msg):
for log in rh_stuff['logs']:
rh_logs = "Log %s provided by rebase-helper." % log
self.bugzilla.attach_patch(log, rh_logs, bz)

os.chdir(cwd)
shutil.rmtree(tmp)

if os.path.exists(tmp):
shutil.rmtree(tmp)

self.log.info("Now with #%i, time to do koji stuff" % bz.bug_id)
try:
# Kick off a scratch build..
task_id, patch_filename, description = self.buildsys.handle(
package, upstream, version, bz)

# Map that koji task_id to the bz ticket we want to pursue.
self.new_triggered_task_ids[task_id] = [bz, None]
self.new_triggered_task_ids[task_id] = [bz, None, str(upstream), str(package)]
# Attach the patch to the ticket
self.bugzilla.attach_patch(patch_filename, description, bz)
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='the-new-hotness',
version='0.7.2',
version='0.7.3',
description='Consume anitya fedmsg messages to file bugzilla bugs',
license='LGPLv2+',
author='Ralph Bean',
Expand Down
5 changes: 4 additions & 1 deletion the-new-hotness.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
%global modname the-new-hotness

Name: the-new-hotness
Version: 0.7.2
Version: 0.7.3
Release: 1%{?dist}
Summary: Consume anitya fedmsg messages to file bugzilla bugs

Expand Down Expand Up @@ -61,6 +61,9 @@ rm -rf %{buildroot}%{python2_sitelib}/tests/
%{python2_sitelib}/the_new_hotness-%{version}*

%changelog
* Wed Apr 06 2016 Ralph Bean <rbean@redhat.com> - 0.7.3-1
- new version

* Tue Mar 08 2016 Ralph Bean <rbean@redhat.com> - 0.7.2-1
- new version

Expand Down

0 comments on commit 8592f57

Please sign in to comment.