Skip to content

Commit 97d4a9c

Browse files
authored
Merge branch 'main' into add-locationId-to-sa-result
2 parents de51e12 + f03b2ff commit 97d4a9c

File tree

12 files changed

+56
-40
lines changed

12 files changed

+56
-40
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ on:
88

99
jobs:
1010
build:
11-
uses: powsybl/github-ci/.github/workflows/build-backend-app-generic.yml@8e3547c7f6d98c23095896b6097294f22100b122
11+
uses: powsybl/github-ci/.github/workflows/build-backend-app-generic.yml@69b162754c0728d9aeb2ea568eaf47f28f60fafb
1212
with:
13-
sonarOrganization: gridsuite
14-
sonarProjectKey: org.gridsuite:security-analysis-server
1513
dockerImage: docker.io/gridsuite/security-analysis-server
1614
dockerUsername: gridsuiteci
1715
eventType: security_analysis_server_updated
1816
secrets:
1917
sonar-token: ${{ secrets.SONAR_TOKEN }}
20-
docker-token: ${{ secrets.DOCKERHUB_TOKEN }}
18+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
2119
repo-token: ${{ secrets.REPO_ACCESS_TOKEN }}

.github/workflows/patch.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ on:
99

1010
jobs:
1111
run-patch:
12-
uses: powsybl/github-ci/.github/workflows/patch-backend-app-generic.yml@8e3547c7f6d98c23095896b6097294f22100b122
12+
uses: powsybl/github-ci/.github/workflows/patch-backend-app-generic.yml@69b162754c0728d9aeb2ea568eaf47f28f60fafb
1313
with:
1414
githubappId: ${{ vars.GRIDSUITE_ACTIONS_APPID }}
15-
sonarOrganization: gridsuite
16-
sonarProjectKey: org.gridsuite:security-analysis-server
1715
dockerImage: docker.io/gridsuite/security-analysis-server
1816
dockerUsername: gridsuiteci
1917
releaseVersion: ${{ github.event.inputs.releaseVersion }}
2018
secrets:
21-
githubappPrivateKey: ${{ secrets.GRIDSUITE_ACTIONS_SECRET }}
19+
VERSIONBUMP_GHAPP_PRIVATE_KEY: ${{ secrets.VERSIONBUMP_GHAPP_PRIVATE_KEY }}
2220
sonar-token: ${{ secrets.SONAR_TOKEN }}
23-
docker-token: ${{ secrets.DOCKERHUB_TOKEN }}
21+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
2422

.github/workflows/release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,14 @@ on:
1212

1313
jobs:
1414
run-release:
15-
uses: powsybl/github-ci/.github/workflows/release-backend-app-generic.yml@8e3547c7f6d98c23095896b6097294f22100b122
15+
uses: powsybl/github-ci/.github/workflows/release-backend-app-generic.yml@69b162754c0728d9aeb2ea568eaf47f28f60fafb
1616
with:
1717
githubappId: ${{ vars.GRIDSUITE_ACTIONS_APPID }}
18-
sonarOrganization: gridsuite
19-
sonarProjectKey: org.gridsuite:security-analysis-server
2018
dockerImage: docker.io/gridsuite/security-analysis-server
2119
dockerUsername: gridsuiteci
2220
releaseVersion: ${{ github.event.inputs.releaseVersion }}
2321
gitReference: ${{ github.event.inputs.gitReference }}
2422
secrets:
25-
githubappPrivateKey: ${{ secrets.GRIDSUITE_ACTIONS_SECRET }}
23+
VERSIONBUMP_GHAPP_PRIVATE_KEY: ${{ secrets.VERSIONBUMP_GHAPP_PRIVATE_KEY }}
2624
sonar-token: ${{ secrets.SONAR_TOKEN }}
27-
docker-token: ${{ secrets.DOCKERHUB_TOKEN }}
25+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Security analysis server
22

