Bug 2138172

Summary: Unable to disable import_only flag in Satellite UI when set on Content Views
Product: Red Hat Satellite Reporter: Sam Wachira <swachira>
Component: Content ViewsAssignee: Samir Jha <sajha>
Status: CLOSED ERRATA QA Contact: Sam Bible <sbible>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.11.4CC: iballou, paji, pcreech, rlavi, sajha, sbible
Target Milestone: 6.14.0Keywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-08 14:18:10 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 Sam Wachira 2022-10-27 13:33:41 UTC
Description of problem:
When the import_only flag is enabled on a Content View, there is no option to disable it in the Satellite UI. 

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

How reproducible:
Fully 

Steps to Reproduce:
1. Navigate to Content -> Content Views
2. Click on 'Create content view', tick the 'Import only' checkbox.
2. Click 'Create content view.

Actual results:
- After the content view is created, view the 'Details' tab and note the toggle button next to 'Import only' is disabled.
- The only way to get around this seems to be deleting the CV and creating again with 'Import only' unchecked.

Expected results:
- Provide option to disable 'Import only' on content views.

Additional info:
- User is trying to disable the import_only option from CVs to test publishing but 'Import only' option in the UI greyed out.
- Disabling import_only can be done using foreman-rake.
~~~
# foreman-rake --tasks | grep katello:set
rake katello:set_content_view_import_only 

# foreman-rake katello:set_content_view_import_only ID=<content view id> VALUE=false
~~~

Comment 1 Brad Buckingham 2022-10-31 13:30:03 UTC
Partha, 

Is this expected behavior?

I thought the import-only is set only as part of the export/import process and not by a user.  If so, should the UI behavior be 'read-only' for the field?

Comment 2 Partha Aji 2022-12-05 15:29:41 UTC
That flag was added probably when we were not auto creating content views, products, repositories where we required the user to create the content view with that flag turned on. No longer necessary.

We should mark the field read-only as you suggest since the auto create will manage that.

Comment 4 Samir Jha 2023-05-31 13:10:29 UTC
Created redmine issue https://projects.theforeman.org/issues/36459 from this bug

Comment 5 Bryan Kearney 2023-06-07 16:02:32 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/36459 has been resolved.

Comment 6 Sam Bible 2023-07-13 19:18:55 UTC
Version-Release number of selected component (if applicable):
6.14- Snap 5

Note: Following some good info from the PR that addresses this issue: https://github.com/Katello/katello/pull/10580

Steps to Reproduce:
1. Create a Content View through the UI
2. Export this CV using `hammer content-export'
3. Move the exported files into `/var/lib/pulp/imports
4. Import the CV into a different Org using `hammer content-import library`

Expected results:
When creating the CV, you do not see either the import only or generated fields, and are able to successfully export and import the CV, seeing those flags set appropriately
(Generated disabled, import only visibly disabled on the UI and set to true)

Actual results:
When creating the CV, you do not see either the import only or generated fields, and are able to successfully export and import the CV, seeing those flags set appropriately
(Generated disabled, import only visibly disabled on the UI and set to true)

Comment 9 errata-xmlrpc 2023-11-08 14:18:10 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 (Important: Satellite 6.14 security and bug fix update), 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-2023:6818