Bug 645432

Summary: Add the ability to delete versions of bundles
Product: [Other] RHQ Project Reporter: dsteigne
Component: ProvisioningAssignee: John Mazzitelli <mazz>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: high    
Version: 3.0.0CC: mazz, rrivera
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-02 07:19:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description dsteigne 2010-10-21 13:44:00 UTC
Description of problem:
Currently you can only delete the entire bundle (all versions), the ability to delete by versions is needed.

Version-Release number of selected component (if applicable):

2.4

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 Ronaldo Rivera 2010-12-07 22:31:31 UTC
Hi,

Is there a workaround for this? Please advise.

Thanks.

Ronaldo

Comment 3 John Mazzitelli 2010-12-13 18:42:22 UTC
going to mark this as ASSIGNED so we take a look at it in our next prioritization meeting.

Comment 4 John Mazzitelli 2010-12-20 15:26:37 UTC
git commit ebbeac6c225768c858efeb2a6c95037e67ef3d72

we can now delete bundle versions. However, I'm concerned that we should have some protections in place that might not be there. For example, if there is 1 or more deployments of the bundle version, I don't think we should be allowed to delete bundle versions. If we ever need to revert back, an error would occur.

So, I'm not sure that this issue can be closed yet. I have to look at it more closely to see if there is more to be done.

Comment 5 John Mazzitelli 2010-12-20 15:37:48 UTC
Here's the code that is relevant to my last comment about deployments - so it looks like we do clean up the DB. However, it means you will be orphaning deployments on the remote agents. for now this is probably good enough. I don't think we want to auto-undeploy these on the agents. We'll have to assume the user will do a full revert if they really don't want the agent machines to have these deployed. We'll have to make sure bug 645412 is also fixed, since that is needed to make sure the agent can be fully cleaned of any bundle deployment.

        // deployments replace other deployments and have a self-referring FK.  The deployments
        // need to be removed in a way that will ensure that a replaced deployment is not removed
        // prior to the replacer.  To do this we'll just blanket update all the doomed deployments
        // to break the FK dependency with nulls.
        Query q = entityManager.createNamedQuery(BundleDeployment.QUERY_UPDATE_FOR_VERSION_REMOVE);
        q.setParameter("bundleVersionId", bundleVersionId);
        int rowsUpdated = q.executeUpdate();
        entityManager.flush();

        // remove the bundle version - cascade remove the deployments which will cascade remove the resource deployments.
        this.entityManager.remove(bundleVersion);

Comment 6 Mike Foley 2011-06-07 13:59:56 UTC
this was verified as part of RHQ 4.0 and 4.0.1 community releases

Comment 7 Heiko W. Rupp 2013-09-02 07:19:37 UTC
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.