Bug 1309944 - [RFE] Create/update composite content-view by content-view Names
[RFE] Create/update composite content-view by content-view Names
Status: ON_QA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Hammer - Content (Show other bugs)
x86_64 Linux
unspecified Severity medium (vote)
: GA
: --
Assigned To: Andrew Kofink
Peter Ondrejka
: FutureFeature, Triaged
Depends On:
Blocks: 1167688
  Show dependency treegraph
Reported: 2016-02-18 23:01 EST by Amar Huchchanavar
Modified: 2017-09-15 02:17 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 14604 None None None 2016-04-26 13:05 EDT

  None (edit)
Comment 2 Andrew Kofink 2016-03-07 16:15:23 EST
Katello::content_view names are unique to an organization, so we should be able to use find_by(name: ['name1', 'name2']).
Comment 3 Andrew Kofink 2016-03-07 16:40:35 EST
Also, in order to add a content view to a composite view you must first publish an initial version of the content view. Right now, if finding components by ID, if you give hammer 4 IDs and only 3 are found, nothing happens. The same will be true of arrays that contain content_view names that are yet unpublished or do not exist.
Comment 4 Andrew Kofink 2016-03-08 10:56:24 EST
Finding ContentViewVersion (CVV) objects by ContentView (CV) names may return multiple CVV objects. Should I make all CVVs a component of the parent CV, or should I add only the latest CVVs based on latest major.minor version number?
Comment 5 Andrew Kofink 2016-03-16 10:24:21 EDT
In order to get the latest CVV for a CV, this feature needs to be implemented as well: https://bugzilla.redhat.com/show_bug.cgi?id=1167688
Comment 7 Andrew Kofink 2016-04-13 08:05:25 EDT
Created redmine issue http://projects.theforeman.org/issues/14604 from this bug
Comment 8 Andrew Kofink 2016-05-02 08:29:51 EDT
CLI users can add a version to a composite with content view name, minor, and major options (e.g. `hammer content-view add-version --id 1 --component-content-view blah --component-major-version 1 --component-minor-version 2`)

Feedback on the PR states that this feature should not be implemented.
Comment 9 David Davis 2016-05-04 16:59:16 EDT

The parameters you mention should be there but they're not which means there is still a bug here. I would probably either fix as part of this bugzilla or open a new bugzilla.
Comment 10 David Davis 2016-05-04 17:02:06 EDT
By the way, sorry if there was any confusion in my PR feedback.
Comment 14 Andrew Kofink 2016-06-28 09:56:13 EDT
Final syntax:

hammer content-view add-version --id 2 --content-view-version 1.0 --content-view-version-content-view-id 3
hammer content-view remove-version --id 2 --content-view-version 1.0 --content-view-version-content-view-id 3
Comment 18 Peter Ondrejka 2016-10-19 08:59:18 EDT
Attempting to create a CCV on Satellite 6.3 snap 5:

# hammer content-view list

5               | testview    | testview  |           | 2016/10/18 14:36:24 | 4, 2, 3       
3               | foo         | foo       |           | 2016/10/18 14:04:46 | 

When trying to create a composite with names (tried various versions with quotes for names, equal sign, etc.):

# hammer content-view create --name testcomposite --component-ids foo,testview --composite --organization-id 1
Could not create the content view:
  Couldn't find Katello::ContentViewVersion with 'id'=0

# hammer content-view create --name testcomposite --component-ids 5,3 --composite --organization-id 1
Content view created

Also, note that the change in functionality should be reflected in hammer help that currently reads:

 --component-ids COMPONENT_IDS           List of component content view version ids for composite views
                                         Comma separated list of values.

We should mention that component names can be used as well, maybe even change the option name that is strongly suggestive of IDs.
Comment 19 Bryan Kearney 2016-10-19 10:17:21 EDT
Upstream bug component is Hammer - Content

Note You need to log in before you can comment on or make changes to this bug.