Bug 1002694

Summary: pkgdb-cli orphan --retire toggles retirement state
Product: [Fedora] Fedora Reporter: Till Maas <opensource>
Component: packagedb-cliAssignee: Pierre-YvesChibon <pingou>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: opensource, pingou
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: packagedb-cli-1.6.0-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-18 13:05:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
remove duplicate code in retire codepath
none
Adjustments to make retire work as expected none

Description Till Maas 2013-08-29 17:51:27 UTC
Description of problem:
pkgdb-cli orphan --retire toggles the retirement state instead of ensuring that the package will be retired. This will cause unexpected behaviour if a cvsadmin used "fedpkg retire" on a branch that has been retired in packagedb but does not contain a dead.package file. Please change the command to never unretire a package, e.g. by checking whether a packge is already retired before trying to retire it.

Comment 1 Pierre-YvesChibon 2013-09-05 10:20:11 UTC
This should be fixed in git, I would be most grateful if you could test it :)

Comment 2 Till Maas 2013-09-05 20:22:15 UTC
Created attachment 794498 [details]
remove duplicate code in retire codepath

I applied the attached patch to remove the duplicate code from packagedb that confuses me.

If I understand the code correcty, it checks whether the branch the package should be retired in is in _get_active_branches(packagename, 1). This is the result for easymock3, which is currently retired in f20 (deprecated, statuscode 20) and orphaned in devel (statuscode 14), however "devel" is not in the result but f20 is:

In [1]: _get_active_branches("easymock3", 1)
Out[1]: [u'f18', u'f20', u'f19']

Also the package is approved in f19 (statuscode 3), so the check does not make sense. Instead of spending too much time in debugging/enhancing this, I want to try if it is possible to adapt packagedb to allow to sanely retire packages directly:
https://github.com/fedora-infra/packagedb/issues/12

Comment 3 Pierre-YvesChibon 2013-09-06 05:39:02 UTC
Hi Till,

Thanks for the patch, it's applied and pushed in git.

I see now that I was checking the status of the collection rather than the status of the package. Should be fixed in git now.

>>> _get_active_branches("easymock3", 20)
[u'f18', u'f19', u'devel']

Comment 4 Till Maas 2013-09-07 08:35:52 UTC
Created attachment 795085 [details]
Adjustments to make retire work as expected

With this patch retirement seems to work as expected with the current git.

Comment 5 Fedora Update System 2013-09-07 09:20:15 UTC
packagedb-cli-1.6.0-1.el5 has been submitted as an update for Fedora EPEL 5.
https://admin.fedoraproject.org/updates/packagedb-cli-1.6.0-1.el5

Comment 6 Fedora Update System 2013-09-07 09:20:41 UTC
packagedb-cli-1.6.0-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/packagedb-cli-1.6.0-1.fc19

Comment 7 Fedora Update System 2013-09-07 09:21:03 UTC
packagedb-cli-1.6.0-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/packagedb-cli-1.6.0-1.fc18

Comment 8 Fedora Update System 2013-09-07 09:21:30 UTC
packagedb-cli-1.6.0-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/packagedb-cli-1.6.0-1.fc20

Comment 9 Fedora Update System 2013-09-07 09:21:52 UTC
packagedb-cli-1.6.0-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/packagedb-cli-1.6.0-1.el6

Comment 10 Fedora Update System 2013-09-07 17:04:30 UTC
Package packagedb-cli-1.6.0-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing packagedb-cli-1.6.0-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-16044/packagedb-cli-1.6.0-1.fc20
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2013-09-18 13:05:03 UTC
packagedb-cli-1.6.0-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2013-09-18 13:08:38 UTC
packagedb-cli-1.6.0-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2013-09-22 23:49:09 UTC
packagedb-cli-1.6.0-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2013-11-27 21:19:47 UTC
packagedb-cli-1.6.0-1.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2013-11-27 21:23:37 UTC
packagedb-cli-1.6.0-1.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.