3-
[![Actions Status](https://github.com/gridsuite/security-analysis-server/workflows/CI/badge.svg)](https://github.com/gridsuite/security-analysis-server/actions)
3+
[![Actions Status](https://github.com/gridsuite/security-analysis-server/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/gridsuite/security-analysis-server/actions)
44
[![Coverage Status](https://sonarcloud.io/api/project_badges/measure?project=org.gridsuite%3Asecurity-analysis-server&metric=coverage)](https://sonarcloud.io/component_measures?id=org.gridsuite%3Asecurity-analysis-server&metric=coverage)
55
[![MPL-2.0 License](https://img.shields.io/badge/license-MPL_2.0-blue.svg)](https://www.mozilla.org/en-US/MPL/2.0/)
66

pom.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
<parent>
1414
<groupId>com.powsybl</groupId>
1515
<artifactId>powsybl-parent-ws</artifactId>
16-
<version>21</version>
16+
<version>22</version>
1717
<relativePath/>
1818
</parent>
1919

2020
<groupId>org.gridsuite</groupId>
2121
<artifactId>gridsuite-security-analysis-server</artifactId>
22-
<version>2.14.0-SNAPSHOT</version>
22+
<version>2.18.0-SNAPSHOT</version>
2323

2424
<packaging>jar</packaging>
2525
<name>Security analysis server</name>
@@ -43,10 +43,12 @@
4343

4444
<properties>
4545
<jib.from.image>powsybl/java-dynawo:3.0.0</jib.from.image>
46-
<gridsuite-dependencies.version>38.0.0</gridsuite-dependencies.version>
46+
<gridsuite-dependencies.version>39.0.0</gridsuite-dependencies.version>
4747
<liquibase-hibernate-package>org.gridsuite.securityanalysis.server</liquibase-hibernate-package>
4848
<db-util.version>1.0.5</db-util.version>
4949
<mockwebserver3.version>5.0.0-alpha.14</mockwebserver3.version>
50+
<sonar.organization>gridsuite</sonar.organization>
51+
<sonar.projectKey>org.gridsuite:security-analysis-server</sonar.projectKey>
5052
</properties>
5153

5254
<build>

src/main/java/org/gridsuite/securityanalysis/server/SecurityAnalysisController.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -193,19 +193,11 @@ public ResponseEntity<byte[]> getNmKContraintsResultZippedCsv(@Parameter(descrip
193193
.body(securityAnalysisResultService.findNmKConstraintsResultZippedCsv(resultUuid, csvTranslations));
194194
}
195195

196-
@DeleteMapping(value = "/results/{resultUuid}", produces = APPLICATION_JSON_VALUE)
197-
@Operation(summary = "Delete a security analysis result from the database")
198-
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "The security analysis result has been deleted")})
199-
public ResponseEntity<Void> deleteResult(@Parameter(description = "Result UUID") @PathVariable("resultUuid") UUID resultUuid) {
200-
securityAnalysisService.deleteResult(resultUuid);
201-
return ResponseEntity.ok().build();
202-
}
203-
204196
@DeleteMapping(value = "/results", produces = APPLICATION_JSON_VALUE)
205197
@Operation(summary = "Delete all security analysis results from the database")
206198
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "All security analysis results have been deleted")})
207-
public ResponseEntity<Void> deleteResults() {
208-
securityAnalysisService.deleteResults();
199+
public ResponseEntity<Void> deleteResults(@Parameter(description = "Results UUID") @RequestParam(value = "resultsUuids", required = false) List<UUID> resultsUuids) {
200+
securityAnalysisService.deleteResults(resultsUuids);
209201
return ResponseEntity.ok().build();
210202
}
211203

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Copyright (c) 2025, RTE (http://www.rte-france.com)
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6+
* SPDX-License-Identifier: MPL-2.0
7+
*/
8+
package org.gridsuite.securityanalysis.server.report;
9+
10+
import com.google.auto.service.AutoService;
11+
import com.powsybl.commons.report.ReportResourceBundle;
12+
13+
/**
14+
* @author Charly Boutier {@literal <charly.boutier at rte-france.com>}
15+
*/
16+
@AutoService(ReportResourceBundle.class)
17+
public final class SecurityAnalysisServerReportResourceBundle implements ReportResourceBundle {
18+
19+
public static final String BASE_NAME = "org.gridsuite.securityanalysis.server.reports";
20+
21+
public String getBaseName() {
22+
return BASE_NAME;
23+
}
24+
}

src/main/java/org/gridsuite/securityanalysis/server/service/SecurityAnalysisWorkerService.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,13 @@ private static void logContingencyEquipmentsNotFound(SecurityAnalysisRunContext
228228
}
229229

230230
ReportNode elementsNotFoundSubReporter = runContext.getReportNode().newReportNode()
231-
.withMessageTemplate("notFoundEquipments", "Equipments not found")
231+
.withMessageTemplate("security.analysis.server.notFoundEquipments")
232232
.add();
233233

234234
contingencyInfosList.forEach(contingencyInfos -> {
235235
String elementsIds = String.join(", ", contingencyInfos.getNotFoundElements());
236236
elementsNotFoundSubReporter.newReportNode()
237-
.withMessageTemplate("contingencyEquipmentNotFound",
238-
"Cannot find the following equipments ${elementsIds} in contingency ${contingencyId}")
237+
.withMessageTemplate("security.analysis.server.contingencyEquipmentNotFound")
239238
.withUntypedValue("elementsIds", elementsIds)
240239
.withUntypedValue("contingencyId", contingencyInfos.getId())
241240
.withSeverity(TypedValue.WARN_SEVERITY)
@@ -252,14 +251,13 @@ private void logContingencyEquipmentsNotConnected(SecurityAnalysisRunContext run
252251
}
253252

254253
ReportNode elementsNotConnectedSubReporter = runContext.getReportNode().newReportNode()
255-
.withMessageTemplate("notConnectedEquipments", "Equipments not connected")
254+
.withMessageTemplate("security.analysis.server.notConnectedEquipments")
256255
.add();
257256

258257
contingencyInfosList.forEach(contingencyInfos -> {
259258
String elementsIds = String.join(", ", contingencyInfos.getNotConnectedElements());
260259
elementsNotConnectedSubReporter.newReportNode()
261-
.withMessageTemplate("contingencyEquipmentNotConnected",
262-
"The following equipments ${elementsIds} in contingency ${contingencyId} are not connected")
260+
.withMessageTemplate("security.analysis.server.contingencyEquipmentNotConnected")
263261
.withUntypedValue("elementsIds", elementsIds)
264262
.withUntypedValue("contingencyId", contingencyInfos.getId())
265263
.withSeverity(TypedValue.WARN_SEVERITY)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
security.analysis.server.notFoundEquipments = Equipments not found
2+
security.analysis.server.contingencyEquipmentNotFound = Cannot find the following equipments ${elementsIds} in contingency ${contingencyId}
3+
security.analysis.server.notConnectedEquipments = Equipments not connected
4+
security.analysis.server.contingencyEquipmentNotConnected = The following equipments ${elementsIds} in contingency ${contingencyId} are not connected
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)