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

Return Schema Promotion button using new TopicOverview button #1181

Merged
merged 1 commit into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,13 @@ private void updateAvroSchema(
// A team owns a topic across all environments so we can assume if the search returned
// one or more topics it is owned by this users team.
if (topics.size() > 0) {

// Set Promotion Details
processSchemaPromotionDetails(schemaOverview, tenantId, schemaEnv, kafkaEnvIds);
processSchemaPromotionDetails(
schemaOverview,
tenantId,
schemaEnv,
topics.stream().map(topic -> topic.getEnvironment()).toList());
log.info("Getting schema details for: " + topicNameSearch);
}
}
Expand All @@ -182,7 +187,7 @@ private void updateAvroSchema(

private void processSchemaPromotionDetails(
SchemaOverview schemaOverview, int tenantId, Env schemaEnv, List<String> kafkaEnvIds) {
log.info("SchemaEnv Id {}", schemaEnv.getId());
log.debug("SchemaEnv Id {} KafkaEnvIds {}", schemaEnv.getId(), kafkaEnvIds);
Map<String, String> promotionDetails = new HashMap<>();
generatePromotionDetails(
tenantId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ public void getGivenASchemaWithManySchemaEnv_ReturnNextInPromotion() throws Exce
when(commonUtilsService.getTeamId(anyString())).thenReturn(10);
when(handleDbRequests.getAllTopicsByTopicNameAndTeamIdAndTenantId(
eq(TESTTOPIC), eq(10), eq(101)))
.thenReturn(List.of(createTopic(TESTTOPIC, "1")));
.thenReturn(List.of(createTopic(TESTTOPIC, "1"), createTopic(TESTTOPIC, "2")));
SchemaOverview returnedValue =
schemaOverviewService.getSchemaOfTopic(TESTTOPIC, "1", List.of("1", "2"));
schemaOverviewService.getSchemaOfTopic(TESTTOPIC, "1", List.of("1"));

assertThat(returnedValue.getSchemaPromotionDetails()).isNotNull();
assertThat(returnedValue.getSchemaPromotionDetails().get("DEV").containsKey("status")).isTrue();
Expand Down
2 changes: 1 addition & 1 deletion openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"name" : "Apache 2.0",
"url" : "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"version" : "2.2.0"
"version" : "2.3.0"
},
"externalDocs" : {
"description" : "Klaw documentation",
Expand Down