Bug 909480

Summary: Automatically create "cloned" bugs in "Layered Product Common for RHEL 6"
Product: [Fedora] Fedora Reporter: Debi Rieden <drieden>
Component: python-bugzillaAssignee: Will Woods <wwoods>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: bugs.michael, crobinso, dzickus, jpokorny, jskarvad, mcermak, mpetlan, pschiffe, snagar, wwoods
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-15 05:03:17 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:
Embargoed:
Attachments:
Description Flags
proposed patch none

Description Debi Rieden 2013-02-08 21:34:46 UTC
I have a need, not sure if it is possible.  If you can do this, it would really cut down on mistakes and eliminate bugs not being created for issues found.

Question: 

We are starting up the Layered Product Common project and have a specific need for cloning bugs.

Question:
Is there a way to automatically create a bug (clone) based on an existing bug?
The cloning would be done without human intervention.

For example:
- A bug is filed for a product, say OpenStack [1].
- The component to be fixed lives in the LayeredProductCommon 
  (but you don't need to know this), 
- so a bug is cloned to track the fix in the LPC [2] "Red Hat Layered Product Common for RHEL 6".

Right now we are manually cloning the OpenStack bug to the "Layered Product Common for RHEL 6".
Is there a way to have this cloned automatically?

What we would need is the following (this is one example, there are other components and eventually many more products and components):
1. When a bug is filed for OpenStack, for component "python-greenlet"
2. Create a clone of this bug in "Layered Product Common for RHEL 6", 
   - same component "python-greenlet".
   - "Layered Product" list would have "OpenStack" selected

Longterm, I would provide the list of products and components. When a bug is filed for the product and component, it is automatically cloned.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=901584
[2] https://bugzilla.redhat.com/show_bug.cgi?id=902308

Please let me know if this is possible and what I need to do.

Comment 1 Simon Green 2013-04-15 05:03:17 UTC
(In reply to comment #0)
> I have a need, not sure if it is possible.  If you can do this, it would
> really cut down on mistakes and eliminate bugs not being created for issues
> found.
> 
> Question:
> Is there a way to automatically create a bug (clone) based on an existing
> bug?
> The cloning would be done without human intervention.
> 
> Please let me know if this is possible and what I need to do.

This is not possible in Red Hat Bugzilla. It would be my recommendation that you create a script that gets newly created bugs, and 'clones' them[1]. Both of these things can be done via RPC calls to Red Hat Bugzilla.

  -- simon

[1] By 'clone', I mean create a new bug.

Comment 2 Martin Cermak 2013-11-15 07:54:23 UTC
I recently attempted to put the bug cloning functionality into bugzilla or at least into python-bugzilla package:

https://bugzilla.redhat.com/show_bug.cgi?id=923436
https://bugzilla.mozilla.org/show_bug.cgi?id=860623

I have a patch in hand for this.

Comment 3 Simon Green 2013-11-15 11:03:31 UTC
Upstream don't want it, and I don't want it in our Bugzilla for the same reason. I'm reassigning this bug to python-bugzilla. Feel free to attach the patch to this bug, as see if they will pick it up.

Comment 4 Cole Robinson 2013-11-16 20:55:28 UTC
I'm not really interested in maintaining this in python-bugzilla either, since it sounds like a maintenance nightmare since clone behavior may change across bugzilla versions. I'd recommend just publishing a 'clone' script built around python-bugzilla and point interested users at that.

Comment 5 Martin Cermak 2013-11-18 11:29:20 UTC
This way the maintenance nightmare moves from {python-,}bugzilla to user scripts. But that it life ;-) Understood. Thanks.

Comment 6 Martin Cermak 2013-11-21 08:49:23 UTC
Created attachment 827050 [details]
proposed patch

Since I was privately asked for the patch, I'm attaching it here. 

On 19 March, 2013 the patch was rebased against upstream source
(git clone git://git.fedorahosted.org/git/python-bugzilla.git)
and internal tests 'python setup.py test' and 'python setup.py pylint'
didn't regress.