-
Notifications
You must be signed in to change notification settings - Fork 1
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: (ART-10688) refactor ckan mapper #159
Conversation
Reviewer's Guide by SourceryThis PR refactors the CKAN mapper implementation by introducing MapStruct for object mapping, improving code organization and maintainability. The changes consolidate multiple mapping utility classes into a single MapStruct-based mapper interface, while maintaining the same functionality. Class diagram for CKAN Mapper RefactorclassDiagram
class CkanMapper {
<<interface>>
+RetrievedDataset map(CkanPackage ckanPackage)
+ValueLabel map(CkanValueLabel ckanValueLabel)
+ValueLabel map(CkanTag ckanTag)
+RetrievedDistribution map(CkanResource ckanResource)
+List~SearchedDataset~ map(PackagesSearchResult result)
+SearchedDataset mapToSearchedDataset(CkanPackage ckanPackage)
+OffsetDateTime map(String date)
}
class CkanMapperImpl {
+map(CkanPackage ckanPackage)
+map(CkanValueLabel ckanValueLabel)
+map(CkanTag ckanTag)
+map(CkanResource ckanResource)
+map(PackagesSearchResult result)
+mapToSearchedDataset(CkanPackage ckanPackage)
+map(String date)
}
CkanMapper <|.. CkanMapperImpl
class CkanPackage
class RetrievedDataset
class CkanValueLabel
class ValueLabel
class CkanTag
class CkanResource
class RetrievedDistribution
class PackagesSearchResult
class SearchedDataset
class OffsetDateTime
CkanMapper --> CkanPackage
CkanMapper --> RetrievedDataset
CkanMapper --> CkanValueLabel
CkanMapper --> ValueLabel
CkanMapper --> CkanTag
CkanMapper --> CkanResource
CkanMapper --> RetrievedDistribution
CkanMapper --> PackagesSearchResult
CkanMapper --> SearchedDataset
CkanMapper --> OffsetDateTime
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jadzlnds - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
src/test/java/io/github/genomicdatainfrastructure/discovery/services/PackageShowMapperTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember we have another API call to CKAN, for fetching facet values, perhaps this also have some sort of inner mapper somewhere.
🚀 Pull Request Checklist
Title:
[ ]
A brief, descriptive title for the changes.Description:
[ ]
Provide a clear and concise description of your pull request, including the purpose of the changes and the approach you've taken.Context:
[ ]
Why are these changes necessary? What problem do they solve? Link any related issues.Changes:
[ ]
List the major changes you've made, ideally organized by commit or feature.Testing:
[ ]
Describe how the changes have been tested. Include any relevant details about the testing environment and the test cases.Screenshots (if applicable):
[ ]
If your changes are visual, include screenshots to help explain your changes.Additional Information:
[ ]
Add any other information that might be useful for reviewers, such as considerations, discussions, or dependencies.Checklist:
[ ]
I have checked that my code adheres to the project's style guidelines and that my code is well-commented.[ ]
I have performed self-review of my own code and corrected any misspellings.[ ]
I have made corresponding changes to the documentation (if applicable).[ ]
My changes generate no new warnings or errors.[ ]
I have added tests that prove my fix is effective or that my feature works.[ ]
New and existing unit tests pass locally with my changes.Summary by Sourcery
Refactor the CKAN mapper by replacing the existing PackageShowMapper and PackageSearchMapper with a new CkanMapper interface and its implementation. Update the CkanDatasetsRepository to use the new mapper. Add MapStruct as a dependency to support the new mapping functionality. Enhance test coverage by restructuring and adding new test cases for the mapper.
Enhancements:
Build: