Skip to content

Commit 9c4d53c

Browse files
committed
FIX : Rename a rule #128
1 parent b10198b commit 9c4d53c

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

runtime/docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ services:
88
mongo:
99
image: "mongo:6.0"
1010
container_name: mongo
11+
networks:
12+
- eh-network
1113
# uncomment to expose mongodb on localhost:27017
1214
# ports:
1315
# - 27017:27017
@@ -28,6 +30,11 @@ services:
2830
memlock:
2931
soft: -1
3032
hard: -1
33+
ports:
34+
- 9200:9200
35+
networks:
36+
- eh-network
37+
3138

3239
# Graylog: https://hub.docker.com/r/graylog/graylog/
3340
graylog:
@@ -58,4 +65,11 @@ services:
5865
healthcheck:
5966
test: curl --head --fail http://localhost:9000 || exit 1
6067
start_period: 60s
68+
networks:
69+
- eh-network
70+
71+
networks:
72+
eh-network:
73+
name: eh-network
74+
driver: bridge
6175

src/main/java/com/airbus_cyber_security/graylog/wizard/alert/rest/AlertRuleResource.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,14 +456,14 @@ public Response update(@ApiParam(name = TITLE, required = true)
456456
String notificationIdentifier = previousAlert.getNotificationID();
457457
String userName = getCurrentUser().getName();
458458

459-
this.notificationService.updateNotification(title, notificationIdentifier);
459+
this.notificationService.updateNotification(request.getTitle(), notificationIdentifier);
460460

461461
AlertType previousAlertType = previousAlert.getAlertType();
462462
AlertPattern pattern = updateAlertPattern(previousAlert.pattern(), notificationIdentifier, request,
463-
previousAlertType, title, userContext, userName);
463+
previousAlertType, request.getTitle(), userContext, userName);
464464

465465
AlertRule alertRule = AlertRule.create(
466-
title,
466+
request.getTitle(),
467467
request.getConditionType(),
468468
pattern,
469469
previousAlert.getNotificationID(),

src/web/wizard/pages/UpdateAlertPage.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const UpdateAlertPage = ({params}) => {
5656

5757
const _update = (alert) => {
5858
// TODO simplify parameters here (only one necessary and the code in AlertRuleStore)
59-
AlertRuleActions.update(alert.title, alert).then((response) => {
59+
AlertRuleActions.update(params.alertRuleTitle, alert).then((response) => {
6060
if (response !== true) {
6161
return;
6262
}

validation/tests_fast.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,3 +528,10 @@ def test_create_alert_with_disable_state_should_have_disabled_stream__issue138(s
528528

529529
response = self._api.get_stream(create_response['stream']['id'])
530530
self.assertEqual(True, response.json()['disabled'])
531+
532+
def test_update_alert_rule_title_should_not_fail__issue128(self):
533+
title = 'title_to_update'
534+
rule = self._api.create_alert_rule_count(title, _PERIOD)
535+
response = self._graylog.update_alert_rule(title, {**rule, 'title': 'updated_title'}).json()
536+
537+
self.assertEqual('updated_title', response['title'])

0 commit comments

Comments
 (0)