Skip to content
Closed

Wff #73

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions monitor-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<properties>
<liquibase-hibernate-package>org.gridsuite.monitor.server</liquibase-hibernate-package>
<spring-cloud-aws-starter-s3>3.3.1</spring-cloud-aws-starter-s3>
<mapstruct.version>1.6.3</mapstruct.version>
<lombok-mapstruct-bindings.version>0.2.0</lombok-mapstruct-bindings.version>
</properties>

<build>
Expand All @@ -29,6 +31,28 @@
</classpathDependencyExcludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<parameters>${maven.compiler.parameters}</parameters>
<annotationProcessorPaths combine.children="append">
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-mapstruct-binding</artifactId>
<version>${lombok-mapstruct-bindings.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.gridsuite.monitor.worker.server.dto.parameters.securityanalysis.SecurityAnalysisInputData;
import org.gridsuite.monitor.worker.server.process.securityanalysis.SecurityAnalysisStepType;
import org.gridsuite.monitor.worker.server.clients.SecurityAnalysisRestClient;
import org.gridsuite.monitor.worker.server.report.MonitorWorkerServerReportResourceBundle;
import org.gridsuite.monitor.worker.server.services.SecurityAnalysisParametersService;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -62,7 +61,6 @@ public void execute(ProcessStepExecutionContext<SecurityAnalysisConfig> context)
context.setResultInfos(resultInfos);
} catch (Exception e) {
reportNode.newReportNode()
.withResourceBundles(MonitorWorkerServerReportResourceBundle.BASE_NAME)
.withMessageTemplate("monitor.worker.server.securityanalysis.step.error")
.withUntypedValue("errorMessage", e.getMessage())
.withSeverity(TypedValue.ERROR_SEVERITY)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/**
* Copyright (c) 2026, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package org.gridsuite.monitor.worker.server.report;

import com.powsybl.commons.report.ReportResourceBundle;
import org.junit.jupiter.api.Test;

import java.util.ResourceBundle;
import java.util.ServiceLoader;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatNoException;

/**
* @author Antoine Bouhours <antoine.bouhours at rte-france.com>
*/
class MonitorWorkerServerReportResourceBundleTest {

@Test
void reportResourceBundleIsRegisteredViaAutoService() {
ServiceLoader<ReportResourceBundle> loader = ServiceLoader.load(ReportResourceBundle.class);

assertThat(loader).anyMatch(MonitorWorkerServerReportResourceBundle.class::isInstance);
}

@Test
void reportBundleIsFound() {
assertThatNoException().isThrownBy(() ->
ResourceBundle.getBundle(MonitorWorkerServerReportResourceBundle.BASE_NAME)
);
}
}
30 changes: 3 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@
<properties>
<gridsuite-dependencies.version>49.0.0</gridsuite-dependencies.version>
<sonar.organization>gridsuite</sonar.organization>
<sonar.projectKey>org.gridsuite:monitor-core</sonar.projectKey>
<mapstruct.version>1.6.3</mapstruct.version>
<lombok-mapstruct-bindings.version>0.2.0</lombok-mapstruct-bindings.version>
<sonar.projecttetedddKey>org.gridsuite:monitor-core</sonar.projecttetedddKey>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Restore the recognized Sonar property name.

Line 45 uses sonar.projecttetedddKey, which Sonar ignores. That makes the scanner fall back to org.gridsuite:gridsuite-monitor-core, matching the failing CI in this PR, so analysis stays broken until this is renamed back to sonar.projectKey.

🔧 Proposed fix
-        <sonar.projecttetedddKey>org.gridsuite:monitor-core</sonar.projecttetedddKey>
+        <sonar.projectKey>org.gridsuite:monitor-core</sonar.projectKey>
📝 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
<sonar.projecttetedddKey>org.gridsuite:monitor-core</sonar.projecttetedddKey>
<sonar.projectKey>org.gridsuite:monitor-core</sonar.projectKey>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pom.xml` at line 45, The pom.xml contains a misspelled Sonar property element
<sonar.projecttetedddKey> which Sonar ignores; replace that element name with
the correct <sonar.projectKey> so the project identifier becomes
org.gridsuite:monitor-core (leave the element value unchanged), ensuring the
Sonar scanner picks up the intended project key.

</properties>

wxx
<dependencyManagement>
<dependencies>
<dependencies>dqdf
<dependency>
<groupId>org.gridsuite</groupId>
<artifactId>gridsuite-dependencies</artifactId>
Expand Down Expand Up @@ -85,28 +83,6 @@
</classpathDependencyExcludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<parameters>${maven.compiler.parameters}</parameters>
<annotationProcessorPaths combine.children="append">
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${mapstruct.version}</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-mapstruct-binding</artifactId>
<version>${lombok-mapstruct-bindings.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down