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

Scheduler to detect topic changes on cluster and klaw #2063

Merged
merged 3 commits into from
Nov 30, 2023

Conversation

muralibasani
Copy link
Contributor

Linked issue

Resolves: #1386

  • Scheduler to detect changes in Klaw and Kafka cluster and notify admins instead of user going to Sync Topics page
  • Redundant code commonUtils.getFilteredTopicsForTenant is removed as tenant check is already applied

What kind of change does this PR introduce?

  • Bug fix
  • New feature
  • [ X] Refactor
  • Docs update
  • CI update

What is the current behavior?

Describe the state of the application before this PR. Illustrations appreciated (videos, gifs, screenshots).

  • There is an existing scheduler to look for topic changes but not functional due to issues
  • Redundant code getFilteredTopicsForTenant in CommonUtils is of no use

What is the new behavior?

Describe the state of the application after this PR. Illustrations appreciated (videos, gifs, screenshots).

  • Scheduler to look for enabled Kafka environments and detect changes on Kafka cluster and Klaw and send one notification for a tenant which includes all environments

Ex :
Tenant : default
Topic differences in DEV Klaw environment !!

Topic Aindriu-Demo added on Kafka cluster DEV
Topic Aindriu-Temp added on Kafka cluster DEV
Topic ChangeEmailTopic added on Kafka cluster DEV
Topic Helloono added on Kafka cluster DEV
Topic Hellotop added on Kafka cluster DEV
Topic PromotionTopicTest added on Kafka cluster DEV
Topic TestEmailTopicChange added on Kafka cluster DEV
Topic newaivtopicsync1 added on Kafka cluster DEV
Topic testtopicfordemonov added on Kafka cluster DEV
Topic testtopicnov21 added on Kafka cluster DEV
Topic : newaudittopic deleted in Klaw environment DEV
Topic : uptimetopic deleted in Klaw environment DEV
Topic : aivtopic1 deleted in Klaw environment DEV
Topic : aivtopic1 deleted in Klaw environment DEV
Topic : testospo2 deleted in Klaw environment DEV
Topic : aivtopic2 deleted in Klaw environment DEV
Topic : demotopic1 deleted in Klaw environment DEV
Topic : testtopictest deleted in Klaw environment DEV
Topic : testdemotopic deleted in Klaw environment DEV
Topic : testtopic0012 deleted in Klaw environment DEV
Topic : testtopicconfig deleted in Klaw environment DEV
Topic : aivtopic2 deleted in Klaw environment DEV
Topic : testsync deleted in Klaw environment DEV
Topic : Release220 deleted in Klaw environment DEV
Topic : demotopic1 deleted in Klaw environment DEV
Topic : NewTopic123456 deleted in Klaw environment DEV
Topic : NewTopic444 deleted in Klaw environment DEV
Topic : DemoTopic1 deleted in Klaw environment DEV
Topic : GenTopic deleted in Klaw environment DEV
Topic : testdemotopic deleted in Klaw environment DEV


  • getFilteredTopicsForTenant method in CommonUtilsService class is deleted as the check is redundant. TenantId is verified in above steps in the classes

Other information

Additional changes, explanations of the approach taken, unresolved issues, necessary follow ups, etc.

Requirements (all must be checked before review)

  • The pull request title follows our guidelines
  • Tests for the changes have been added (if relevant)
  • The latest changes from the main branch have been pulled
  • pnpm lint has been run successfully

aindriu-aiven
aindriu-aiven previously approved these changes Nov 30, 2023
Copy link
Contributor

@aindriu-aiven aindriu-aiven left a comment

Choose a reason for hiding this comment

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

only one small comment

@@ -304,7 +304,8 @@ public ApiResponse createClaimTopicRequest(String topicName, String envId) throw
return ApiResponse.notOk(TOPICS_ERR_107);
}

List<Topic> topics = getTopicFromName(topicName, tenantId);
List<Topic> topics = commonUtilsService.getTopicsForTopicName(topicName, tenantId);
;
Copy link
Contributor

Choose a reason for hiding this comment

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

extra semi colon

Signed-off-by: muralibasani <[email protected]>
Copy link
Contributor

@aindriu-aiven aindriu-aiven left a comment

Choose a reason for hiding this comment

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

LGTM

@muralibasani muralibasani merged commit c9d83f6 into main Nov 30, 2023
22 checks passed
@muralibasani muralibasani deleted the notify-admins-changes branch November 30, 2023 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync feature differences - alert admins
2 participants