Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Using the generic handlers, it is possible to create an asset using an qualifiedName that already exists #7234

Closed
davidradl opened this issue Dec 7, 2022 · 1 comment
Labels
bug Something isn't working triage New bug/issue which needs checking & assigning

Comments

@davidradl
Copy link
Member

Existing/related issue?

No response

Current Behavior

I create a glossary with qualified name "aaaa" and then create an asset using asset manager with the same qualified name.
It does not fail . The code gets the existing Entities to check using

 List<EntityDetail> existingEntities = this.getEntitiesByValue(localServerUserId,
                                                                      uniqueParameterValue,
                                                                      uniqueParameterName,
                                                                      entityTypeGUID,
                                                                      entityTypeName,
                                                                      propertyNames,
                                                                      true,
                                                                      null,
                                                                      OpenMetadataAPIMapper.MEMENTO_CLASSIFICATION_TYPE_NAME,
                                                                      false,
                                                                      false,
                                                                      supportedZones,
                                                                      null,
                                                                      0,
                                                                      invalidParameterHandler.getMaxPagingSize(),
                                                                      effectiveTime,
                                                                      methodName);

Screenshot 2022-12-07 at 16 05 55

So the code will only find an existing entity if the type is the same. I though qualified names were supposed to be unique across entities not within a type.

Expected Behavior

I would expect the generic handler check for existing entity of the same qualified Name of a different type to stop the creation of a subsequent entity.

Steps To Reproduce

create a glossary with qualified name aaa. Then using the asset manager OMAS to create a new asset , it will incorrectly create.

Environment

- Egeria:
- OS:
- Java:
- Browser (for UI issues):
- Additional connectors and integration:

Any Further Information?

I suspect that the checking of the unique attribute should be in the scope of the type in which it is defined. For example qualifiedName should check all referenceables and not the sub type.

@davidradl davidradl added bug Something isn't working triage New bug/issue which needs checking & assigning labels Dec 7, 2022
@davidradl davidradl changed the title [BUG] Using asset manager OMAS it is possible to create an asset using an qualifiedName [BUG] Using asset manager OMAS it is possible to create an asset using an qualifiedName that already exists Dec 7, 2022
@mandy-chessell
Copy link
Contributor

mandy-chessell commented Dec 7, 2022

This is not a specific Asset Manager OMAS issue - it is common to most OMASs that use the generic handlers. Currently the design is that the qualified name is unique within the element's type. This issue proposes to change the design to expect uniqueness across the common super-type - ie Referenceable.

I think it is a good suggestion to change the design here, however, because it may be easier when we are querying relationships that return any common referenceable.

This is a break in backward compatilbility. Changing the design may cause some existing use cases to fail. So when you make this change make sure that you add information to the release notes.

@davidradl davidradl changed the title [BUG] Using asset manager OMAS it is possible to create an asset using an qualifiedName that already exists [BUG] Using the generic handlers, it is possible to create an asset using an qualifiedName that already exists Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage New bug/issue which needs checking & assigning
Projects
None yet
Development

No branches or pull requests

2 participants