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

fix: update tree, query cluster info and send telemetry in backgroud (#912) #915

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

adietish
Copy link
Contributor

fixes #912

@adietish adietish changed the title query cluster info and send telemetry in backgroud (#876) fix: query cluster info and send telemetry in backgroud (#876) Sep 18, 2024
@adietish adietish force-pushed the issue-912 branch 2 times, most recently from 9d7b3ae to 68ee7f2 Compare September 19, 2024 21:27
@adietish adietish changed the title fix: query cluster info and send telemetry in backgroud (#876) fix: query cluster info and send telemetry in backgroud (#912) Sep 19, 2024
@adietish adietish force-pushed the issue-912 branch 2 times, most recently from 9f99d1d to e83ba11 Compare September 19, 2024 22:26
@adietish adietish changed the title fix: query cluster info and send telemetry in backgroud (#912) fix: update tree, query cluster info and send telemetry in backgroud (#912) Sep 19, 2024
@@ -418,7 +415,7 @@ public ComponentInfo getComponentInfo(String project, String component, String p

private ComponentInfo parseComponentInfo(String json, ComponentKind kind) throws IOException {
JSonParser parser = new JSonParser(Serialization.json().readTree(json));
return parser.parseDescribeComponentInfo(kind, isPodmanPresent);
return parser.parseDescribeComponentInfo(kind, isPodmanPresent());
Copy link
Collaborator

Choose a reason for hiding this comment

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

why modify this variable to a method call each time a compoenent is parsed ? this is time consuming for no reason, has podman is present or not for the whole time the extension is instanciated.

Copy link
Contributor Author

@adietish adietish Sep 20, 2024

Choose a reason for hiding this comment

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

the reason is the following:
the check was executed in the constructor of OdoCli and it's a heavy operation. All the heavy operations that are in the constructor of OdoCli were executed when the tree structure requested the odo binary. This then lead to the tree displaying "IndicatorCancelled" when the UI was waiting for these operations and it took too long.
I changed the current impl so that it would lazy determine if podman is present in the background and store the result once it's determined.

Copy link
Collaborator

@sbouchet sbouchet left a comment

Choose a reason for hiding this comment

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

LGTM. heavy check is now perfomed only once, in a lazy manner. good one !

Copy link

openshift-ci bot commented Sep 24, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbouchet

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

openshift-ci bot commented Sep 24, 2024

New changes are detected. LGTM label has been removed.

@adietish adietish added the lgtm label Sep 24, 2024
@adietish
Copy link
Contributor Author

/override ci/prow/e2e-openshift

Copy link

openshift-ci bot commented Sep 24, 2024

@adietish: Overrode contexts on behalf of adietish: ci/prow/e2e-openshift

In response to this:

/override ci/prow/e2e-openshift

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@redhat-developer redhat-developer deleted a comment from openshift-ci bot Sep 24, 2024
Copy link

sonarcloud bot commented Sep 24, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@openshift-merge-bot openshift-merge-bot bot merged commit 37bdd93 into redhat-developer:main Sep 24, 2024
16 checks passed
@adietish adietish deleted the issue-912 branch September 24, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When launching the plugin on an existing project, I cannot use it. IndicatorCancellationException
2 participants