Skip to content
This repository has been archived by the owner on Jan 14, 2021. It is now read-only.

Disable retired components in bugzilla #59

Open
crobinso opened this issue May 31, 2014 · 15 comments · Fixed by #184
Open

Disable retired components in bugzilla #59

crobinso opened this issue May 31, 2014 · 15 comments · Fixed by #184
Labels

Comments

@crobinso
Copy link

This is basically a duplicate of a pkgdb RFE I filed last year:

https://fedorahosted.org/packagedb/ticket/240

It would be nice if packagedb would disable bugzilla components when they have been retired in all current fedora releases. This is possible with the bugzilla XMLRPC API.

Basically, in pkgdb-sync-bugzilla.in, where you call server.editcomponents, you need to do

data["is_active"] = bool(component_is_retired_and_blocked_in_all_branches())

(That function doesn't exist so would need to be implemented. And that suggestion was relevant for pkgdb1 but I don't seen any instance of editcomponents in pkgdb2)

The component is then hidden in the BZ web UI component list, but bugs aren't closed, searches can still be done, etc.

An example of why this is useful: we last had a 'kvm' package in fedora 4 years ago, it was retired in favor or merging with the 'qemu' package. but the 'kvm' component exists in bugzilla, and collects misfiled bug reports all the time. yet there's no way in packagedb for me to even add myself to the bug CC list, so it's a huge pain. Not to mention dropping all the actual retired components from bugzilla will hopefully speed up filing new reports, changing component of existing bug, etc.

(originally filed for pkgdb2 at https://fedorahosted.org/pkgdb2/ticket/1 but i'd prefer to track it here)

@crobinso
Copy link
Author

crobinso commented Apr 1, 2015

Any progress on this? The Fedora 'component' list in bugzilla is still filled with long retired components

@pypingou
Copy link
Member

pypingou commented Apr 1, 2015

None other than the subject came up again recently: https://lists.fedoraproject.org/pipermail/infrastructure/2015-March/015830.html

@crobinso
Copy link
Author

This was marked fixed by #184 ... but I still can't tell what the expected workflow here is? Is pkgdb going to do this automatically, or is it now just easier to query to API for a list and someone still needs to manually request the components to be disabled? If the latter, that's fine, I just can't tell the current state.

Also in #184 the cover letter says:

'This should fix #59 for now as there is currently no way to call bugzilla's API to do it automatically.'

The 'do it' here is a bit unclear, but if you mean 'disable a component' it definitely is supported via bugzilla's XMLRPC interface as I mentioned in the initial comment here. I verified it is still working. However it requires 'editcomponent' bugzilla access so it won't work for tests as your regular user.

Here's some example code that toggles the visibilty of product=Fedora component=kvm on partner-bugzilla. The _proxy.Product.get workaround isn't strictly required, it just saves some query time.

import bugzilla

bzapi = bugzilla.Bugzilla("partner-bugzilla.redhat.com")

print "Getting fedora components..."
fedoraprod = bzapi._proxy.Product.get({
    "names": ["Fedora"],
    "include_fields": ["name", "id", "components.name",
                       "components.is_active"],
})
kvmcomponent = [c for c in fedoraprod["products"][0]["components"] if
                c["name"] == "kvm"][0]

results = bzapi.editcomponent({
    "product": "Fedora",
    "component": "kvm",
    "is_active": not kvmcomponent["is_active"],
})

print "editcomponent returned: %s" % results

When run with appropriate privs, it looks like:

$ python test.py
Getting fedora components...
editcomponent returned: {'components_updates': {'20967': {'isactive': [1, 0]}}}
$ python test.py
Getting fedora components...
editcomponent returned: {'components_updates': {'20967': {'isactive': [0, 1]}}}

@pypingou
Copy link
Member

Is pkgdb going to do this automatically, or is it now just easier to query to API for a list and someone still needs to manually request the components to be disabled?

It is the later case yes. If we get a script to do it automatically, we could run it as a cron in the Fedora infrastructure, but pkgdb itself won't do it.

Cool if it can be done by the API, from the discussion on the list I had understood the opposite.

@crobinso
Copy link
Author

It is the later case yes. If we get a script to do it automatically, we could run it as a cron in the Fedora infrastructure, but pkgdb itself won't do it.

Why though? I see utility/pkgdb-sync-bugzilla already handles editing existing components CC list etc, seems the natural place to extend things to disable retired components as well. Maybe that's what you meant by 'pkgdb itself won't do it' since it's a separate script, but it's still in this git repo...

@pypingou
Copy link
Member

Yes, I'm fine with shipping the cron script in pkgdb2's sources, when I said pkgdb itself won't do it I meant pkgdb will not call bugzilla to retire a component there if it has been retired in pkgdb.

But doing it via a cron job and shipping in withing pkgdb2 utility folder, big 👍 for me :)

@crobinso
Copy link
Author

gotchya, thanks. can we reopen this bug then to track the utility/pkgdb-sync-bugzilla change?

@pypingou pypingou reopened this May 26, 2015
@pypingou
Copy link
Member

Would you like to work on it?

@crobinso
Copy link
Author

I plan on coming up with a script to do this manually with the new pkgdb APIs, hopefully by end of the week. When that's done I'll comment here

@pypingou
Copy link
Member

Cool, thanks!

@pypingou
Copy link
Member

Still working on this? May I help with something?

@crobinso
Copy link
Author

Sorry this is a spare time thing that I was hoping to get to before I moved across the state... that didn't happen and now I'm swamped with other stuff :/ So I don't expect to get back to this for at least a few weeks

@crobinso
Copy link
Author

crobinso commented Sep 4, 2015

Okay I just took a look at this, sorry it took so long. I pushed a commit to my pkgdb2 fork that should adjust the pkgdb-sync-bugzilla to update component active state depending on if the package is retired: crobinso@8a3c5d9

Note that actual commit is untested since I don't have an environment to run the script, but I tested the broad strokes in a manual script.

A few things I realized:

  • We can't do this in a one-off script and send the request to bugzilla admins... reason is that the pkgdb script currently has zero knowledge about changing the active status of an existing component, so if I request the bugzilla admins disable retired package FOO, but then it is unretired, nothing will automatically re-enable that component and it won't show up in bugzilla. So this has to be done as part of the pkgdb sync script AFAICT
  • The new pkgdb API will tell us if a package is retired on all current branches per collection... but I don't know if that's a sufficient indicator if the component should be disabled. For example if I orphan virt-manager in f21+ right now, the package is still going to be shipped for the lifetime of f21 and f22, correct? So the bugzilla component should probably not be disabled until the package is no longer shipped in any released version. But I don't know if/how we can programmatically detect that.
  • The other question is what do we do if a component we want to disable has open bugs... do we care? If we solve the issue mentioned above, it probably won't matter, since all bugs should be cleaned up by the fedora EOL scripts, but it's worth considering at least.

@pypingou
Copy link
Member

pypingou commented Sep 6, 2015

 * The new pkgdb API will tell us if a package is retired on all current
   branches per collection... but I don't know if that's a sufficient
   indicator if the component should be disabled. For example if I orphan
   virt-manager in f21+ right now, the package is still going to be
   shipped for the lifetime of f21 and f22, correct? So the bugzilla
   component should probably not be disabled until the package is no
   longer shipped in any released version. But I don't know if/how we can
   programmatically detect that.

Regarding this, I kinda think we should already disable reporting bugs. The
problem being that if the package is orphaned, nobody takes care of it. So what
would be the point of letting users report bugs on something that's not
maintained. It could even give a bad impression of Fedora as the bugs are left
untouched, w/o response.

Maybe we can ask @tyll what he thinks of this.

@tyll
Copy link
Contributor

tyll commented Sep 7, 2015

I guess it will be more confusing for users if there is no obvious way to report a bug in an orphaned package. Also packages might be unorphaned. Ideally I would prefer a solution that would add a explanatory message to every bug report that is opened for an orphaned package and disable bug reporting only if all active Fedora branches are retired. But this might be something that FESCo might decide, since it is a major change.

@ralphbean ralphbean added the hard label Jan 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants