Bug 1400556

Summary: Selected packages stay selected when them adding to a custom channel, and user changes to different channel in the process
Product: Red Hat Satellite 5 Reporter: Radovan Drazny <rdrazny>
Component: WebUIAssignee: Grant Gainey <ggainey>
Status: CLOSED WONTFIX QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 570CC: tlestach
Target Milestone: ---   
Target Release: ---   
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: 2017-05-17 20:24:46 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:

Description Radovan Drazny 2016-12-01 13:35:19 UTC
Description of problem:
When adding packages to a custom channel using the WebUI, the package selection is persistent across the channel changes. See the reproducer for more details.

Version-Release number of selected component (if applicable):
spacewalk-java-2.3.8-155.el6sat

How reproducible:
always

Steps to Reproduce:
1. Have al least two Red Hat channels synced. Can be two base channels, or base and child channels, doesn't matter.
2. Create a new custom channel
3. Go to Manage Software Channels and open the new custom channel  
4. Open the Packages tab, go to Add Packages, select one of Red Hat channels and press View Packages button.
5. List of packages is displayed. Select one or more packages. Number of selected packages is displayed beside the total number of packages in the channel.
6. Switch to another Red Hat channel in the dropdown menu, and press the View Packages button again.
7. New list of packages is displayed, but there is still text indicating that there are packages selected.
8. If you press the Add package(s) button now, there will be a confirmation screen displaying packages to be added to the custom channel. It will contain packages selected in the step 5, even if last displayed channel was the one from steps 6-7. 
9. If you select some packages from the second Red Hat channel (from step 7), they will be added to the selection, and after pressing the Add package(s) button, confirmation screen will contain all selected packages from both Red Hat channels.



Actual results:
Package selection is persistent across channel changes.


Expected results:
Selection should be cleared when source channel changes.

Additional info:
This behaviour can be actually considered to be a feature, but it can be pretty confusing for a user as well. For example if the user selects big base channel with thousands of packages, selects them all, and then switches to a smaller channel. Package number indicator now displays "1 - 25 of 101 (18270 selected)", for example.

Comment 2 Grant Gainey 2017-02-15 20:17:03 UTC
SO, this actually *is* a feature, because it is not atypical for customers to build custom-channel-contents from packages found in multiple channels. The problem is that the 'selected from this list' rhnSet, is being overloaded to be the 'selected from all channels so far' rhnSet.

Will investigate to see if there's a reasonable way to separate the two concerns while retaining the add-to-selection behavior that we need/want here.

Comment 3 Grant Gainey 2017-05-01 18:22:08 UTC
How much work is it worth putting into this? Looks like it's going to require

* changing the checkbox-ajax to talk to a new RhnSet *in addition to* the channel-RhnSet, 
* ability to display information about the new select-to-copy-RhnSet, 
* ability to clear select-to-copy-RhnSet,
* on channel-switch:
  * empty the channel-RhnSet 
  * reset channel-RhnSet to select any packages in the new channel that are already 
    in the select-to-copy-RhnSet (because in addition to handling 'user 
    went back to previous channel', RPMs can also be in multiple channels at once 
    and may therefore already be selected).
* handle the interactions between all of this

We can make this happen, but it's non-trivial. I don't think I'd add this to 5.8.

Comment 4 Grant Gainey 2017-05-09 14:32:33 UTC
Leaving this open but removing from 5.8

Comment 5 Grant Gainey 2017-05-17 20:24:46 UTC
This is a pretty invasive change, for something no customer has asked for. I'm going to close as WONTFIX.