Bug 1219585

Summary: [RFE] Need way to promote latest version of Content View to next environment via hammer
Product: Red Hat Satellite Reporter: Mike McCune <mmccune>
Component: Content ViewsAssignee: Dustin Tsang <dtsang>
Status: CLOSED ERRATA QA Contact: Jameer Pathan <jpathan>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bbuckingham, bkearney, cwelton
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/10623
Whiteboard: FAILEDQA in Upstream
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 09:15:28 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:

Description Mike McCune 2015-05-07 17:35:34 UTC
Currently you must use the version ID of a Content View to promote to the next environment:

hammer content-view version promote --organization Engineering --content-view-id 5 --to-lifecycle-environment DEV --id 59

This makes automation hard if you wish to 'auto promote' after a publish as you are forced to query version IDs to fill out the --id param above.

Ideally we would not require the specification of the version and it would just take the latest and you could promote via:

hammer content-view version promote --organization Engineering --content-view-id 5 --to-lifecycle-environment DEV 

if we required specification of the prior you could do:

hammer content-view version promote --organization Engineering --content-view-id 5 --to-lifecycle-environment DEV --from-lifecycle-environment Library

Comment 1 RHEL Program Management 2015-05-07 17:52:36 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Mike McCune 2015-05-07 17:59:20 UTC
actually the above first command does work only when you have one version in the prior, but if you have 2 or more versions the promote fails with:

# hammer content-view version promote --organization Engineering --content-view-id 5 --to-lifecycle-environment DEV
Could not promote the content view:
  Error: content_view_version found more than once

Comment 4 Dustin Tsang 2015-05-27 05:33:04 UTC
Created redmine issue http://projects.theforeman.org/issues/10623 from this bug

Comment 6 Bryan Kearney 2015-07-13 06:04:23 UTC
Upstream bug assigned to dtsang

Comment 7 Bryan Kearney 2015-08-14 17:01:37 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/10623 has been closed
-------------
dustin tsang
Applied in changeset commit:hammer-cli-katello|35cbd6fd566b7d13faaa7eb2dd0158a13128f10b.

Comment 8 Tazim Kolhar 2015-10-15 13:27:21 UTC
 *** This bug is failing in upstream ****.

FAILEDQA:
# rpm -qa | grep foreman
nec-em17.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
foreman-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.3-4.el7.noarch
nec-em17.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
tfm-rubygem-hammer_cli_foreman-0.4.0-1.201510071112git33fd59b.el7.noarch
foreman-debug-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
foreman-release-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
foreman-postgresql-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
foreman-vmware-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
tfm-rubygem-foreman_hooks-0.3.9-1.el7.noarch
tfm-rubygem-foreman-tasks-0.7.6-1.fm1_10.el7.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.8-1.el7.noarch
tfm-rubygem-foreman_bootdisk-6.0.0-2.fm1_10.el7.noarch
foreman-release-scl-1-1.el7.x86_64
foreman-libvirt-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
foreman-selinux-1.11.0-0.develop.201510071426git6234447.el7.noarch
foreman-ovirt-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3-3.el7.noarch
tfm-rubygem-foreman_gutterball-0.0.1-3.el7.noarch
nec-em17.rhts.eng.bos.redhat.com-foreman-proxy-1.0-2.noarch
tfm-rubygem-foreman_discovery-4.1.0-1.fm1_10.el7.noarch
tfm-rubygem-foreman_docker-1.4.1-2.fm1_10.el7.noarch
foreman-proxy-1.11.0-0.develop.201510120849git5f36f2e.el7.noarch
foreman-compute-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch
foreman-gce-1.11.0-0.develop.201510121538gitb6b977a.el7.noarch

steps:

if you have 2 or more versions the promote fails with:
# hammer content-view version promote --organization-id 1 --content-view-id 2 --to-lifecycle-environment DEV
[Foreman] Password for admin: 
Could not promote the content view:
  Error: content_view_version found more than once

Comment 9 Bryan Kearney 2015-10-15 14:02:40 UTC
Upstream bug component is WebUI

Comment 10 Bryan Kearney 2015-10-15 14:02:43 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/10623 has been closed
-------------
dustin tsang
Applied in changeset commit:hammer-cli-katello|35cbd6fd566b7d13faaa7eb2dd0158a13128f10b.

Comment 11 Tazim Kolhar 2015-10-27 12:32:14 UTC
 *** This bug is failing in upstream ****.

FAILEDQA:
# rpm -qa | grep foreman
foreman-proxy-1.11.0-0.develop.201510201341git00875b3.el7.noarch
foreman-selinux-1.11.0-0.develop.201510071426git6234447.el7.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3-3.el7.noarch
tfm-rubygem-foreman_docker-1.4.1-2.fm1_10.el7.noarch
foreman-libvirt-1.11.0-0.develop.201510201422git6eb234a.el7.noarch
foreman-compute-1.11.0-0.develop.201510201422git6eb234a.el7.noarch
foreman-release-scl-1-1.el7.x86_64
foreman-gce-1.11.0-0.develop.201510201422git6eb234a.el7.noarch
foreman-debug-1.11.0-0.develop.201510201422git6eb234a.el7.noarch
tfm-rubygem-foreman_gutterball-0.0.1-3.el7.noarch
hp-sl2x170zg6-01.rhts.eng.bos.redhat.com-foreman-proxy-1.0-2.noarch
tfm-rubygem-foreman_discovery-4.1.1-1.fm1_11.el7.noarch
foreman-vmware-1.11.0-0.develop.201510201422git6eb234a.el7.noarch
tfm-rubygem-foreman_hooks-0.3.9-1.el7.noarch
tfm-rubygem-foreman-tasks-0.7.6-1.fm1_10.el7.noarch
tfm-rubygem-hammer_cli_foreman_tasks-0.0.8-1.el7.noarch
tfm-rubygem-foreman_bootdisk-6.0.0-2.fm1_10.el7.noarch
hp-sl2x170zg6-01.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
hp-sl2x170zg6-01.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
foreman-ovirt-1.11.0-0.develop.201510201422git6eb234a.el7.noarch
foreman-1.11.0-0.develop.201510201422git6eb234a.el7.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.3-4.el7.noarch
foreman-release-1.11.0-0.develop.201510201422git6eb234a.el7.noarch
foreman-postgresql-1.11.0-0.develop.201510201422git6eb234a.el7.noarch
tfm-rubygem-hammer_cli_foreman-0.4.0-1.201510201150gitab068d9.el7.noarch

