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

[minor_change] Optimization through an additional api call at list-identity schema endpoint to avoid retrieval of all schemas in order to get the id of a schema (DCNE-208) #302

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akinross
Copy link
Collaborator

No description provided.

@akinross akinross force-pushed the optimize_schema_datasource_for_large_schemas branch from 8770ca1 to a4568db Compare October 15, 2024 11:09
…entity schema endpoint to avoid retrieval of all schemas in order to get the id of a schema
@akinross akinross force-pushed the optimize_schema_datasource_for_large_schemas branch from a4568db to ec71511 Compare October 15, 2024 18:39
@akinross akinross added the jira-sync Sync this issue to Jira label Oct 15, 2024
@github-actions github-actions bot changed the title [minor_change] Optimization through an additional api call at list-identity schema endpoint to avoid retrieval of all schemas in order to get the id of a schema [minor_change] Optimization through an additional api call at list-identity schema endpoint to avoid retrieval of all schemas in order to get the id of a schema (DCNE-208) Oct 15, 2024
con, err := msoClient.GetViaURL("/api/v1/schemas/list-identity")

if err != nil {
return "", nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we cahnge the return "" -> "Endpoint not found" ?
then we can run the other part of code.

then from line 241 if return "" the we will not run the old code.

Copy link
Collaborator Author

@akinross akinross Oct 16, 2024

Choose a reason for hiding this comment

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

I am not sure I follow exactly what you mean, do you want to return a string with a specific value?

Why would "" not run the old code?

The cases that I now see from the code are the following:

  • errors for whatever reason -> return "", nil -> executes the else clause in line 91 of the datasource, which means fallback to the existing code and schema endpoint
  • find the name in from response -> return schemaId, nil -> executes the else if condition in line 86 of the datasource where schemaId is a non empty string value and does a specific query for this schemaId
  • does not find name in response -> return "", err -> return the error in line 85 of the datasource

Copy link
Collaborator

@gmicol gmicol left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira-sync Sync this issue to Jira
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants