2923 monitoring events in einklang mit erfassungteams bringen#3130
2923 monitoring events in einklang mit erfassungteams bringen#3130CNoehm wants to merge 11 commits into
Conversation
…d Ergebnismeldung einzubauen bzw. zu ersetzen.
…-in-einklang-mit-erfassungteams-bringen
EAI Service Wahllokalzustand Entity mit neuer teamID. Monitoring Service muss TeamId annehmen und weiterleiten - Service/Controller angepasst bei lastSeen/logout. GUI-Wahllokalsystem übergibt TeamId bei lastSeen- und logout-Calls. Tests überall entsprechend angepasst/erweitert für TeamId. Open-API-Spec von Auth auf release statt snapshot Version, da verfügbar.
…vice. Tests entsprechend angepasst und Verknüpfung im Monitoring-Service angepasst.
…Http-Requests angepasst.
…-in-einklang-mit-erfassungteams-bringen # Conflicts: # wls-eai-service/pom.xml
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe change introduces team-aware Estimated code review effort: 4 (Complex) | ~60 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
wls-monitoring-service/src/test/java/de/muenchen/oss/wahllokalsystem/monitoringservice/configuration/SecurityConfigurationTest.java (1)
126-135: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate request paths in anonymous user tests.
The successful authorization tests below were correctly updated to use query parameters instead of path variables for the
/lastSeenand/letzteAbmeldungendpoints. However, the anonymous user tests still use the old path-variable format (e.g.,/businessActions/lastSeen/wahlbezirkID). While these tests might still pass due to broad security constraints returning a 401 for any unauthenticated request, they no longer accurately represent or test the real endpoints.🐛 Proposed fix for the test paths
- api.perform(post("/businessActions/lastSeen/wahlbezirkID").with(csrf())) + api.perform(post("/businessActions/lastSeen").with(csrf())) .andExpect(status().isUnauthorized()); } `@Test` `@WithAnonymousUser` void should_return401Unauthorized_when_postletzteAbmeldungWithUnauthorizedAnonymousUser() throws Exception { - api.perform(post("/businessActions/letzteAbmeldung/wahlbezirkID").with(csrf())) + api.perform(post("/businessActions/letzteAbmeldung").with(csrf())) .andExpect(status().isUnauthorized()); }🤖 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 `@wls-monitoring-service/src/test/java/de/muenchen/oss/wahllokalsystem/monitoringservice/configuration/SecurityConfigurationTest.java` around lines 126 - 135, Update the anonymous-user tests around should_return401Unauthorized_when_postletzteAbmeldungWithUnauthorizedAnonymousUser and the corresponding lastSeen test to use the current query-parameter request paths for /businessActions/lastSeen and /businessActions/letzteAbmeldung, matching the successful authorization tests while preserving the expected 401 responses.
🧹 Nitpick comments (3)
wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/rest/wahllokalzustand/WahllokalzustandController.java (1)
47-50: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove redundant
@Validannotations. Both controller methods annotate theString wahlbezirkIDparameter with@Valid. Since the controller is not annotated with@Validatedand there are no constraint annotations like@NotBlankpresent on the parameter, these@Validannotations have no effect. The required validation is already handled programmatically in the service layer.
wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/rest/wahllokalzustand/WahllokalzustandController.java#L47-L50: remove@Validfrom thewahlbezirkIDparameter.wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/rest/wahllokalzustand/WahllokalzustandController.java#L63-L66: remove@Validfrom thewahlbezirkIDparameter.🤖 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 `@wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/rest/wahllokalzustand/WahllokalzustandController.java` around lines 47 - 50, Remove the redundant `@Valid` annotation from the wahlbezirkID parameter in both controller methods at WahllokalzustandController.java lines 47-50 and 63-66. Keep the existing parameter types and service-layer validation unchanged.wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/client/wahllokalzustand/WahllokalZustandClientImpl.java (1)
39-40: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd missing
finalmodifier to method parameters. BothpostLastSeenandpostLetzteAbmeldungare missing thefinalmodifier on some parameters, which is inconsistent with the rest of the method signatures.
wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/client/wahllokalzustand/WahllokalZustandClientImpl.java#L39-L40: addfinaltozuletztGeseheninpostLastSeen.wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/client/wahllokalzustand/WahllokalZustandClientImpl.java#L53-L54: addfinaltowahlbezirkIDandletzteAbmeldunginpostLetzteAbmeldung.🤖 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 `@wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/client/wahllokalzustand/WahllokalZustandClientImpl.java` around lines 39 - 40, Add the missing final modifiers to the parameters of WahllokalZustandClientImpl.postLastSeen and postLetzteAbmeldung: mark zuletztGesehen final in the postLastSeen declaration, and mark wahlbezirkID and letzteAbmeldung final in postLetzteAbmeldung. Apply these changes at both specified sites in the same file.wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandService.java (1)
24-25: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAdd missing spaces before
andin SpEL expressions. BothpostLastSeenandpostLetzteAbmeldunghave@PreAuthorizeannotations with missing spaces before theandoperator (e.g.,)'and'). While the Spring expression parser handles this gracefully, adding a space improves readability and prevents potential parsing issues in the future.
wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandService.java#L24-L25: add a space beforeand@bezirkIdPermissionEvaluator...andand@teamIDPermissionEvaluator...inpostLastSeen.wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandService.java#L41-L42: add a space beforeand@bezirkIdPermissionEvaluator...andand@teamIDPermissionEvaluator...inpostLetzteAbmeldung.🤖 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 `@wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandService.java` around lines 24 - 25, Update the `@PreAuthorize` expressions on postLastSeen and postLetzteAbmeldung to include spaces before both and operators preceding the bezirkIdPermissionEvaluator and teamIDPermissionEvaluator checks. Apply this formatting fix at wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandService.java lines 24-25 and 41-42.
🤖 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 `@docs/src/services/backend-services/eai-service/index.md`:
- Around line 54-56: Update the HTTP method documentation for the three
wahllokalzustand endpoints in the service documentation table from GET to POST,
preserving their paths, query parameters, and mapped action.
In
`@wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahllokalzustand/WahlbezirkUndTeamID.java`:
- Around line 13-15: Update the `@Size` constraints on the wahlbezirkID and teamID
fields in WahlbezirkUndTeamID to max 36, matching their database VARCHAR/UUID
representation. Preserve the existing nullability annotations and field types.
In
`@wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/service/wahllokalZustand/WahllokalZustandService.java`:
- Around line 48-54: Handle invalid UUID input in both
setWahllokalZustandLastSeen and setWahllokalZustandLetzteAbmeldung by wrapping
UUID.fromString(wahlbezirkID) in try-catch and throwing
exceptionFactory.createFachlicheWlsException(ExceptionConstants.ID_NICHT_KONVERTIERBAR)
on IllegalArgumentException. Apply this change at both affected sites in
wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/service/wahllokalZustand/WahllokalZustandService.java:48-54
and :73-79.
In
`@wls-eai-service/src/test/java/de/muenchen/oss/wahllokalsystem/eaiservice/service/wahllokalZustand/WahllokalZustandServiceSecurityTest.java`:
- Around line 87-95: Update the test method
should_notThrowAnyException_when_allAuthoritiesAreGiven inside
SetWahllokalZustandLetzteAbmeldung to invoke
wahllokalZustandService.setWahllokalZustandLetzteAbmeldung instead of
setWahllokalZustandLastSeen, preserving the existing authorization assertion and
arguments.
In
`@wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/rest/wahllokalzustand/WahllokalZustandController.java`:
- Around line 30-36: Update the `@RequestParam` declarations in postLastSeen and
postLetzteAbmeldung to be optional with an appropriate null/default value,
allowing the existing validator to handle both missing and blank wahlbezirkID
and teamID inputs. Preserve the existing *_SUCHKRITERIEN_UNVOLLSTAENDIG 400
response path.
In
`@wls-monitoring-service/src/test/java/de/muenchen/oss/wahllokalsystem/monitoringservice/rest/wahllokalzustand/WahllokalZustandControllerIntegrationTest.java`:
- Around line 59-75: Correct the request URL in
should_notThrowAnyException_when_requestParamValid so it targets the
controller’s /businessActions/lastSeen mapping without the duplicated /lastSeen
segment. Keep the existing query parameters, CSRF setup, JWT claims, and
assertion unchanged.
---
Outside diff comments:
In
`@wls-monitoring-service/src/test/java/de/muenchen/oss/wahllokalsystem/monitoringservice/configuration/SecurityConfigurationTest.java`:
- Around line 126-135: Update the anonymous-user tests around
should_return401Unauthorized_when_postletzteAbmeldungWithUnauthorizedAnonymousUser
and the corresponding lastSeen test to use the current query-parameter request
paths for /businessActions/lastSeen and /businessActions/letzteAbmeldung,
matching the successful authorization tests while preserving the expected 401
responses.
---
Nitpick comments:
In
`@wls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/rest/wahllokalzustand/WahllokalzustandController.java`:
- Around line 47-50: Remove the redundant `@Valid` annotation from the
wahlbezirkID parameter in both controller methods at
WahllokalzustandController.java lines 47-50 and 63-66. Keep the existing
parameter types and service-layer validation unchanged.
In
`@wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/client/wahllokalzustand/WahllokalZustandClientImpl.java`:
- Around line 39-40: Add the missing final modifiers to the parameters of
WahllokalZustandClientImpl.postLastSeen and postLetzteAbmeldung: mark
zuletztGesehen final in the postLastSeen declaration, and mark wahlbezirkID and
letzteAbmeldung final in postLetzteAbmeldung. Apply these changes at both
specified sites in the same file.
In
`@wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandService.java`:
- Around line 24-25: Update the `@PreAuthorize` expressions on postLastSeen and
postLetzteAbmeldung to include spaces before both and operators preceding the
bezirkIdPermissionEvaluator and teamIDPermissionEvaluator checks. Apply this
formatting fix at
wls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandService.java
lines 24-25 and 41-42.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cdb1d686-c709-4d0d-a1b6-3662f0efe895
📒 Files selected for processing (62)
docs/src/services/backend-services/eai-service/index.mdwls-eai-service/pom.xmlwls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahllokalzustand/WahlbezirkUndTeamID.javawls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/domain/wahllokalzustand/WahllokalZustand.javawls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/exception/ExceptionConstants.javawls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/rest/wahllokalzustand/WahllokalzustandController.javawls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/service/wahllokalZustand/WahllokalZustandMapper.javawls-eai-service/src/main/java/de/muenchen/oss/wahllokalsystem/eaiservice/service/wahllokalZustand/WahllokalZustandService.javawls-eai-service/src/main/resources/db/migrations/h2/V19_0__addTeamIDToWahllokalzustand.sqlwls-eai-service/src/main/resources/db/migrations/oracle/V19_0__addTeamIDToWahllokalzustand.sqlwls-eai-service/src/test/java/de/muenchen/oss/wahllokalsystem/eaiservice/configuration/SecurityConfigurationTest.javawls-eai-service/src/test/java/de/muenchen/oss/wahllokalsystem/eaiservice/service/wahllokalZustand/WahllokalZustandMapperTest.javawls-eai-service/src/test/java/de/muenchen/oss/wahllokalsystem/eaiservice/service/wahllokalZustand/WahllokalZustandServiceSecurityTest.javawls-eai-service/src/test/java/de/muenchen/oss/wahllokalsystem/eaiservice/service/wahllokalZustand/WahllokalZustandServiceTest.javawls-eai-service/src/test/resources/httpRequests/wahllokalZustand.httpwls-ergebnismeldung-service/pom.xmlwls-ergebnismeldung-service/src/main/java/de/muenchen/oss/wahllokalsystem/ergebnismeldungservice/security/DummyTeamIDPermissionEvaluatorImpl.javawls-ergebnismeldung-service/src/main/java/de/muenchen/oss/wahllokalsystem/ergebnismeldungservice/security/TeamIDPermissionEvaluator.javawls-ergebnismeldung-service/src/main/java/de/muenchen/oss/wahllokalsystem/ergebnismeldungservice/security/TeamIDPermissionEvaluatorImpl.javawls-ergebnismeldung-service/src/test/java/de/muenchen/oss/wahllokalsystem/ergebnismeldungservice/security/DummyTeamIDPermissionEvaluatorImplTest.javawls-ergebnismeldung-service/src/test/java/de/muenchen/oss/wahllokalsystem/ergebnismeldungservice/security/TeamIDPermissionEvaluatorImplTest.javawls-ergebnismeldung-service/src/test/java/de/muenchen/oss/wahllokalsystem/ergebnismeldungservice/service/stimmzettelerfassung/stimmzettel/StimmzettelServiceSecurityTest.javawls-gui-wahllokalsystem/package.jsonwls-gui-wahllokalsystem/src/api/wls-clients/generated-auth-api/api.tswls-gui-wahllokalsystem/src/api/wls-clients/generated-auth-api/base.tswls-gui-wahllokalsystem/src/api/wls-clients/generated-auth-api/common.tswls-gui-wahllokalsystem/src/api/wls-clients/generated-auth-api/configuration.tswls-gui-wahllokalsystem/src/api/wls-clients/generated-auth-api/index.tswls-gui-wahllokalsystem/src/api/wls-clients/generated-monitoring-api/api.tswls-gui-wahllokalsystem/src/api/wls-clients/generated-monitoring-api/base.tswls-gui-wahllokalsystem/src/api/wls-clients/generated-monitoring-api/common.tswls-gui-wahllokalsystem/src/api/wls-clients/generated-monitoring-api/configuration.tswls-gui-wahllokalsystem/src/api/wls-clients/generated-monitoring-api/index.tswls-gui-wahllokalsystem/src/components/wlsComponents/TheWlsAppBar.vuewls-gui-wahllokalsystem/src/composables/monitoring/monitoringService.tswls-gui-wahllokalsystem/src/composables/user/logoutOnInactivity.tswls-gui-wahllokalsystem/src/composables/user/logoutService.tswls-gui-wahllokalsystem/src/resources/openapis/openapi.auth.0.9.0-SNAPSHOT.jsonwls-gui-wahllokalsystem/src/resources/openapis/openapi.auth.0.9.0.jsonwls-gui-wahllokalsystem/src/resources/openapis/openapi.monitoring.0.2.0.jsonwls-gui-wahllokalsystem/src/resources/openapis/openapi.monitoring.0.3.18-SNAPSHOT.jsonwls-gui-wahllokalsystem/src/stores/onlineOfflineStore.tswls-gui-wahllokalsystem/tests/composables/monitoring/monitoringService.spec.tswls-gui-wahllokalsystem/tests/composables/user/logoutOnInactivity.spec.tswls-gui-wahllokalsystem/tests/composables/user/logoutService.spec.tswls-gui-wahllokalsystem/tests/stores/onlineOfflineStore.spec.tswls-monitoring-service/pom.xmlwls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/client/common/DummyClientImpl.javawls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/client/wahllokalzustand/WahllokalZustandClientImpl.javawls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/rest/wahllokalzustand/WahllokalZustandController.javawls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandClient.javawls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandService.javawls-monitoring-service/src/main/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandValidator.javawls-monitoring-service/src/main/resources/openapis/openapi.eai.0.10.0-SNAPSHOT.jsonwls-monitoring-service/src/main/resources/openapis/openapi.eai.0.8.6.jsonwls-monitoring-service/src/test/java/de/muenchen/oss/wahllokalsystem/monitoringservice/client/wahllokalzustand/WahllokalZustandClientImplTest.javawls-monitoring-service/src/test/java/de/muenchen/oss/wahllokalsystem/monitoringservice/configuration/SecurityConfigurationTest.javawls-monitoring-service/src/test/java/de/muenchen/oss/wahllokalsystem/monitoringservice/rest/wahllokalzustand/WahllokalZustandControllerIntegrationTest.javawls-monitoring-service/src/test/java/de/muenchen/oss/wahllokalsystem/monitoringservice/rest/wahllokalzustand/WahllokalZustandControllerTest.javawls-monitoring-service/src/test/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandServiceSecurityTest.javawls-monitoring-service/src/test/java/de/muenchen/oss/wahllokalsystem/monitoringservice/service/wahllokalzustand/WahllokalZustandServiceTest.javawls-monitoring-service/src/test/resources/http.request/wahllokalzustand.http
💤 Files with no reviewable changes (8)
- wls-ergebnismeldung-service/src/test/java/de/muenchen/oss/wahllokalsystem/ergebnismeldungservice/security/TeamIDPermissionEvaluatorImplTest.java
- wls-gui-wahllokalsystem/src/resources/openapis/openapi.auth.0.9.0-SNAPSHOT.json
- wls-ergebnismeldung-service/src/main/java/de/muenchen/oss/wahllokalsystem/ergebnismeldungservice/security/TeamIDPermissionEvaluatorImpl.java
- wls-ergebnismeldung-service/src/main/java/de/muenchen/oss/wahllokalsystem/ergebnismeldungservice/security/TeamIDPermissionEvaluator.java
- wls-gui-wahllokalsystem/src/resources/openapis/openapi.monitoring.0.2.0.json
- wls-ergebnismeldung-service/src/test/java/de/muenchen/oss/wahllokalsystem/ergebnismeldungservice/security/DummyTeamIDPermissionEvaluatorImplTest.java
- wls-ergebnismeldung-service/src/main/java/de/muenchen/oss/wahllokalsystem/ergebnismeldungservice/security/DummyTeamIDPermissionEvaluatorImpl.java
- wls-monitoring-service/src/main/resources/openapis/openapi.eai.0.8.6.json
Beschreibung:
Endpunkte für letzte Abmeldung und lastSeen im Monitoring-Service und EAI-Service, die TeamId, Wahlbezirk und Zeitpunkt übergeben als Query-Params.
AuthService SNAPSHOT-openapi-Spec durch aktuelle Release-Version ersetzt.
Definition of Done (DoD):
Backend
Naming Conventions beachtetDokumentation
Links geprüftFrontend
Naming Conventions beachtetDoku aktualisiertUnit-Tests gepflegtTexte auf Rechtschreibung und Grammatik geprüftTexte auf gendergerechte Sprache geprüftReferenzen1:
Closes #2923
Summary by CodeRabbit
New Features
API Updates
Documentation
Footnotes
Nicht zutreffende Referenzen vor dem Speichern entfernen ↩