Skip to content

Commit

Permalink
Fix conflicts
Browse files Browse the repository at this point in the history
Signed-off-by: muralibasani <[email protected]>
  • Loading branch information
muralibasani committed Oct 4, 2023
2 parents 9af2e8b + 28dbbd5 commit 166431a
Show file tree
Hide file tree
Showing 36 changed files with 1,208 additions and 257 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const mockedEnvironmentsResponse: EnvironmentPaginatedApiResponse =
tenantName: "default",
clusterName: "DEV",
envStatus: "OFFLINE",
envStatusTime: "2023-09-21T11:47:15.664615239",
envStatusTimeString: "21-Sep-2023 11:46:15",
otherParams: "",
showDeleteEnv: false,
totalNoPages: "1",
Expand Down Expand Up @@ -66,6 +68,8 @@ const mockedEnvironmentsResponse: EnvironmentPaginatedApiResponse =
tenantName: "default",
clusterName: "DEV_CLS",
envStatus: "ONLINE",
envStatusTime: "2023-09-21T11:47:15.664615239",
envStatusTimeString: "21-Sep-2023 11:46:15",
otherParams: "",
showDeleteEnv: false,
totalNoPages: "1",
Expand Down Expand Up @@ -98,6 +102,8 @@ const mockedEnvironmentsResponse: EnvironmentPaginatedApiResponse =
tenantName: "default",
clusterName: "TST",
envStatus: "ONLINE",
envStatusTime: "2023-09-21T11:47:15.664615239",
envStatusTimeString: "21-Sep-2023 11:46:15",
otherParams:
"default.partitions=2,max.partitions=2,default.replication.factor=1,max.replication.factor=1,topic.prefix=,topic.suffix=",
showDeleteEnv: false,
Expand Down Expand Up @@ -131,6 +137,8 @@ const mockedEnvironmentsResponse: EnvironmentPaginatedApiResponse =
tenantName: "default",
clusterName: "DEV",
envStatus: "OFFLINE",
envStatusTime: "2023-09-21T11:47:15.664615239",
envStatusTimeString: "21-Sep-2023 11:46:15",
otherParams: "",
showDeleteEnv: false,
totalNoPages: "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const mockedEnvironmentsResponse: EnvironmentPaginatedApiResponse =
tenantName: "default",
clusterName: "TST_CONNCT",
envStatus: "ONLINE",
envStatusTime: "2023-09-21T11:47:15.664615239",
envStatusTimeString: "21-Sep-2023 11:46:15",
showDeleteEnv: false,
totalNoPages: "1",
currentPage: "1",
Expand All @@ -55,6 +57,8 @@ const mockedEnvironmentsResponse: EnvironmentPaginatedApiResponse =
tenantName: "default",
clusterName: "DEV",
envStatus: "OFFLINE",
envStatusTime: "2023-09-21T11:47:15.664615239",
envStatusTimeString: "21-Sep-2023 11:46:15",
showDeleteEnv: false,
totalNoPages: "1",
currentPage: "1",
Expand All @@ -72,6 +76,8 @@ const mockedEnvironmentsResponse: EnvironmentPaginatedApiResponse =
tenantName: "default",
clusterName: "UIKLAW",
envStatus: "ONLINE",
envStatusTimeString: "21-Sep-2023 11:46:15",
envStatusTime: "2023-09-21T11:47:15.664615239",
showDeleteEnv: false,
totalNoPages: "1",
currentPage: "1",
Expand All @@ -89,6 +95,8 @@ const mockedEnvironmentsResponse: EnvironmentPaginatedApiResponse =
tenantName: "default",
clusterName: "UIKLAW",
envStatus: "ONLINE",
envStatusTimeString: "21-Sep-2023 11:46:15",
envStatusTime: "2023-09-21T11:47:15.664615239",
showDeleteEnv: false,
totalNoPages: "1",
currentPage: "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const mockedEnvironmentsResponse: EnvironmentPaginatedApiResponse =
tenantName: "default",
clusterName: "TST_SCHEMA",
envStatus: "ONLINE",
envStatusTime: "2023-09-21T11:47:15.664615239",
envStatusTimeString: "21-Sep-2023 11:46:15",
showDeleteEnv: false,
totalNoPages: "1",
currentPage: "1",
Expand All @@ -59,6 +61,8 @@ const mockedEnvironmentsResponse: EnvironmentPaginatedApiResponse =
tenantName: "default",
clusterName: "DEV_CLS",
envStatus: "ONLINE",
envStatusTime: "2023-09-21T11:47:15.664615239",
envStatusTimeString: "21-Sep-2023 11:46:15",
showDeleteEnv: false,
totalNoPages: "1",
currentPage: "1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ describe("EnvironmentStatus", () => {
mockGetUpdateEnvStatus.mockResolvedValue({
result: "success",
envStatus: "ONLINE",
envStatusTime: "2023-09-21T11:47:15.664615239",
envStatusTimeString: "21-Sep-2023 11:46:15",
});

