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

Issue/6174 instance query [DRAFT] #6190

Closed
wants to merge 74 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
d7af9ab
Replace v1 queries related to services for React-Query
matborowczyk Jan 23, 2025
9fddd9e
test fixes
matborowczyk Jan 24, 2025
200f326
Merge branch 'master' of github.com:inmanta/web-console into issue/se…
matborowczyk Jan 24, 2025
0350d3c
lint
matborowczyk Jan 24, 2025
eef9e13
fix docstrings
matborowczyk Jan 24, 2025
041b241
update name file
LukasStordeur Jan 24, 2025
24eaba6
rename file
LukasStordeur Jan 24, 2025
4a4bcec
fix 3rd scenario
matborowczyk Jan 24, 2025
4b64f17
Merge branch 'issue/service-queries-replacement' of github.com:inmant…
matborowczyk Jan 24, 2025
8bf7600
Merge branch 'master' of github.com:inmanta/web-console into issue/61…
matborowczyk Jan 28, 2025
358603f
Extract code duplicates from react queries
matborowczyk Jan 28, 2025
b2efc40
docstrings update
matborowczyk Jan 28, 2025
7fc3b0a
Merge branch 'master' of github.com:inmanta/web-console into issue/61…
matborowczyk Jan 29, 2025
ef98dca
lint fix
matborowczyk Jan 29, 2025
79174fa
rename export catalog
matborowczyk Jan 29, 2025
fe372e4
test fix
matborowczyk Jan 29, 2025
5f722ec
fix
matborowczyk Jan 29, 2025
a6c2a85
change file structure
matborowczyk Jan 29, 2025
4bd22c3
remove queryKeys
matborowczyk Jan 29, 2025
1262a84
remove export
matborowczyk Jan 29, 2025
4ef50de
test fix
matborowczyk Jan 29, 2025
7c884a3
lint & tsc
matborowczyk Jan 30, 2025
188bed6
improvement
matborowczyk Jan 30, 2025
e13c2fa
lint
matborowczyk Jan 30, 2025
343ba0d
e2e fix
matborowczyk Jan 30, 2025
b0eaa3f
e2e fix
matborowczyk Jan 30, 2025
38815c2
lint
matborowczyk Jan 30, 2025
7f1a465
e2e fix
matborowczyk Jan 30, 2025
b7fcffa
e2e fix
matborowczyk Jan 30, 2025
a955dc8
lint
matborowczyk Jan 30, 2025
ada83c3
test fix
matborowczyk Jan 30, 2025
a04b0f2
e2e fix
matborowczyk Jan 30, 2025
3e8084d
lint
matborowczyk Jan 31, 2025
8e379a3
Merge branch 'master' of github.com:inmanta/web-console into issue/61…
matborowczyk Feb 6, 2025
f5fcfb7
Add all relevant queries for instance and service
matborowczyk Feb 6, 2025
4c8043f
docstrings and imports
matborowczyk Feb 6, 2025
89d1f02
docstrings & readability
matborowczyk Feb 6, 2025
c705388
Modify client components to accommodate react-query and all relevant …
matborowczyk Feb 6, 2025
cd13e69
remarks
matborowczyk Feb 7, 2025
43862fc
Merge pull request #6188 from inmanta/sub-issue/6174-add-new-quereis
matborowczyk Feb 7, 2025
c0600fe
Merge branch 'issue/6174-instance-query' of github.com:inmanta/web-co…
matborowczyk Feb 7, 2025
d5a9bff
docstrings
matborowczyk Feb 7, 2025
07ac627
remove v1 queries
matborowczyk Feb 7, 2025
919e8f5
adjustment regarding of deletion of other queries, or some minor impr…
matborowczyk Feb 7, 2025
d4aa62e
Merge pull request #6189 from inmanta/sub-issue/6174-modify-app-files
matborowczyk Feb 7, 2025
7a923aa
Merge pull request #6191 from inmanta/sub-issue/6174-remove-v1-queries
matborowczyk Feb 7, 2025
cd0946b
working tests
matborowczyk Feb 7, 2025
0400aab
working tests
matborowczyk Feb 7, 2025
c4a6bc3
working tests
matborowczyk Feb 10, 2025
9a84e8f
working tests
matborowczyk Feb 10, 2025
d4d430b
working tests
matborowczyk Feb 10, 2025
d0597be
working tests
matborowczyk Feb 10, 2025
1e660a2
working tests
matborowczyk Feb 11, 2025
a33b115
lint
matborowczyk Feb 11, 2025
756b715
test
matborowczyk Feb 11, 2025
4798a59
test fix
matborowczyk Feb 11, 2025
f0a1868
lint
matborowczyk Feb 11, 2025
5ed809e
fix temp circ dep issue
matborowczyk Feb 11, 2025
4fb521b
lint
matborowczyk Feb 11, 2025
861ee30
timeout
matborowczyk Feb 11, 2025
5bba08d
fix
matborowczyk Feb 11, 2025
a404618
lint fix
matborowczyk Feb 11, 2025
24c625b
remarks + improvements
matborowczyk Feb 11, 2025
925fb58
Merge pull request #6192 from inmanta/sub-issue/6174-fix-tests
matborowczyk Feb 12, 2025
f246ff6
Merge branch 'master' of github.com:inmanta/web-console into issue/61…
matborowczyk Feb 12, 2025
9840f07
comments
matborowczyk Feb 12, 2025
8198412
e2e fix
matborowczyk Feb 12, 2025
76e6aa5
e2e fix
matborowczyk Feb 12, 2025
2bdea8f
e2e fix
matborowczyk Feb 12, 2025
a22581b
e2e fix
matborowczyk Feb 12, 2025
df2a46c
changelog
matborowczyk Feb 12, 2025
457058c
e2e fix
matborowczyk Feb 12, 2025
2d8f464
e2e fix
matborowczyk Feb 12, 2025
d95569d
e2e fix
matborowczyk Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelogs/unreleased/6174-instance-query.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: Improve Query Management for service and service instance queries with replacement of v1 queries with react-query implementation
issue-nr: 6178
change-type: patch
destination-branches: [master, iso8]
sections:
minor-improvement: "{{description}}"
2 changes: 1 addition & 1 deletion cypress/e2e/scenario-2.2-child-parent-service.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ if (Cypress.env("edition") === "iso") {
cy.get("#parent-service").contains("Show inventory").click();
cy.get('[data-label="State"]')
.eq(0)
.should("have.text", "up", { timeout: 90000 });
.should("have.text", "up", { timeout: 120000 });

// try delete item (Should not be possible)
cy.get('[aria-label="row actions toggle"]', { timeout: 60000 }).click();
Expand Down
67 changes: 41 additions & 26 deletions cypress/e2e/scenario-8-instance-composer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,14 @@ if (Cypress.env("edition") === "iso") {

//Drag extra_embedded onto canvas and assert that is highlighted as loose element
cy.get('[aria-labelledby="bodyTwo_extra_embedded"]')
.trigger("mouseover")
.trigger("mousedown")
.trigger("mouseover", { force: true }) // sometimes cypress doesn't trigger the event as text in that element is in front of the component
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we aren't targetting the right element, causing the confusion for cypress somehow. I'm not a fan of using the force; true, but I'll let it through since this is a really big PR. Can you make a ticket for this to look into it better?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

.trigger("mousedown", { force: true })
.trigger("mousemove", {
force: true,
clientX: 800,
clientY: 500,
})
.trigger("mouseup");
.trigger("mouseup", { force: true });

cy.get(".joint-loose_element-highlight").should("be.visible");

Expand All @@ -450,13 +451,14 @@ if (Cypress.env("edition") === "iso") {

//Drag once again extra_embedded onto canvas and assert that is highlighted as loose element
cy.get('[aria-labelledby="bodyTwo_extra_embedded"]')
.trigger("mouseover")
.trigger("mousedown")
.trigger("mouseover", { force: true }) // sometimes cypress doesn't trigger the event as text in that element is in front of the component
.trigger("mousedown", { force: true })
.trigger("mousemove", {
force: true,
clientX: 800,
clientY: 500,
})
.trigger("mouseup");
.trigger("mouseup", { force: true });

cy.get(".joint-loose_element-highlight").should("be.visible");

Expand Down Expand Up @@ -516,13 +518,14 @@ if (Cypress.env("edition") === "iso") {
cy.get("#inventory-tab").click();

cy.get('[aria-labelledby="bodyTwo_test_name"]')
.trigger("mouseover")
.trigger("mousedown")
.trigger("mouseover", { force: true }) // sometimes cypress doesn't trigger the event as text in that element is in front of the component
.trigger("mousedown", { force: true })
.trigger("mousemove", {
force: true,
clientX: 800,
clientY: 500,
})
.trigger("mouseup");
.trigger("mouseup", { force: true });

//highlighted loose element should be visible
cy.get(".joint-loose_element-highlight").should("be.visible");
Expand All @@ -537,7 +540,7 @@ if (Cypress.env("edition") === "iso") {
clientX: 800,
clientY: 500,
})
.trigger("mouseup");
.trigger("mouseup", { force: true });

//highlighted loose element should be removed
cy.get(".joint-loose_element-highlight").should("not.exist");
Expand All @@ -548,13 +551,14 @@ if (Cypress.env("edition") === "iso") {
cy.get('[data-name="fit-to-screen"]').click();

cy.get('[aria-labelledby="bodyTwo_test_name2"]')
.trigger("mouseover")
.trigger("mousedown")
.trigger("mouseover", { force: true }) // sometimes cypress doesn't trigger the event as text in that element is in front of the component
.trigger("mousedown", { force: true })
.trigger("mousemove", {
force: true,
clientX: 600,
clientY: 400,
})
.trigger("mouseup");
.trigger("mouseup", { force: true });
cy.get('[data-name="fit-to-screen"]').click();
cy.get('[data-type="app.ServiceEntityBlock"')
.contains("embedded")
Expand Down Expand Up @@ -828,13 +832,14 @@ if (Cypress.env("edition") === "iso") {
cy.get("#inventory-tab").click();

cy.get('[aria-labelledby="bodyTwo_test_name"]')
.trigger("mouseover")
.trigger("mousedown")
.trigger("mouseover", { force: true }) // sometimes cypress doesn't trigger the event as text in that element is in front of the component
.trigger("mousedown", { force: true })
.trigger("mousemove", {
force: true,
clientX: 800,
clientY: 600,
})
.trigger("mouseup");
.trigger("mouseup", { force: true });

cy.get('[data-type="app.ServiceEntityBlock"')
.contains("child-service")
Expand All @@ -851,6 +856,8 @@ if (Cypress.env("edition") === "iso") {
cy.get('[data-type="Link"]').should("have.length", 1);

cy.get("button").contains("Deploy").click();

cy.wait(500); //sometimes the navigation is too fast and the redirect isn't being received properly
cy.get('[aria-label="Sidebar-Navigation-Item"]')
.contains("Service Catalog")
.click();
Expand Down Expand Up @@ -903,13 +910,14 @@ if (Cypress.env("edition") === "iso") {
.click();

cy.get('[aria-labelledby="bodyTwo_test_name2"]')
.trigger("mouseover")
.trigger("mousedown")
.trigger("mouseover", { force: true }) // sometimes cypress doesn't trigger the event as text in that element is in front of the component
.trigger("mousedown", { force: true })
.trigger("mousemove", {
force: true,
clientX: 800,
clientY: 500,
})
.trigger("mouseup");
.trigger("mouseup", { force: true });

cy.get('[data-type="app.ServiceEntityBlock"')
.contains("child-service")
Expand All @@ -921,7 +929,7 @@ if (Cypress.env("edition") === "iso") {
clientX: 800,
clientY: 500,
})
.trigger("mouseup");
.trigger("mouseup", { force: true });

cy.get('[data-testid="Error-container"]').should("not.exist");

Expand All @@ -936,6 +944,11 @@ if (Cypress.env("edition") === "iso") {
.contains("Show inventory")
.click();

// await until parent_service is deployed and up
cy.get('[data-label="State"]', { timeout: 90000 }).should(
"have.text",
"update_start",
);
// await until parent_service is deployed and up
cy.get('[data-label="State"]', { timeout: 90000 }).should(
"have.text",
Expand Down Expand Up @@ -1014,13 +1027,14 @@ if (Cypress.env("edition") === "iso") {

//add first inter-service relation
cy.get('[aria-labelledby="bodyTwo_test_name"]')
.trigger("mouseover")
.trigger("mousedown")
.trigger("mouseover", { force: true }) // sometimes cypress doesn't trigger the event as text in that element is in front of the component
.trigger("mousedown", { force: true })
.trigger("mousemove", {
force: true,
clientX: 800,
clientY: 500,
})
.trigger("mouseup");
.trigger("mouseup", { force: true });

cy.get('[data-type="app.ServiceEntityBlock"')
.contains("child-with-many")
Expand All @@ -1036,13 +1050,14 @@ if (Cypress.env("edition") === "iso") {

//add second inter-service relation
cy.get('[aria-labelledby="bodyTwo_test_name2"]')
.trigger("mouseover")
.trigger("mousedown")
.trigger("mouseover", { force: true }) // sometimes cypress doesn't trigger the event as text in that element is in front of the component
.trigger("mousedown", { force: true })
.trigger("mousemove", {
force: true,
clientX: 800,
clientY: 700,
})
.trigger("mouseup");
.trigger("mouseup", { force: true });

cy.get('[data-type="app.ServiceEntityBlock"')
.contains("child-with-many")
Expand Down
56 changes: 1 addition & 55 deletions src/Core/Command/Command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,7 @@ import {
ControlAgent,
ControlAgentManifest,
} from "@/Data/Managers/ControlAgent/interface";
import {
DeleteInstance,
DeleteInstanceManifest,
} from "@/Data/Managers/DeleteInstance/interface";
import {
DeleteService,
DeleteServiceManifest,
} from "@/Data/Managers/DeleteService/interface";
import { Deploy, DeployManifest } from "@/Data/Managers/Deploy/interface";
import {
DestroyInstance,
DestroyInstanceManifest,
} from "@/Data/Managers/DestroyInstance/interface";
import {
ResetEnvironmentSetting,
ResetEnvironmentSettingManifest,
Expand All @@ -35,10 +23,6 @@ import {
HaltEnvironment,
HaltEnvironmentManifest,
} from "@/Data/Managers/HaltEnvironment/interface";
import {
UpdateInstanceConfig,
UpdateInstanceConfigManifest,
} from "@/Data/Managers/InstanceConfig/interfaces";
import {
ModifyEnvironment,
ModifyEnvironmentManifest,
Expand All @@ -48,10 +32,6 @@ import {
ResumeEnvironment,
ResumeEnvironmentManifest,
} from "@/Data/Managers/ResumeEnvironment/interface";
import {
UpdateServiceConfig,
UpdateServiceConfigManifest,
} from "@/Data/Managers/ServiceConfig/interfaces";
import {
TriggerCompile,
TriggerCompileManifest,
Expand All @@ -60,22 +40,6 @@ import {
TriggerDryRun,
TriggerDryRunManifest,
} from "@/Data/Managers/TriggerDryRun/interface";
import {
TriggerForceState,
TriggerForceStateManifest,
} from "@/Data/Managers/TriggerForceState/interface";
import {
TriggerSetState,
TriggerSetStateManifest,
} from "@/Data/Managers/TriggerSetState/interface";
import {
UpdateCatalog,
UpdateCatalogManifest,
} from "@/Data/Managers/UpdateCatalog/interface";
import {
UpdateInstanceAttribute,
UpdateInstanceAttributeManifest,
} from "@/Data/Managers/UpdateInstanceAttribute/interface";

import * as CreateEnvironment from "@S/CreateEnvironment/Core/CreateEnvironmentCommand";
import * as CreateProject from "@S/CreateEnvironment/Core/CreateProjectCommand";
Expand All @@ -96,28 +60,19 @@ export type Command =
| CreateProject.Command
| DeleteCallback.Command
| DeleteEnvironment.Command
| DeleteInstance
| DestroyInstance
| DeleteService
| Deploy
| GenerateToken
| GetSupportArchive
| HaltEnvironment
| ModifyEnvironment
| UpdateCatalog
| Repair
| ResetEnvironmentSetting
| ResumeEnvironment
| TriggerCompile
| TriggerDryRun
| TriggerInstanceUpdate.Command
| TriggerSetState
| TriggerForceState
| UpdateEnvironmentSetting
| UpdateInstanceAttribute
| UpdateInstanceConfig
| UpdateNotification.Command
| UpdateServiceConfig;
| UpdateNotification.Command;

export type Type = Command;

Expand All @@ -134,28 +89,19 @@ interface Manifest {
CreateProject: CreateProject.Manifest;
DeleteCallback: DeleteCallback.Manifest;
DeleteEnvironment: DeleteEnvironment.Manifest;
DeleteInstance: DeleteInstanceManifest;
DestroyInstance: DestroyInstanceManifest;
DeleteService: DeleteServiceManifest;
Deploy: DeployManifest;
GenerateToken: GenerateTokenManifest;
GetSupportArchive: GetSupportArchiveManifest;
HaltEnvironment: HaltEnvironmentManifest;
ModifyEnvironment: ModifyEnvironmentManifest;
UpdateCatalog: UpdateCatalogManifest;
Repair: RepairManifest;
ResetEnvironmentSetting: ResetEnvironmentSettingManifest;
ResumeEnvironment: ResumeEnvironmentManifest;
TriggerCompile: TriggerCompileManifest;
TriggerDryRun: TriggerDryRunManifest;
TriggerInstanceUpdate: TriggerInstanceUpdate.Manifest;
TriggerSetState: TriggerSetStateManifest;
TriggerForceState: TriggerForceStateManifest;
UpdateEnvironmentSetting: UpdateEnvironmentSettingManifest;
UpdateInstanceAttribute: UpdateInstanceAttributeManifest;
UpdateInstanceConfig: UpdateInstanceConfigManifest;
UpdateNotification: UpdateNotification.Manifest;
UpdateServiceConfig: UpdateServiceConfigManifest;
}

/**
Expand Down
43 changes: 1 addition & 42 deletions src/Core/Query/Query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ import {
GetEnvironmentsContinuous,
GetEnvironmentsContinuousManifest,
} from "@/Data/Managers/GetEnvironmentsContinuous/interface";
import {
GetServiceInstance,
GetServiceInstanceManifest,
} from "@/Data/Managers/GetInstance/interface";
import {
GetInstanceResources,
GetInstanceResourcesManifest,
} from "@/Data/Managers/GetInstanceResources/interface";
import {
GetServerStatus,
GetServerStatusManifest,
Expand All @@ -39,26 +31,7 @@ import {
GetVersionFile,
GetVersionFileManifest,
} from "@/Data/Managers/GetVersionFile/interface";
import {
GetInstanceConfig,
GetInstanceConfigManifest,
} from "@/Data/Managers/InstanceConfig/interfaces";
import {
GetService,
GetServiceManifest,
} from "@/Data/Managers/Service/interface";
import {
GetServiceConfig,
GetServiceConfigManifest,
} from "@/Data/Managers/ServiceConfig/interfaces";
import {
GetServiceInstances,
GetServiceInstancesManifest,
} from "@/Data/Managers/ServiceInstances/interface";
import {
GetServices,
GetServicesManifest,
} from "@/Data/Managers/Services/interface";

import * as GetAgents from "@S/Agents/Core/Query";
import * as GetCompileDetails from "@S/CompileDetails/Core/Query";
import * as GetCompileReports from "@S/CompileReports/Core/Query";
Expand Down Expand Up @@ -87,14 +60,7 @@ import * as GetEnvironmentDetails from "@S/Settings/Core/GetEnvironmentDetailsQu
import * as GetProjects from "@S/Settings/Core/GetProjectsQuery";

export type Query =
| GetServices
| GetService
| GetServiceInstance
| GetServiceInstances
| GetServiceConfig
| GetInstanceResources
| GetInstanceEvents.Query
| GetInstanceConfig
| GetMetrics.Query
| GetDiagnostics.Query
| GetDiscoveredResources.Query
Expand Down Expand Up @@ -136,14 +102,7 @@ export type Type = Query;
* types related to all the sub queries.
*/
interface Manifest {
GetServices: GetServicesManifest;
GetService: GetServiceManifest;
GetServiceInstance: GetServiceInstanceManifest;
GetServiceInstances: GetServiceInstancesManifest;
GetServiceConfig: GetServiceConfigManifest;
GetInstanceResources: GetInstanceResourcesManifest;
GetInstanceEvents: GetInstanceEvents.Manifest;
GetInstanceConfig: GetInstanceConfigManifest;
GetDiagnostics: GetDiagnostics.Manifest;
GetDiscoveredResources: GetDiscoveredResources.Manifest;
GetMetrics: GetMetrics.Manifest;
Expand Down
Loading