steps:
if you have 2 or more versions the promote fails with:
#  hammer content-view version promote --organization-id 1 --content-view con_view --to-lifecycle-environment DEV
[Foreman] Password for admin: 
Could not promote the content view:
  Error: content_view_version found more than once

Comment 12 Bryan Kearney 2015-10-27 14:02:13 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/10623 has been closed
-------------
dustin tsang
Applied in changeset commit:hammer-cli-katello|35cbd6fd566b7d13faaa7eb2dd0158a13128f10b.

Comment 14 Tazim Kolhar 2016-03-29 08:29:37 UTC
VERIFIED:
# rpm -qa | grep foreman
tfm-rubygem-hammer_cli_foreman_tasks-0.0.10-2.el7sat.noarch
tfm-rubygem-foreman-tasks-0.7.14.1-1.el7sat.noarch
foreman-libvirt-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman_gutterball-0.0.1-6.el7sat.noarch
foreman-discovery-image-3.0.5-3.el7sat.noarch
foreman-selinux-1.11.0-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman-0.5.1.2-1.el7sat.noarch
foreman-gce-1.11.0.7-1.el7sat.noarch
foreman-debug-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman_theme_satellite-0.1.3-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_bootdisk-0.1.3-4.el7sat.noarch
foreman-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman_bootdisk-6.1.0-1.el7sat.noarch
foreman-postgresql-1.11.0.7-1.el7sat.noarch
amd-ma78gm-01.rhts.eng.bos.redhat.com-foreman-client-1.0-1.noarch
amd-ma78gm-01.rhts.eng.bos.redhat.com-foreman-proxy-1.0-1.noarch
foreman-proxy-1.11.0.2-1.el7sat.noarch
foreman-installer-1.11.0.0-1.el7sat.noarch
foreman-compute-1.11.0.7-1.el7sat.noarch
foreman-ovirt-1.11.0.7-1.el7sat.noarch
tfm-rubygem-foreman-redhat_access-1.0.1-2.el7sat.noarch
tfm-rubygem-foreman_discovery-5.0.0.2-1.el7sat.noarch
foreman-vmware-1.11.0.7-1.el7sat.noarch
foreman-installer-katello-3.0.0.9-1.el7sat.noarch
tfm-rubygem-hammer_cli_foreman_docker-0.0.4-1.el7sat.noarch
tfm-rubygem-foreman_docker-2.0.1.1-1.el7sat.noarch
tfm-rubygem-foreman_hooks-0.3.9-2.el7sat.noarch
amd-ma78gm-01.rhts.eng.bos.redhat.com-foreman-proxy-client-1.0-1.noarch
tfm-rubygem-foreman_remote_execution-0.3.0.2-1.el7sat.noarch
tfm-rubygem-foreman_openscap-0.5.3.2-1.el7sat.noarch




Steps:

1. Content View Create:

# hammer -v -d content-view create --name con_view4 --organization-id 1
Content view created


2. Content View publish

 hammer -v -d content-view publish --name con_view4 --organization-id 1
[..............................................................................................................................................................] [100%]


Content View Promote (First Version)

# hammer -v -d content-view version promote --content-view-id 6 --organization-id 1 --to-lifecycle-environment DEV
[......................................................................] [100%]



3 Content View Promote (Second Version)

# hammer -v -d content-view version promote --content-view-id 6 --organization-id 1 --to-lifecycle-environment TEST --from-lifecycle-environment DEV
[......................................................................] [100%]


Content View Version list

# hammer -v -d content-view version list --organization-id 1
---|-------------------------------|---------|-----------------------
ID | NAME                          | VERSION | LIFECYCLE ENVIRONMENTS
---|-------------------------------|---------|-----------------------
4  | con_view 2.0                  | 2.0     | Library               
7  | con_view4 1.0                 | 1.0     | Library, DEV, TEST    
6  | con_view2 1.0                 | 1.0     | Library               
5  | con_view3 1.0                 | 1.0     | Library, DEV          
3  | con_view1 1.0                 | 1.0     | Library, DEV, TEST    
2  | con_view 1.0                  | 1.0     |                       
1  | Default Organization View 1.0 | 1.0     | Library               
---|-------------------------------|---------|-----------------------

Comment 15 Tazim Kolhar 2016-03-29 08:31:34 UTC
please, In UI too, content view promote latest version of Content View to next environment works as expected

Comment 19 errata-xmlrpc 2016-07-27 09:15:28 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/RHBA-2016:1501