expect(screen.getByText("Working")).toBeVisible();
Expand All @@ -108,6 +110,8 @@ describe("EnvironmentStatus", () => {
mockGetUpdateEnvStatus.mockResolvedValue({
result: "success",
envStatus: "OFFLINE",
envStatusTime: "2023-09-21T11:47:15.664615239",
envStatusTimeString: "21-Sep-2023 11:46:15",
});

expect(screen.getByText("Working")).toBeVisible();
Expand Down Expand Up @@ -152,6 +156,8 @@ describe("EnvironmentStatus", () => {
mockGetUpdateEnvStatus.mockResolvedValue({
result: "success",
envStatus: "OFFLINE",
envStatusTime: "2023-09-21T11:47:15.664615239",
envStatusTimeString: "21-Sep-2023 11:46:15",
});

expect(screen.getByText("Working")).toBeVisible();
Expand Down
2 changes: 2 additions & 0 deletions coral/src/domain/environment/environment-test-helper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ describe("environment-test-helper.ts", () => {
defaultPartitions: undefined,
defaultReplicationFactor: undefined,
envStatus: "ONLINE",
envStatusTime: "2023-09-08T12:34:10.615919098",
envStatusTimeString: "21-Sep-2023 11:46:15",
id: "1",
maxPartitions: undefined,
maxReplicationFactor: undefined,
Expand Down
2 changes: 2 additions & 0 deletions coral/src/domain/environment/environment-test-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const defaultEnvironmentDTO: KlawApiModel<"EnvModelResponse"> = {
tenantName: "default",
clusterName: "DEV",
envStatus: "ONLINE",
envStatusTimeString: "21-Sep-2023 11:46:15",
envStatusTime: "2023-09-08T12:34:10.615919098",
otherParams:
"default.partitions=2,max.partitions=2,default.replication.factor=1,max.replication.factor=1,topic.prefix=,topic.suffix=",
showDeleteEnv: false,
Expand Down
20 changes: 19 additions & 1 deletion coral/src/services/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ const API_PATHS = {
| "getKafkaEnv"
| "getKafkaConnectEnv"
| "getSchemaRegEnv"
| "addEnvToCache"
| "removeEnvFromCache"
>]: keyof ApiPaths;
};

Expand All @@ -223,6 +225,14 @@ type GetTopicRequest = (params: { topicReqId: string }) => keyof ApiPaths;
type GetKafkaEnv = (params: { envId: string }) => keyof ApiPaths;
type GetConnectEnv = (params: { envId: string }) => keyof ApiPaths;
type GetSchemaRegEnv = (params: { envId: string }) => keyof ApiPaths;
type AddEnvToCache = (params: {
tenantId: string;
id: string;
}) => keyof ApiPaths;
type RemoveEnvFromCache = (params: {
tenantId: string;
id: string;
}) => keyof ApiPaths;

const DYNAMIC_API_PATHS = {
getSchemaOfTopicFromSource: ({
Expand All @@ -242,6 +252,10 @@ const DYNAMIC_API_PATHS = {
`/environments/kafkaconnect/${envId}` as keyof ApiPaths,
getSchemaRegEnv: ({ envId }: Parameters<GetSchemaRegEnv>[0]) =>
`/environments/schemaRegistry/${envId}` as keyof ApiPaths,
addEnvToCache: ({ tenantId }: Parameters<AddEnvToCache>[0]) =>
`/cache/tenant/${tenantId}/entityType/environment` as keyof ApiPaths,
removeEnvFromCache: ({ tenantId, id }: Parameters<RemoveEnvFromCache>[0]) =>
`/cache/tenant/${tenantId}/entityType/environment/id/${id}` as keyof ApiPaths,
} satisfies {
[key in keyof Pick<
ApiOperations,
Expand All @@ -251,13 +265,17 @@ const DYNAMIC_API_PATHS = {
| "getKafkaEnv"
| "getKafkaConnectEnv"
| "getSchemaRegEnv"
| "addEnvToCache"
| "removeEnvFromCache"
>]:
| GetSchemaOfTopicFromSource
| GetSwitchTeams
| GetTopicRequest
| GetKafkaEnv
| GetConnectEnv
| GetSchemaRegEnv;
| GetSchemaRegEnv
| AddEnvToCache
| RemoveEnvFromCache;
};

type Params = URLSearchParams;
Expand Down
109 changes: 91 additions & 18 deletions coral/types/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ export type paths = {
"/chPwd": {
post: operations["changePwd"];
};
"/cache/tenant/{tenantId}/entityType/environment": {
post: operations["addEnvToCache"];
};
"/addTenantId": {
post: operations["addTenantId"];
};
Expand Down Expand Up @@ -526,6 +529,9 @@ export type paths = {
"/acl/request/{aclRequestId}": {
get: operations["getAclRequest"];
};
"/cache/tenant/{tenantId}/entityType/environment/id/{id}": {
delete: operations["removeEnvFromCache"];
};
};

export type webhooks = Record<string, never>;
Expand Down Expand Up @@ -884,6 +890,41 @@ export type components = {
envId: string;
includeOnlyFailedTasks: boolean;
};
Env: {
id?: string;
/** Format: int32 */
tenantId?: number;
name?: string;
stretchCode?: string;
/** Format: int32 */
clusterId?: number;
type?: string;
otherParams?: string;
envExists?: string;
/** @enum {string} */
envStatus?: "OFFLINE" | "ONLINE" | "NOT_KNOWN";
/** Format: date-time */
envStatusTime?: string;
envStatusTimeString?: string;
associatedEnv?: components["schemas"]["EnvTag"];
params?: components["schemas"]["EnvParams"];
};
EnvParams: {
defaultPartitions?: string;
maxPartitions?: string;
partitionsList?: (string)[];
defaultRepFactor?: string;
maxRepFactor?: string;
replicationFactorList?: (string)[];
topicPrefix?: (string)[];
topicSuffix?: (string)[];
topicRegex?: (string)[];
applyRegex?: boolean;
};
EnvTag: {
id?: string;
name?: string;
};
KwTenantModel: {
tenantName: string;
tenantDesc: string;
Expand Down Expand Up @@ -911,22 +952,6 @@ export type components = {
tenantId?: number;
params?: components["schemas"]["EnvParams"];
};
EnvParams: {
defaultPartitions?: string;
maxPartitions?: string;
partitionsList?: (string)[];
defaultRepFactor?: string;
maxRepFactor?: string;
replicationFactorList?: (string)[];
topicPrefix?: (string)[];
topicSuffix?: (string)[];
topicRegex?: (string)[];
applyRegex?: boolean;
};
EnvTag: {
id?: string;
name?: string;
};
KwClustersModel: {
/** Format: int32 */
clusterId?: number;
Expand Down Expand Up @@ -1126,6 +1151,9 @@ export type components = {
result: string;
/** @enum {string} */
envStatus: "OFFLINE" | "ONLINE" | "NOT_KNOWN";
/** Format: date-time */
envStatusTime: string;
envStatusTimeString: string;
};
TopicsCountPerEnv: {
status?: string;
Expand Down Expand Up @@ -1219,8 +1247,8 @@ export type components = {
hasSchema: boolean;
/** Format: int32 */
clusterId: number;
topicOwner?: boolean;
highestEnv?: boolean;
topicOwner?: boolean;
};
TopicBaseConfig: {
topicName: string;
Expand Down Expand Up @@ -1384,6 +1412,9 @@ export type components = {
clusterName: string;
/** @enum {string} */
envStatus: "OFFLINE" | "ONLINE" | "NOT_KNOWN";
/** Format: date-time */
envStatusTime: string;
envStatusTimeString: string;
otherParams: string;
showDeleteEnv: boolean;
totalNoPages: string;
Expand Down Expand Up @@ -2833,6 +2864,29 @@ export type operations = {
};
};
};
addEnvToCache: {
parameters: {
header: {
Authorization: string;
};
path: {
tenantId: number;
};
};
requestBody: {
content: {
"application/json": components["schemas"]["Env"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components["schemas"]["ApiResponse"];
};
};
};
};
addTenantId: {
requestBody: {
content: {
Expand Down Expand Up @@ -3731,7 +3785,7 @@ export type operations = {
getEnvParams: {
parameters: {
query: {
envSelected: string;
envSelected: number;
};
};
responses: {
Expand Down Expand Up @@ -4354,4 +4408,23 @@ export type operations = {
};
};
};
removeEnvFromCache: {
parameters: {
header: {
Authorization: string;
};
path: {
tenantId: number;
id: number;
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components["schemas"]["ApiResponse"];
};
};
};
};
};
7 changes: 5 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<jvmArguments>-Dspringdoc.writer-with-default-pretty-printer=true </jvmArguments>
<jvmArguments>
-Dspringdoc.writer-with-default-pretty-printer=true
-Dklaw.core.ha.enable=true
</jvmArguments>
</configuration>
<executions>
<execution>
Expand All @@ -287,8 +290,8 @@
<goal>stop</goal>
</goals>
<configuration>

<maxAttempts>${spring.integration.test.timeout}</maxAttempts>

</configuration>
</execution>
</executions>
Expand Down
Loading

0 comments on commit 166431a

Please sign in to comment.