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

Various fixes #7054

Merged
merged 17 commits into from
Oct 27, 2022
Merged

Various fixes #7054

merged 17 commits into from
Oct 27, 2022

Conversation

mandy-chessell
Copy link
Contributor

Description

This PR includes various fixes needed to get the new development team open metadata labs working - plus requests for small changes. These are described in the associated issues.

In addition:

  • I have filled out the swagger @operation tag for each REST operation on Asset Consumer OMAS and created a postman collection for this interface.

  • I have coded the backend support to allow the connected access services supporting the OCF to be able to retrieve event and API schemas. I have not tested the Java client-side.

Related Issue(s)

Testing

FVT and the labs

Release Notes & Documentation

Just bug fixes

Additional notes

Signed-off-by: Mandy Chessell <[email protected]>
Signed-off-by: Mandy Chessell <[email protected]>
Signed-off-by: Mandy Chessell <[email protected]>
Signed-off-by: Mandy Chessell <[email protected]>
Signed-off-by: Mandy Chessell <[email protected]>
Signed-off-by: Mandy Chessell <[email protected]>
@mandy-chessell mandy-chessell merged commit 2da0c36 into odpi:main Oct 27, 2022
final String apiOpGUIDParameterName = "apiOperation.getGUID()";
final String schemaTypeGUIDParameterName = "apiParameterList.getGUID()";

Date effectiveTime = new Date();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaUtilDate: Date has a bad API that leads to bugs; prefer java.time.Instant or LocalDate.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

restExceptionHandler.detectAndThrowPropertyServerException(restResult);

List<APIOperationResponse> apiOperations = restResult.getList();
if ((apiOperations == null) || (apiOperations.isEmpty()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UnnecessaryParentheses: These grouping parentheses are unnecessary; it is unlikely the code will be misinterpreted without them


Suggested change
if ((apiOperations == null) || (apiOperations.isEmpty()))
if ((apiOperations == null) || apiOperations.isEmpty())

ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

{
for (Relationship relationship : schemaAttributeRelationships)
{
if (repositoryHelper.isTypeOf(serviceName, relationship.getType().getTypeDefName(), OpenMetadataAPIMapper.FOREIGN_KEY_RELATIONSHIP_TYPE_NAME))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULL_DEREFERENCE: object returned by relationship.getType() could be null and is dereferenced at line 127.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

{
List<EntityDetail> schemaTypeEntities;

if (repositoryHelper.isTypeOf(serviceName, parentEntity.getType().getTypeDefName(), OpenMetadataAPIMapper.API_SCHEMA_TYPE_TYPE_NAME))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULL_DEREFERENCE: object returned by parentEntity.getType() could be null and is dereferenced at line 1393.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]


if (requestAttributeCount > 0)
{
super.headerAttributes = new ConnectedSchemaAttributes(serviceName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 3 similar findings have been found in this PR


ArgumentSelectionDefectChecker: The following arguments may have been swapped: 'maxCacheSize' for formal parameter 'totalElementCount', 'requestAttributeCount' for formal parameter 'maxCacheSize'. Either add clarifying /* paramName= */ comments, or swap the arguments if that is what was intended


Suggested change
super.headerAttributes = new ConnectedSchemaAttributes(serviceName,
requestAttributeCount,

🔎 Expand here to view all instances of this finding
File Path Line Number
open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedDeployedAPIOperation.java 65
open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedDeployedAPISchemaType.java 36
open-metadata-implementation/common-services/ocf-metadata-management/ocf-metadata-client/src/main/java/org/odpi/openmetadata/commonservices/ocf/metadatamanagement/client/ConnectedDeployedAPIOperation.java 39

Visit the Lift Web Console to find more details in your report.


ℹ️ Learn about @sonatype-lift commands

You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.

Command Usage
@sonatype-lift ignore Leave out the above finding from this PR
@sonatype-lift ignoreall Leave out all the existing findings from this PR
@sonatype-lift exclude <file|issue|path|tool> Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file

Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.


Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@sonatype-lift
Copy link
Contributor

sonatype-lift bot commented Oct 27, 2022

⚠️ 112 God Classes were detected by Lift in this project. Visit the Lift web console for more details.

@planetf1 planetf1 mentioned this pull request Nov 2, 2022
31 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant