Skip to content

Commit

Permalink
log why buildroot overrides are expired
Browse files Browse the repository at this point in the history
This lets us debug BROs unexpectedly getting untagged in Koji easier.

Fixes #3060

Signed-off-by: Nils Philippsen <nils@redhat.com>
(cherry picked from commit 759daf4)
  • Loading branch information
nphilipp authored and mergify-bot committed Mar 26, 2019
1 parent 71b61f3 commit 8068b62
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions bodhi/server/consumers/masher.py
Expand Up @@ -642,6 +642,7 @@ def expire_buildroot_overrides(self):
for build in update.builds:
if build.override:
try:
log.debug(f"Expiring BRO for {build.nvr} because it is being pushed.")
build.override.expire()
except Exception:
log.exception('Problem expiring override')
Expand Down
3 changes: 3 additions & 0 deletions bodhi/server/models.py
Expand Up @@ -2195,6 +2195,7 @@ def edit(cls, request, data):

# Expire any associated buildroot override
if b.override:
log.debug(f"Expiring BRO for {b.nvr} because the build is unpushed.")
b.override.expire()
else:
# Only delete the Build entity if it isn't associated with
Expand Down Expand Up @@ -4459,6 +4460,7 @@ def new(cls, request, **data):
if old_build is not None and old_build.override is not None:
# There already is a buildroot override for an older build of this
# package in this release. Expire it
log.debug(f"Expiring BRO for {old_build.nvr} because it's superseded by {build.nvr}.")
old_build.override.expire()
db.add(old_build.override)

Expand Down Expand Up @@ -4503,6 +4505,7 @@ def edit(cls, request, **data):
override.enable()

elif data['expired']:
log.debug(f"Expiring BRO for {override.build.nvr} because it was edited.")
override.expire()

db.add(override)
Expand Down
1 change: 1 addition & 0 deletions bodhi/server/scripts/expire_overrides.py
Expand Up @@ -75,6 +75,7 @@ def main(argv=sys.argv):
log.info("Expiring %d buildroot overrides...", count)

for override in overrides:
log.debug(f"Expiring BRO for {override.build.nvr} because it's due to expire.")
override.expire()
db.add(override)
log.info("Expired %s" % override.build.nvr)
Expand Down

0 comments on commit 8068b62

Please sign in to comment.