Katello 2.3 - Content View filter issue

I'm having an issue when creating filters on a content view.

When creating a filter on a content view, it is shown on all others content
views.

This seems to be only a display issue as when I publish the content views,
the filter is not applied on the other content views.
It is only shown in the GUI.

I am able to reproduce it from the Web interface and also from the command
line.

Here are the steps to reproduce it:

  1. Create two content views: test1-cv and test2-cv

    hammer content-view create --name='test1-cv' --organization=glopglop
    hammer content-view create --name='test2-cv' --organization=glopglop

  2. Assign some repositories to the created content views

    hammer content-view add-repository --name='test1-cv'
    –organization=glopglop --repository-id=1
    hammer content-view add-repository --name='test2-cv'
    –organization=glopglop --repository-id=1

  3. Create a filter on one content view: test1-cv

    hammer content-view filter create --organization=glopglop
    –content-view='test1-cv' --type=rpm --name="Exclude packages"
    –inclusion=false

  4. List filters on CV test1-cv

    hammer content-view filter list --content-view=test1-cv
    –organization=glopglop

----------|------------------|------|----------

FILTER ID NAME TYPE INCLUSION
4 Exclude packages rpm
---------- ------------------ ------ ----------

This shows one filter which is the expected result.

  1. List filters on CV test2-cv

    hammer content-view filter list --content-view-id=2
    –organization=glopglop

----------|------------------|------|----------

FILTER ID NAME TYPE INCLUSION
4 Exclude packages rpm
---------- ------------------ ------ ----------

This does not return an empty list as expected but the filter created on
test1-cv.

  1. The database content seems correct

The KATELLO_CONTENT_VIEW_FILTERS table only contains one row for the
"Exclude packages" filter

foreman=# select * from katello_content_view_filters;
id | content_view_id | name | created_at |
updated_at | type | inclusion |
original_packages | descrip
tion

··· ----+-----------------+------------------+----------------------------+----------------------------+-----------------------------------+-----------+-------------------+-------- ----- 4 | 7 | Exclude packages | 2015-07-30 12:39:32.629458 | 2015-07-30 12:39:32.629458 | Katello::ContentViewPackageFilter | f > f | (1 row)

This makes usage of Content View Filters unusable in Katello 2.3 as all
created filter are shown on all content views but you do not know which one
is really applied.

Seems to be that bug: Bug #11253: All content view filters are shown in every content view - Katello - Foreman

··· On Thursday, July 30, 2015 at 3:05:15 PM UTC+2, Christophe Roux wrote: > > > I'm having an issue when creating filters on a content view. > > When creating a filter on a content view, it is shown on all others > content views. > > This seems to be only a display issue as when I publish the content views, > the filter is not applied on the other content views. > It is only shown in the GUI. > > > I am able to reproduce it from the Web interface and also from the command > line. > > Here are the steps to reproduce it: > > 1) Create two content views: test1-cv and test2-cv > > hammer content-view create --name='test1-cv' --organization=glopglop > hammer content-view create --name='test2-cv' --organization=glopglop > > 2) Assign some repositories to the created content views > > hammer content-view add-repository --name='test1-cv' > --organization=glopglop --repository-id=1 > hammer content-view add-repository --name='test2-cv' > --organization=glopglop --repository-id=1 > > 3) Create a filter on one content view: test1-cv > > hammer content-view filter create --organization=glopglop > --content-view='test1-cv' --type=rpm --name="Exclude packages" > --inclusion=false > > 4) List filters on CV test1-cv > > hammer content-view filter list --content-view=test1-cv > --organization=glopglop > > ----------|------------------|------|---------- > FILTER ID | NAME | TYPE | INCLUSION > ----------|------------------|------|---------- > 4 | Exclude packages | rpm | > ----------|------------------|------|---------- > > This shows one filter which is the expected result. > > 5) List filters on CV test2-cv > > hammer content-view filter list --content-view-id=2 > --organization=glopglop > > ----------|------------------|------|---------- > FILTER ID | NAME | TYPE | INCLUSION > ----------|------------------|------|---------- > 4 | Exclude packages | rpm | > ----------|------------------|------|---------- > > This does not return an empty list as expected but the filter created on > test1-cv. > > > 6) The database content seems correct > > The KATELLO_CONTENT_VIEW_FILTERS table only contains one row for the > "Exclude packages" filter > > foreman=# select * from katello_content_view_filters; > id | content_view_id | name | created_at | > updated_at | type | inclusion | > original_packages | descrip > tion > > ----+-----------------+------------------+----------------------------+----------------------------+-----------------------------------+-----------+-------------------+-------- > ----- > 4 | 7 | Exclude packages | 2015-07-30 12:39:32.629458 | > 2015-07-30 12:39:32.629458 | Katello::ContentViewPackageFilter | f > > f | > (1 row) > > > This makes usage of Content View Filters unusable in Katello 2.3 as all > created filter are shown on all content views but you do not know which one > is really applied. > > > > >