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

chore: Refactor ModuleTemplate catalog sync code #2002

Merged

Conversation

Tomasz-Smelcerz-SAP
Copy link
Member

@Tomasz-Smelcerz-SAP Tomasz-Smelcerz-SAP commented Oct 31, 2024

Description

Refactor ModuleTemplate catalog sync code so that it's unit-testable and the entire CatalogSync can be easily extended to support synchronization for other types.

Changes proposed in this pull request:

  • No change in functionality - just the refactoring
  • Break the coupling between the existing methods by introducing interfaces and factory functions (Dependency Injection)
  • Introduce two new types for catalog sync, ensuring unit testability of the code (for example, abstracting away the K8s clients)
  • Preparing the ground for introducing ModuleReleaseMeta syncing mechanism that can be (almost) copy-pasted from the ModuleCatalog sync code.

Note for reviewer(s)
Surely more could be done in terms of code quality, e.g: separating the types to multiple packages.
This can be done in further iterations, and we'll have further iterations - we want to introduce a dedicated controller that performs the sync. At this moment I wanted the changes to be minimal to speed up the process (with respect to implementation and code review)

Related issue(s)
#1851

@Tomasz-Smelcerz-SAP Tomasz-Smelcerz-SAP requested a review from a team as a code owner October 31, 2024 00:02
@kyma-bot kyma-bot added cla: yes Indicates the PR's author has signed the CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 31, 2024
@Tomasz-Smelcerz-SAP Tomasz-Smelcerz-SAP changed the title refactor moduletemplate catalog sync code chore: Refactor ModuleTemplate catalog sync code Oct 31, 2024
@Tomasz-Smelcerz-SAP Tomasz-Smelcerz-SAP force-pushed the chore/refactor-catalog-sync branch from 16799f0 to a42fb89 Compare October 31, 2024 00:03
@kyma-bot kyma-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 31, 2024
@lindnerby lindnerby self-assigned this Oct 31, 2024
@Tomasz-Smelcerz-SAP Tomasz-Smelcerz-SAP force-pushed the chore/refactor-catalog-sync branch from 191b131 to 59835a0 Compare October 31, 2024 09:33
@kyma-bot kyma-bot added the lgtm Looks good to me! label Nov 4, 2024
@kyma-bot kyma-bot removed the lgtm Looks good to me! label Nov 4, 2024
@kyma-bot
Copy link
Contributor

kyma-bot commented Nov 4, 2024

New changes are detected. LGTM label has been removed.

@lindnerby lindnerby enabled auto-merge (squash) November 4, 2024 07:29
@lindnerby lindnerby merged commit 9a9c10e into kyma-project:main Nov 4, 2024
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indicates the PR's author has signed the CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants