Skip to content

Partly clean ReportNode use in ValidationUtil #3353

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

flo-dup
Copy link
Collaborator

@flo-dup flo-dup commented Mar 11, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • A PR or issue has been opened in all impacted repositories (if any)

Does this PR already have an issue describing the problem?
No

What kind of change does this PR introduce?
Bug fix

What is the current behavior?
The ReportNode is used in ValidationUtil with generated keys (Validable::getMessageHeader) for message template

What is the new behavior (if this is a feature change)?
The ReportNode is used in ValidationUtil with fixed keys for a given template

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

Other information:
⚠️ The message lacks the correct information which is expected by the user: getMessageHeader usually gives the equipmentType and the equipment id. But this was already the case before, as this information was used as a template key, hence never displayed to the user. A PR will follow later to fix this, but this requires breaking changes.

@flo-dup flo-dup requested a review from alicecaron March 11, 2025 14:22
Base automatically changed from use_i18n to integration/report_node_i18n March 12, 2025 08:57
@flo-dup flo-dup force-pushed the validation_util_report_node branch from e9ad2e9 to 412f277 Compare March 12, 2025 09:02
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
78.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@flo-dup flo-dup force-pushed the integration/report_node_i18n branch from 70c192d to a6957c2 Compare March 17, 2025 16:30
Signed-off-by: Florian Dupuy <[email protected]>
Signed-off-by: CARON Alice <[email protected]>

 Conflicts:
	iidm/iidm-api/src/main/java/com/powsybl/iidm/network/util/NetworkReports.java
	iidm/iidm-modification/src/main/java/com/powsybl/iidm/modification/util/ModificationReports.java
	ucte/ucte-network/src/main/java/com/powsybl/ucte/network/util/UcteReports.java
@alicecaron alicecaron force-pushed the validation_util_report_node branch from 412f277 to a9787e0 Compare March 20, 2025 09:11
@alicecaron alicecaron changed the base branch from integration/report_node_i18n to main March 20, 2025 09:50
core.iidm.network.MoveCommonAlias = Alias ${alias} found in dangling lines ${danglingLineId1} and ${danglingLineId2} is moved to their merged line.
core.iidm.network.PropertyOnlyOnOneSide = Inconsistencies of property ${propertyName} between both sides (${danglingLineId1) on side 1 and ${danglingLineId2} on side2) of merged line. Side ${side} has no value. Value on other side is kept.
core.iidm.network.ptcPhaseRegulationFixedMode = phase regulation cannot be on if mode is FIXED
Copy link
Contributor

Choose a reason for hiding this comment

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

Start the templates with a first upper case character?

}

public static void targetDeadbandUndefinedValue(String validableType, ReportNode reportNode) {
String key = switch (validableType) {
Copy link
Contributor

@alicecaron alicecaron Apr 2, 2025

Choose a reason for hiding this comment

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

Instead of manipulating a String can we create en enum to handle all the possibilities? For instance:

public enum ValidableType {
    SHUNT_COMPENSATOR,
    PHASE_TAP_CHANGER,
    RATIO_TAP_CHANGER
}

But there are more than 3 ValidableType so maybe we need to list them all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants