Skip to content

Comments

Add endpoint to get all process configs of a given type#42

Open
FranckLecuyer wants to merge 7 commits intomainfrom
add_endpoint_to_get_all_process_configs
Open

Add endpoint to get all process configs of a given type#42
FranckLecuyer wants to merge 7 commits intomainfrom
add_endpoint_to_get_all_process_configs

Conversation

@FranckLecuyer
Copy link
Contributor

@FranckLecuyer FranckLecuyer commented Feb 16, 2026

PR Summary

New endpoint to get all the process configs of a given type

@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR introduces a new PersistedProcessConfig wrapper record and refactors process configuration retrieval across the stack to use it. A new repository for direct SecurityAnalysisConfig persistence is added, along with a new endpoint for bulk configuration retrieval by type.

Changes

Cohort / File(s) Summary
Data Model
monitor-commons/src/main/java/org/gridsuite/monitor/commons/PersistedProcessConfig.java
New public record wrapping UUID id and ProcessConfig for persistent configuration storage.
Repository Layer
monitor-server/src/main/java/org/gridsuite/monitor/server/repositories/SecurityAnalysisConfigRepository.java
New JPA repository interface for SecurityAnalysisConfigEntity CRUD operations.
Mapper
monitor-server/src/main/java/org/gridsuite/monitor/server/mapper/SecurityAnalysisConfigMapper.java
Updated toDto() method signature to return PersistedProcessConfig, wrapping SecurityAnalysisConfig with entity id.
Service Layer
monitor-server/src/main/java/org/gridsuite/monitor/server/services/ProcessConfigService.java
Constructor updated to include SecurityAnalysisConfigRepository; getProcessConfig() return type changed to Optional; new public getProcessConfigs(ProcessType) method added for bulk retrieval.
Controller Layer
monitor-server/src/main/java/org/gridsuite/monitor/server/controllers/ProcessConfigController.java
getProcessConfig() return type updated to ResponseEntity; new endpoint getProcessConfigs() added to retrieve all configs by ProcessType.
Integration & Unit Tests
monitor-server/src/test/java/org/gridsuite/monitor/server/MonitorIntegrationTest.java, ProcessConfigControllerTest.java, ProcessConfigServiceTest.java
Updated test expectations and access patterns to use PersistedProcessConfig; added new tests for bulk config retrieval; repository mocking updated.
Minor Updates
monitor-commons/src/main/java/org/gridsuite/monitor/commons/SecurityAnalysisConfig.java
Whitespace normalization only.

Sequence Diagram

sequenceDiagram
    actor Client
    participant Controller as ProcessConfigController
    participant Service as ProcessConfigService
    participant Mapper as SecurityAnalysisConfigMapper
    participant Repo as SecurityAnalysisConfigRepository
    participant DB as Database

    rect rgba(100, 150, 200, 0.5)
        Note over Client,DB: Get Single Config (Updated Flow)
        Client->>Controller: GET /process-configs/{uuid}
        Controller->>Service: getProcessConfig(uuid)
        Service->>Repo: findById(uuid)
        Repo->>DB: Query SecurityAnalysisConfigEntity
        DB-->>Repo: Entity
        Repo-->>Service: SecurityAnalysisConfigEntity
        Service->>Mapper: toDto(entity)
        Mapper-->>Service: PersistedProcessConfig(id, SecurityAnalysisConfig)
        Service-->>Controller: Optional<PersistedProcessConfig>
        Controller-->>Client: ResponseEntity<PersistedProcessConfig>
    end

    rect rgba(150, 200, 100, 0.5)
        Note over Client,DB: Get All Configs by Type (New Flow)
        Client->>Controller: GET /process-configs?processType=SECURITY_ANALYSIS
        Controller->>Service: getProcessConfigs(SECURITY_ANALYSIS)
        Service->>Repo: findAll()
        Repo->>DB: Query all SecurityAnalysisConfigEntity
        DB-->>Repo: List<Entity>
        Repo-->>Service: List<SecurityAnalysisConfigEntity>
        Service->>Mapper: toDto(entity) per entity
        Mapper-->>Service: List<PersistedProcessConfig>
        Service-->>Controller: List<PersistedProcessConfig>
        Controller-->>Client: ResponseEntity<List<PersistedProcessConfig>>
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • antoinebhs
  • klesaulnier

Poem

🐰 A wrapper worn with grace and care,
PersistedProcessConfig's now there!
IDs and configs dance in pairs,
New endpoints bloom through layered affairs.
The repository hops with spring-boot flair! 🌱

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately summarizes the main change: adding a new endpoint to retrieve all process configs of a given type.
Description check ✅ Passed The description is related to the changeset, stating the primary objective of adding an endpoint to get all process configs of a given type.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch add_endpoint_to_get_all_process_configs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@FranckLecuyer FranckLecuyer force-pushed the add_endpoint_to_get_all_process_configs branch from 63cd264 to a0fc5ca Compare February 16, 2026 15:00
@khouadrired khouadrired self-requested a review February 17, 2026 13:40
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
@FranckLecuyer FranckLecuyer force-pushed the add_endpoint_to_get_all_process_configs branch from 272392d to baec069 Compare February 20, 2026 09:54
@FranckLecuyer FranckLecuyer changed the base branch from enrich_process_config to main February 20, 2026 09:54
Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
coderabbitai[bot]

This comment was marked as outdated.

Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
coderabbitai[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
@FranckLecuyer FranckLecuyer force-pushed the add_endpoint_to_get_all_process_configs branch from a727cff to 4f3931c Compare February 20, 2026 15:36
coderabbitai[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as outdated.

Add process config wrapper object

Signed-off-by: Franck LECUYER <franck.lecuyer@rte-france.com>
@FranckLecuyer FranckLecuyer force-pushed the add_endpoint_to_get_all_process_configs branch from 33526cc to 59f0148 Compare February 23, 2026 12:53
@sonarqubecloud
Copy link

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.

3 participants