GenomicDataInfrastructure / gdi-userportal-dataset-discovery-service

0 stars 1 forks source link

chore: promote main changes #163

Closed brunopacheco1 closed 2 days ago

brunopacheco1 commented 2 days ago

Summary by Sourcery

Promote changes from the main branch, including refactoring CKAN-related components, updating dependencies, and enhancing the build and deployment setup. Add new tests and remove obsolete code related to organization queries.

Enhancements:

Build:

CI:

Deployment:

Tests:

Chores:

sourcery-ai[bot] commented 2 days ago

Reviewer's Guide by Sourcery

This pull request implements significant refactoring to modernize the codebase, primarily focusing on introducing MapStruct for object mapping, reorganizing filter-related functionality, and cleaning up unused code. The changes improve code maintainability and introduce new filter value retrieval capabilities.

Class diagram for CkanDatasetsMapper and CkanFilterMapper

classDiagram
    class CkanDatasetsMapper {
        +RetrievedDataset map(CkanPackage ckanPackage)
        +ValueLabel map(CkanValueLabel ckanValueLabel)
        +ValueLabel map(CkanTag ckanTag)
        +RetrievedDistribution map(CkanResource ckanResource)
        +List<SearchedDataset> map(PackagesSearchResult result)
    }
    class CkanFilterMapper {
        +List<ValueLabel> map(PackagesSearchResponse packagesSearchResponse, String key)
        +List<ValueLabel> map(Map<String, CkanFacet> ckanFacets, String key)
        +List<ValueLabel> map(CkanFacet ckanFacet)
        +List<ValueLabel> map(List<CkanValueLabel> items)
        +ValueLabel map(CkanValueLabel valueLabel)
    }

Class diagram for RetrieveFiltersValuesQuery and CkanFiltersRepository

classDiagram
    class RetrieveFiltersValuesQuery {
        -FiltersRepository filtersRepository
        +List<ValueLabel> execute(String key)
    }
    class CkanFiltersRepository {
        -CkanQueryApi ckanQueryApi
        -CkanFilterMapper ckanFilterMapper
        +List<ValueLabel> getValuesForFilter(String key)
    }

File-Level Changes

Change Details Files
Introduced MapStruct for object mapping
  • Created CkanDatasetsMapper interface with MapStruct annotations for dataset mapping
  • Added CkanFilterMapper for handling filter value mapping
  • Implemented comprehensive unit tests for the new mappers
src/main/java/io/github/genomicdatainfrastructure/discovery/datasets/infrastructure/ckan/mapper/CkanDatasetsMapper.java
src/main/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/mapper/CkanFilterMapper.java
src/test/java/io/github/genomicdatainfrastructure/discovery/datasets/infrastructure/ckan/mapper/CkanDatasetsMapperTest.java
src/test/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/mapper/CkanFilterMapperTest.java
Added new filter values retrieval functionality
  • Created new endpoint for retrieving filter values
  • Implemented FiltersRepository interface and CkanFiltersRepository
  • Added RetrieveFiltersValuesQuery use case
  • Created integration and unit tests for filter values retrieval
src/main/java/io/github/genomicdatainfrastructure/discovery/filters/application/ports/FiltersRepository.java
src/main/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/ckan/CkanFiltersRepository.java
src/main/java/io/github/genomicdatainfrastructure/discovery/filters/application/usecases/RetrieveFiltersValuesQuery.java
src/test/java/io/github/genomicdatainfrastructure/discovery/filters/infrastructure/quarkus/RetrieveFiltersValuesQueryTest.java
Removed deprecated organization-related code
  • Removed organization API implementation
  • Deleted organization repository and related classes
  • Removed organization query use case
src/main/java/io/github/genomicdatainfrastructure/discovery/api/OrganizationQueryApiImpl.java
src/main/java/io/github/genomicdatainfrastructure/discovery/datasets/application/ports/OrganizationsRepository.java
src/main/java/io/github/genomicdatainfrastructure/discovery/datasets/infrastructure/ckan/persistence/CkanOrganizationsRepository.java
Updated infrastructure configuration
  • Added Docker Compose setup for local development
  • Created scripts for starting and stopping the application
  • Updated GitHub workflow configurations
  • Updated dependencies and Quarkus version
infra/docker-compose.yml
infra/start.sh
infra/stop.sh
.github/workflows/main.yml
.github/workflows/release.yml
.github/workflows/test.yml
pom.xml

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).