Bug 1531512 - Catalog Items : Duplicate catalog Items can be created
Summary: Catalog Items : Duplicate catalog Items can be created
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate
Version: 5.9.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: GA
: cfme-future
Assignee: drew uhlmann
QA Contact: Sudhir Mallamprabhakara
Red Hat CloudForms Documentation
URL:
Whiteboard: service:catalog
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-01-05 12:03 UTC by nzayats
Modified: 2019-12-11 15:01 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1313510
Environment:
Last Closed: 2019-12-09 20:35:08 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description nzayats 2018-01-05 12:03:03 UTC
Description of problem:
Duplicate catalog Items can be created

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

How reproducible:
100%

Steps to Reproduce:
1.Two catalog items with the same name can be created under one catalog.

Actual results:
Two catalog items with the same name can be created under one catalog.

Expected results:
An error message that catalog item with that name is already created.

Additional info:

Comment 3 Niyaz Akhtar Ansari 2018-12-14 12:01:06 UTC
I can reproduced it on 5.10 as well

Comment 8 Greg McCullough 2019-08-12 18:02:43 UTC
Agree that PM should comment on this, but in my opinion Catalog Items and Bundles look the same to the end-user that is ordering from the Catalog.  This is by design as the difference is an internal detail.  Therefore I would recommend that Catalog names be unique across all items regardless of the type.

Comment 9 Loic Avenel 2019-08-13 06:57:22 UTC
Agreed, we should not allow to have 2 Services (Catalog Item and bundle) with the same name.

Comment 10 Hilda Stastna 2019-08-13 09:07:10 UTC
Fixes https://github.com/ManageIQ/manageiq/pull/19142

Comment 15 Milan Zázrivec 2019-09-20 10:52:03 UTC
Name uniqueness validation on UI level? I don't think so.

If this is really is a product requirement, then the validation needs
to be done on a database / active record level (with all that it takes),
just like it is done everywhere else and the bz needs to be routed
appropriately.

But validation on the level of ui / api controller -- that's not going
to happen.

Comment 16 Loic Avenel 2019-09-21 11:17:52 UTC
(In reply to Milan Zázrivec from comment #15)
> Name uniqueness validation on UI level? I don't think so.
> 
> If this is really is a product requirement, then the validation needs
> to be done on a database / active record level (with all that it takes),
> just like it is done everywhere else and the bz needs to be routed
> appropriately.
> 
> But validation on the level of ui / api controller -- that's not going
> to happen.

I am not directing the solution here, the requirement is: as a user, I cannot create catalog Item with the same name.

Comment 17 Martin Povolny 2019-09-23 08:48:08 UTC
Right. This needs to be fixed and it's not really the reporter's problem if the fix is to be done in the model or in the controller.

So, please, fix this by adding the validation in the model or move this BZ to someone from the core/backend groupd who will do it.

Regads.

Comment 18 Martin Povolny 2019-09-23 09:14:33 UTC
Ok, so looking further into https://github.com/ManageIQ/manageiq/pull/19142 and the discussion here.

We have a problem with core -- missing validation.

There's a solution proposal: https://github.com/ManageIQ/manageiq/pull/19142

The solution is not liked by the core (due to a missing migration).

Adding a migration is not liked by the product management (does not want to migrate data = rename items).

From the UI perspective, we are done here.

Now the core team need to work with product management and figure what to do.

Comment 19 Tina Fitzgerald 2019-09-23 14:25:44 UTC
This needs further discussion before it's actionable.

I'll report back here once we have a way forward.

Comment 20 Jason Frey 2019-10-02 17:39:15 UTC
The way uniqueness validations work, if we don't have a migration fixing the existing records, then functionality like modifying an existing record will fail.  That is, a user (or even the backend code itself) that needs to modify the record will never be able to moving forward, because when the record tries to be saved it will fail the uniqueness validation.  This includes even something as simple as updating a status or a timestamp or anything on the record.  This is part of the framework and not something we can change or get around.

This means that the only 2 choices are a) no uniqueness or b) uniqueness + a migration to "fix" duplicate records.  Loic's choice of uniqueness but without modifying any existing records is not possible.

I assume we want uniqueness based on the discussion above, so that implies we must have a migration for the existing records.

Comment 21 drew uhlmann 2019-11-14 11:47:29 UTC
Moving back to assigned cause with the questions about visibility re:rbac and how we can't enforce uniqueness outside of a specific region, GM and Tina didn't sound terrible sure what to do with this and thus I'm not actively working on it.

Comment 22 Tina Fitzgerald 2019-12-09 20:33:36 UTC
Hi Drew,

Based on https://github.com/ManageIQ/manageiq/pull/19142#issuecomment-562610734, I think we can close this ticket.

Thanks,
Tina


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