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

refactor: extract Configure and Metadata framework functions into single implementation #1424

Conversation

AgustinBettati
Copy link
Member

@AgustinBettati AgustinBettati commented Aug 29, 2023

Description

Small refactor that removes boilerplate definition of Metadata and Configure functions in all our plugin-framework resources and data sources into common structs.

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contribution guidelines
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

Further comments

@AgustinBettati AgustinBettati requested a review from a team as a code owner August 29, 2023 07:36
mongodbatlas/fw_common.go Outdated Show resolved Hide resolved
mongodbatlas/fw_common.go Outdated Show resolved Hide resolved
mongodbatlas/fw_common.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@andreaangiolillo andreaangiolillo left a comment

Choose a reason for hiding this comment

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

LGTM. My comments are not blocking the PR

mongodbatlas/fw_common.go Outdated Show resolved Hide resolved
mongodbatlas/fw_common.go Outdated Show resolved Hide resolved
@@ -0,0 +1,68 @@
package mongodbatlas
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it make sense to move this struct in a subdir to make it clear that does not define a resource or ds?

Copy link
Member Author

Choose a reason for hiding this comment

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

Had looked into this but reached a limitation. When defining fw_common.go within framework package, I need to import mongodbatlas package to reference MongoDBClient. This leads to an import cycle not allowed error.

Copy link
Collaborator

@maastha maastha left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for this one!

@AgustinBettati AgustinBettati merged commit cd37419 into CLOUDP-189585-plugin-framework-migration Sep 1, 2023
17 checks passed
@AgustinBettati AgustinBettati deleted the refactor-fw-common-methods branch September 1, 2023 09:19
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.

4 participants