Skip to content

feat: handle p and q measurement modification in battery#817

Open
KoloMenek wants to merge 1 commit into
mainfrom
marutk/feat/handle_battery_p_q_measurements_modification
Open

feat: handle p and q measurement modification in battery#817
KoloMenek wants to merge 1 commit into
mainfrom
marutk/feat/handle_battery_p_q_measurements_modification

Conversation

@KoloMenek
Copy link
Copy Markdown
Member

PR Summary

Signed-off-by: Kamil MARUT <kamil.marut@rte-france.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Battery modifications now support measurement-related fields (active and reactive power values with validity flags). The entity was extended to map these fields during modification info construction, the upstream dependency version was updated, and test coverage added measurement constants, builder configuration, and validation assertions.

Changes

Battery Measurement Fields

Layer / File(s) Summary
Dependency version update
pom.xml
Network modification dependency version updated from 0.81.0 to 0.82.0-SNAPSHOT with a TODO comment indicating the version should be corrected after upstream changes.
Entity measurement field mapping
src/main/java/org/gridsuite/modification/server/entities/equipment/modification/BatteryModificationEntity.java
toBatteryModificationInfosBuilder() extended to map four new measurement attributes (pMeasurementValue, pMeasurementValidity, qMeasurementValue, qMeasurementValidity) from entity getters via toAttributeModification().
Test measurement field validation
src/test/java/org/gridsuite/modification/server/modifications/BatteryModificationTest.java
Test adds imports for measurement types, defines static constants for expected measurement values and validity flags, wires measurement fields into the modification builder, calls measurement validation from post-creation assertions, and implements assertMeasurements() helper to verify ACTIVE_POWER and REACTIVE_POWER measurement collections match expected constants.

Suggested reviewers

  • achour94
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

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.
Description check ❓ Inconclusive The description is empty and provides no information about the changeset, making it impossible to assess its relevance. Add a meaningful description explaining what the change does, why it's needed, and any important implementation details or testing notes.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: handling p (active) and q (reactive) measurement modification for batteries, which is reflected in the code changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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.

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pom.xml`:
- Line 56: Update the Maven property network-modification.version to remove the
SNAPSHOT and point to a released artifact: change the value from 0.82.0-SNAPSHOT
to a released version (e.g., 0.78.0) so builds are reproducible; ensure any
references to org.gridsuite:gridsuite-network-modification in the pom(s) use
that released version and run a quick mvn -DskipTests verify to confirm
dependency resolution succeeds before merging.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 98d86604-cd75-4613-be57-8e6ae3adb048

📥 Commits

Reviewing files that changed from the base of the PR and between 73809a3 and 67dafed.

📒 Files selected for processing (3)
  • pom.xml
  • src/main/java/org/gridsuite/modification/server/entities/equipment/modification/BatteryModificationEntity.java
  • src/test/java/org/gridsuite/modification/server/modifications/BatteryModificationTest.java

Comment thread pom.xml
<sonar.projectKey>org.gridsuite:network-modification-server</sonar.projectKey>
<!-- TODO network-modification.version remove when included in gridsuite-dependencies -->
<network-modification.version>0.81.0</network-modification.version>
<network-modification.version>0.82.0-SNAPSHOT</network-modification.version> <!-- TODO UPDATE TO CORRECT VERSION AFTER NETWORK MODIFICATION IS UPDATED -->
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 | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

What is the latest released (non-SNAPSHOT) version of Maven artifact org.gridsuite:gridsuite-network-modification, and is 0.82.0 available as a stable release?

💡 Result:

As of May 18, 2026, the latest released (non-SNAPSHOT) version of the Maven artifact org.gridsuite:gridsuite-network-modification is 0.78.0 [1]. Regarding version 0.82.0, there is no evidence that this version is available as a stable release. The official repository indicates that the latest release is v0.72.0 [2][3], and while some external indexing services reference version 0.78.0 [1], version 0.82.0 has not been identified as a released artifact.

Citations:


Remove SNAPSHOT dependency from main branch and use a released version.

Using 0.82.0-SNAPSHOT makes builds non-reproducible and can break unexpectedly when upstream republishes artifacts. The latest released version of org.gridsuite:gridsuite-network-modification is 0.78.0. Either upgrade to 0.78.0, wait for 0.82.0 to be released, or use a temporary branch-only strategy before merging.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pom.xml` at line 56, Update the Maven property network-modification.version
to remove the SNAPSHOT and point to a released artifact: change the value from
0.82.0-SNAPSHOT to a released version (e.g., 0.78.0) so builds are reproducible;
ensure any references to org.gridsuite:gridsuite-network-modification in the
pom(s) use that released version and run a quick mvn -DskipTests verify to
confirm dependency resolution succeeds before merging.

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.

1 participant