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] OMRSRepositoryContentManager returns InstanceType with null validInstanceStatusList #6051

Closed
1 task done
keytiong opened this issue Dec 23, 2021 · 3 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working no-issue-activity Issues automatically marked as stale because they have not had recent activity.

Comments

@keytiong
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

OMRSRepositoryContentManager.getInstanceType() always returns an InstanceType with null validInstanceStatusList.

Expected Behavior

OMRSRepositoryContentManager.getInstanceType() should return an InstanceType with the same validInstanceStatusList as the corresponding TypeDef .

Steps To Reproduce

  1. Create an instance of OMRSRepositoryContentManager
  2. Initialize the OMRSRepositoryContentManager with OpenMetadata type defs
  3. Invoke OMRSRepositoryContentManager.getInstanceType() with any type def name
  4. The InstanceType returned always has null validInstanceStatusList

Environment

- Egeria: 3.3
- OS: Ubuntu 20.04
- Java: 11.0.3
- Browser (for UI issues): N/A
- Additional connectors and integration:

Any Further Information?

The implementation omitted InstanceType.setValidInstanceTypeList() when creating an InstanceType from TypeDef OMRSRepositoryContentManager.getInstanceType()

File: OMRSRepositoryContentManager.java

public InstanceType getInstanceType() {

     ...
      instanceType = new InstanceType();

      instanceType.setTypeDefCategory(category);
      instanceType.setTypeDefGUID(typeDef.getGUID());
      instanceType.setTypeDefName(typeDef.getName());
      instanceType.setTypeDefVersion(typeDef.getVersion());
      instanceType.setTypeDefDescription(typeDef.getDescription());
      instanceType.setTypeDefDescriptionGUID(typeDef.getDescriptionGUID());
      instanceType.setTypeDefSuperTypes(this.getSuperTypes(sourceName, typeName, methodName));
      instanceType.setValidStatusList(typeDef.getValidInstanceStatusList()); // <-- valild status list was missed out
     ...
}
@keytiong keytiong added bug Something isn't working triage New bug/issue which needs checking & assigning labels Dec 23, 2021
@davidradl
Copy link
Member

Hi @keytiong are you willing to contribute your suggested change and a unit test along the lines of your suggested recreation steps. I can review and merge for you. One thought - maybe only issue the setValidStatusList if typeDef.getValidInstanceStatusList() is not null.

@davidradl davidradl removed the triage New bug/issue which needs checking & assigning label Jan 7, 2022
keytiong added a commit to keytiong/egeria that referenced this issue Jan 11, 2022
@keytiong
Copy link
Contributor Author

@davidradl , I've raised a pull request to fix this bug. Please review.

keytiong added a commit to keytiong/egeria that referenced this issue Jan 12, 2022
Signed-off-by: Key Tiong Tan <[email protected]>
keytiong added a commit to keytiong/egeria that referenced this issue Jan 14, 2022
Signed-off-by: Key Tiong Tan <[email protected]>
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 20 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the no-issue-activity Issues automatically marked as stale because they have not had recent activity. label Mar 27, 2022
keytiong added a commit to keytiong/egeria that referenced this issue Apr 10, 2022
keytiong added a commit to keytiong/egeria that referenced this issue Apr 10, 2022
Signed-off-by: Key Tiong Tan <[email protected]>
keytiong added a commit to keytiong/egeria that referenced this issue Apr 10, 2022
Signed-off-by: Key Tiong Tan <[email protected]>
mandy-chessell added a commit that referenced this issue Apr 10, 2022
#6051 Fix null validInstanceStatusList when getting InstanceType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-issue-activity Issues automatically marked as stale because they have not had recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants