Bug 1614927

Summary: [RFE] Provide the ability to delete a lifecycle environment from the middle of an existing path
Product: Red Hat Satellite Reporter: Jason Dickerson <jdickers>
Component: Lifecycle EnvironmentsAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: vijsingh
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.2CC: bkearney, julian.curetti, vijsingh
Target Milestone: 6.5.0Keywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-05-14 12:37:41 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
6.3 patch none

Description Jason Dickerson 2018-08-10 18:32:12 UTC
1. Proposed title of this feature request  
  
[RFE] Provide the ability to delete a lifecycle environment from the middle of an existing path
  
2. What is the nature and description of the request?  
  
It is currently not possible to remove a lifecycle environment from the beginning or middle of an existing lifecycle environment path.  

For example if the current lifecycle environments (in order) are
Dev -> Test -> Staging -> Prod

and you wish to remove Staging such that the new list (in order) is
Dev -> Test -> Prod

it is not currently possible to achieve this

3. Why does the customer need this? (List the business requirements here) 

The customer supports various distinct environments in their organization.  Some environments needs change over time, and this would allow them to remove lifecycle environments that are deemed no longer necessary, by the different environment stakeholders.  
  
4. How would the customer like to achieve this? (List the functional requirements here)  
  
Make it possible, via the gui and hammer to remove a lifecycle environment from the path, in such a way as the previous environment is now linked instead to the latter environment.

6. For each functional requirement listed, specify how Red Hat and the customer can test to confirm the requirement is successfully implemented.  
  
Try to remove "Staging" as per the example in #2

7. Is there already an existing RFE upstream or in Red Hat Bugzilla?  
  
None found

8. Does the customer have any specific timeline dependencies and which release would they like to target (i.e. RHEL5, RHEL6)?  
  
ASAP

9. Is the sales team involved in this request and do they have any additional input?  
  
No

10. List any affected packages or components.  
  
Satellite 6.3.2
- API
- Hammer
- GUI

11. Would the customer be able to assist in testing this functionality if implemented?  

yes

Comment 2 Justin Sherrill 2018-08-13 13:40:14 UTC
Created redmine issue https://projects.theforeman.org/issues/24596 from this bug

Comment 3 Satellite Program 2018-08-13 14:18:20 UTC
Upstream bug assigned to jsherril

Comment 4 Satellite Program 2018-08-13 14:18:21 UTC
Upstream bug assigned to jsherril

Comment 5 Satellite Program 2018-08-20 14:17:53 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/24596 has been resolved.

Comment 6 Justin Sherrill 2018-09-05 03:15:49 UTC
Created attachment 1480959 [details]
6.3 patch

Comment 7 Justin Sherrill 2018-09-05 03:18:15 UTC
6.3 patch attached, simply apply the patch to your tfm-rubygem-katello installed directory, restart httpd and foreman-tasks and then remove the desired lifecycle environment with hammer.

Current 6.3 blocks UI elements from making this work in the UI and changing UI assets in production with just a patch is not possible currently, so you will have to use hammer.

Comment 10 vijsingh 2018-11-28 06:10:38 UTC
Verified:

@Satellite 6.5.0 Snap 5.0

steps:

+++++++++++++++++++++++++++++++++++++++++
hammer> lifecycle-environment list
---|---------|--------
ID | NAME    | PRIOR  
---|---------|--------
2  | DEV     | Library
1  | Library |        
8  | Prod    | Staging
7  | Staging | Test   
6  | Test    | DEV    
---|---------|--------


hammer> lifecycle-environment paths --organization-id 1
-----------------------------------------
LIFECYCLE PATH                           
-----------------------------------------
Library >> DEV >> Test >> Staging >> Prod
-----------------------------------------


hammer> lifecycle-environment delete --name Staging --organization-id 1
Environment deleted.

hammer> lifecycle-environment paths --organization-id 1 
------------------------------
LIFECYCLE PATH                
------------------------------
Library >> DEV >> Test >> Prod
------------------------------
hammer> 


hammer> lifecycle-environment list
---|---------|--------
ID | NAME    | PRIOR  
---|---------|--------
2  | DEV     | Library
1  | Library |        
8  | Prod    | Test   
6  | Test    | DEV    
---|---------|--------

+++++++++++++++++++++++++++++++++++++++++

Observation:
- Able to delete a lifecycle environment from the middle of an existing path.

Comment 12 Julian Curetti 2019-02-22 19:59:41 UTC
Can I implement this fix on a running Satellite 6.3.5 server?

Comment 14 errata-xmlrpc 2019-05-14 12:37:41 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:1222