Skip to content

refactor: move modificationUuids from ProcessConfig to ModifyingProcessConfig interface#43

Merged
KoloMenek merged 1 commit intomainfrom
marutk/refactor/make_process_config_generic
Feb 26, 2026
Merged

refactor: move modificationUuids from ProcessConfig to ModifyingProcessConfig interface#43
KoloMenek merged 1 commit intomainfrom
marutk/refactor/make_process_config_generic

Conversation

@KoloMenek
Copy link
Copy Markdown
Member

PR Summary

Moved modificationUuids from ProcessConfig to ModifyingProcessConfig interface in order to make the ProcessConfig interface more generic. It is required for further developments related to SnapshotRefinerServer's connection to monitor-server

@KoloMenek KoloMenek requested a review from antoinebhs February 17, 2026 09:29
@KoloMenek KoloMenek self-assigned this Feb 17, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 17, 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

Adds a new interface ModifyingProcessConfig with modificationUuids(), removes that method from ProcessConfig, updates SecurityAnalysisConfig to implement ModifyingProcessConfig, narrows ApplyModificationsStep generics to ModifyingProcessConfig, and updates tests to cover empty and non-empty modificationUuids cases.

Changes

Cohort / File(s) Summary
Interfaces & Records
monitor-commons/src/main/java/org/gridsuite/monitor/commons/ModifyingProcessConfig.java, monitor-commons/src/main/java/org/gridsuite/monitor/commons/ProcessConfig.java, monitor-commons/src/main/java/org/gridsuite/monitor/commons/SecurityAnalysisConfig.java
Added ModifyingProcessConfig declaring List<UUID> modificationUuids(). Removed modificationUuids() from ProcessConfig. Updated SecurityAnalysisConfig to implement ModifyingProcessConfig (signature change only).
Apply Modifications step
monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStep.java
Changed generic bound from C extends ProcessConfig to C extends ModifyingProcessConfig and updated import/signature accordingly.
Tests (ApplyModificationsStep)
monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java
Replaced ProcessConfig usages with ModifyingProcessConfig in fields and generics. Added setUpReportInfos() helper, added test for empty modificationUuids() (no interactions), adjusted other tests to initialize report infos, and updated imports (added Collections).

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • khouadrired
  • antoinebhs

Poem

I twitch my whiskers, split a trait in two,
Interfaces hop, UUIDs find their queue.
Tests now check empties and lists that play,
A tidy little refactor — hop, hooray! 🐇

🚥 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 accurately describes the main refactoring: moving modificationUuids from ProcessConfig to ModifyingProcessConfig interface, which is the core change across the entire changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for moving modificationUuids and its purpose for making ProcessConfig more generic.

✏️ 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 marutk/refactor/make_process_config_generic

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.

@KoloMenek KoloMenek changed the title refactor: move modificationUuids from ProcessConfig to ModifyingProcessConfig interface Moved modificationUuids from ProcessConfig to ModifyingProcessConfig interface in order to make the ProcessConfig interface more generic. It is required for further developments related to SnapshotRefinerServer's connection to monitor-server refactor: move modificationUuids from ProcessConfig to ModifyingProcessConfig interface Feb 17, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java (1)

27-27: Redundant explicit import of Mockito.

The static wildcard import on line 35 (import static org.mockito.Mockito.*) already covers all static methods. You can replace Mockito.mock(ProcessConfig.class) on line 89 with just mock(ProcessConfig.class) and drop this import.

Proposed fix
-import org.mockito.Mockito;

And on line 89:

-        ProcessConfig processConfigMock = Mockito.mock(ProcessConfig.class);
+        ProcessConfig processConfigMock = mock(ProcessConfig.class);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java`
at line 27, Remove the redundant explicit import of org.mockito.Mockito and use
the existing static import of org.mockito.Mockito.*; replace usages like
Mockito.mock(ProcessConfig.class) in ApplyModificationsStepTest (e.g., the call
creating the ProcessConfig mock) with the shorter mock(ProcessConfig.class) so
the static import is used consistently and the explicit import can be deleted.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java`:
- Line 27: Remove the redundant explicit import of org.mockito.Mockito and use
the existing static import of org.mockito.Mockito.*; replace usages like
Mockito.mock(ProcessConfig.class) in ApplyModificationsStepTest (e.g., the call
creating the ProcessConfig mock) with the shorter mock(ProcessConfig.class) so
the static import is used consistently and the explicit import can be deleted.

@KoloMenek KoloMenek force-pushed the marutk/refactor/make_process_config_generic branch from 22145fd to 9a1cc12 Compare February 17, 2026 10:05
@@ -0,0 +1,14 @@
package org.gridsuite.monitor.commons;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing license

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java`:
- Around line 85-95: Rename the test method to reflect the actual behavior under
test: change the method name
executeDoesNothingWhenConfigNotModifyingProcessConfig to
executeDoesNothingWhenModificationUuidsEmpty in ApplyModificationsStepTest;
ensure the test still creates a ModifyingProcessConfig mock, stubs
stepContext.getConfig(), calls applyModificationsStep.execute(stepContext), and
verifies no interactions with networkModificationService,
networkModificationRestService, and filterService, and update any references
(e.g., test runner or IDE-run configurations) to the new method name so the test
suite remains discoverable; this aligns the name with the guard in
ApplyModificationsStep.execute() that checks modificationUuids().

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a1cc12 and 169bcd9.

📒 Files selected for processing (2)
  • monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStep.java
  • monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStep.java

@KoloMenek KoloMenek force-pushed the marutk/refactor/make_process_config_generic branch from 169bcd9 to b3e7fe2 Compare February 25, 2026 17:54
@KoloMenek
Copy link
Copy Markdown
Member Author

Rebased and made requested changes. Let me know if the PR looks good to you ;)

@KoloMenek KoloMenek requested a review from antoinebhs February 25, 2026 17:55
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
monitor-commons/src/main/java/org/gridsuite/monitor/commons/ModifyingProcessConfig.java (1)

12-16: Nit: Remove the blank line between the Javadoc block and the interface declaration.

Javadoc must immediately precede the element it documents; the blank line at line 15 breaks that association and is non-idiomatic Java.

♻️ Proposed fix
 /**
  * `@author` Kamil MARUT {`@literal` <kamil.marut at rte-france.com>}
  */
-
 public interface ModifyingProcessConfig extends ProcessConfig {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@monitor-commons/src/main/java/org/gridsuite/monitor/commons/ModifyingProcessConfig.java`
around lines 12 - 16, Remove the blank line between the Javadoc block and the
interface declaration so the Javadoc immediately precedes the
ModifyingProcessConfig interface; place the /** ... */ comment directly above
the "public interface ModifyingProcessConfig extends ProcessConfig {" line to
restore proper Java doc association.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@monitor-commons/src/main/java/org/gridsuite/monitor/commons/ModifyingProcessConfig.java`:
- Around line 12-16: Remove the blank line between the Javadoc block and the
interface declaration so the Javadoc immediately precedes the
ModifyingProcessConfig interface; place the /** ... */ comment directly above
the "public interface ModifyingProcessConfig extends ProcessConfig {" line to
restore proper Java doc association.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 169bcd9 and b3e7fe2.

📒 Files selected for processing (5)
  • monitor-commons/src/main/java/org/gridsuite/monitor/commons/ModifyingProcessConfig.java
  • monitor-commons/src/main/java/org/gridsuite/monitor/commons/ProcessConfig.java
  • monitor-commons/src/main/java/org/gridsuite/monitor/commons/SecurityAnalysisConfig.java
  • monitor-worker-server/src/main/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStep.java
  • monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java
💤 Files with no reviewable changes (1)
  • monitor-commons/src/main/java/org/gridsuite/monitor/commons/ProcessConfig.java
🚧 Files skipped from review as they are similar to previous changes (2)
  • monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java
  • monitor-commons/src/main/java/org/gridsuite/monitor/commons/SecurityAnalysisConfig.java

@KoloMenek KoloMenek force-pushed the marutk/refactor/make_process_config_generic branch from b3e7fe2 to b505604 Compare February 25, 2026 18:32
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java`:
- Around line 100-103: The test executeDoesNothingWhenModificationUuidsEmpty is
missing an assertion that S3 is untouched; add a no-interaction verification for
the s3Service mock (e.g., verifyNoInteractions(s3Service) or equivalent)
alongside the existing verifyNoInteractions(networkModificationService),
verifyNoInteractions(networkModificationRestService), and
verifyNoInteractions(filterService) to ensure the test fully asserts there are
no S3 side effects.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3e7fe2 and b505604.

📒 Files selected for processing (2)
  • monitor-commons/src/main/java/org/gridsuite/monitor/commons/ModifyingProcessConfig.java
  • monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • monitor-commons/src/main/java/org/gridsuite/monitor/commons/ModifyingProcessConfig.java

Comment on lines +100 to +103
verifyNoInteractions(networkModificationService);
verifyNoInteractions(networkModificationRestService);
verifyNoInteractions(filterService);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

executeDoesNothingWhenModificationUuidsEmpty should also assert no S3 side effects.

The test says “does nothing”, but it currently does not guard s3Service. Add a no-interaction assertion to fully lock the contract.

Suggested patch
         verifyNoInteractions(networkModificationService);
         verifyNoInteractions(networkModificationRestService);
         verifyNoInteractions(filterService);
+        verifyNoInteractions(s3Service);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
verifyNoInteractions(networkModificationService);
verifyNoInteractions(networkModificationRestService);
verifyNoInteractions(filterService);
}
verifyNoInteractions(networkModificationService);
verifyNoInteractions(networkModificationRestService);
verifyNoInteractions(filterService);
verifyNoInteractions(s3Service);
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@monitor-worker-server/src/test/java/org/gridsuite/monitor/worker/server/processes/commons/steps/ApplyModificationsStepTest.java`
around lines 100 - 103, The test executeDoesNothingWhenModificationUuidsEmpty is
missing an assertion that S3 is untouched; add a no-interaction verification for
the s3Service mock (e.g., verifyNoInteractions(s3Service) or equivalent)
alongside the existing verifyNoInteractions(networkModificationService),
verifyNoInteractions(networkModificationRestService), and
verifyNoInteractions(filterService) to ensure the test fully asserts there are
no S3 side effects.

@KoloMenek KoloMenek force-pushed the marutk/refactor/make_process_config_generic branch from b505604 to 44ee6df Compare February 25, 2026 18:39
Copy link
Copy Markdown
Contributor

@antoinebhs antoinebhs left a comment

Choose a reason for hiding this comment

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

Looks good to me!

…ssConfig interface

Moved modificationUuids from ProcessConfig to ModifyingProcessConfig interface in order to make the ProcessConfig interface more generic. It is required for further developments related to SnapshotRefinerServer's connection to monitor-server

Signed-off-by: Kamil MARUT <kamil.marut@rte-france.com>
@KoloMenek KoloMenek force-pushed the marutk/refactor/make_process_config_generic branch from 44ee6df to 8989ebc Compare February 26, 2026 08:21
@sonarqubecloud
Copy link
Copy Markdown

@KoloMenek KoloMenek merged commit 3b49c52 into main Feb 26, 2026
4 checks passed
@KoloMenek KoloMenek deleted the marutk/refactor/make_process_config_generic branch February 26, 2026 08:23
benrejebmoh pushed a commit that referenced this pull request Mar 4, 2026
…ssConfig interface (#43)

Moved modificationUuids from ProcessConfig to ModifyingProcessConfig interface in order to make the ProcessConfig interface more generic. It is required for further developments related to SnapshotRefinerServer's connection to monitor-server

Signed-off-by: Kamil MARUT <kamil.marut@rte-france.com>
antoinebhs added a commit that referenced this pull request Mar 12, 2026
…ingProcessConfig interface (#43)"

This reverts commit 3b49c52.
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.

2 participants