Conversation
…alth data mapping
…lth status as a map keyed by RSU IP addresses
…, and integration tests
… streamline test setup
…ata, and middleware references
There was a problem hiding this comment.
Pull request overview
Migrates the legacy ISS SCMS status endpoint out of the Flask-based services/api service and into the Spring-based services/intersection-api, updating the webapp to call the new /scms-status endpoint and treating SCMS health as a boolean.
Changes:
- Add
/scms-statusendpoint inservices/intersection-api(controller/service/repository + mapper/DTO + tests). - Update webapp SCMS status types/rendering and switch the SCMS status API call to use
authApiHelperagainstCVIZ_API_SERVER_URL. - Remove legacy Flask resource
iss_scms_status.pyand its tests, and unregister the old route.
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| webapp/src/pages/Map.tsx | Updates SCMS health handling from '0'/'1' to boolean in map UI. |
| webapp/src/models/RsuApi.d.ts | Changes IssScmsStatus.health typing to boolean. |
| webapp/src/features/menu/DisplayRsuErrors.tsx | Updates SCMS status handling toward boolean in the RSU errors/status UI. |
| webapp/src/EnvironmentVars.tsx | Points SCMS status endpoint to relative /scms-status for CVIZ auth helper usage. |
| webapp/src/components/RsuMarker.tsx | Updates marker prop type and SCMS color logic to boolean. |
| webapp/src/components/RsuMarker.test.tsx | Updates snapshot tests for boolean SCMS status. |
| webapp/src/components/snapshots/RsuMarker.test.tsx.snap | Snapshot updates for new SCMS marker rendering. |
| webapp/src/apis/rsu-api.ts | Switches getIssScmsStatus to authApiHelper.invokeApi (CVIZ base URL + Bearer token). |
| webapp/src/apis/rsu-api.test.ts | Updates expected URL + Authorization header format for SCMS status call. |
| services/intersection-api/api/src/test/resources/application-integration-test.yaml | Adjusts JPA ddl-auto to support integration testing schema creation. |
| services/intersection-api/api/src/test/java/.../ScmsHealthServiceTest.java | Integration tests for repository/service behavior retrieving latest status per RSU/org. |
| services/intersection-api/api/src/test/java/.../ManufacturerRepository.java | Test-only JPA repository added to support integration test setup. |
| services/intersection-api/api/src/test/java/.../ScmsHealthMapperTest.java | Unit tests for DTO/map transformation behavior. |
| services/intersection-api/api/src/test/java/.../ScmsHealthControllerTest.java | Controller tests for /scms-status response behavior. |
| services/intersection-api/api/src/main/java/.../ScmsHealthService.java | New service layer to fetch SCMS status projections. |
| services/intersection-api/api/src/main/java/.../ScmsHealthRepository.java | Adds JPQL query to fetch latest SCMS health per RSU in an org. |
| services/intersection-api/api/src/main/java/.../ScmsHealthDto.java | DTO for SCMS status response payload. |
| services/intersection-api/api/src/main/java/.../ScmsHealth.java | Adjusts health column mapping for SCMS health table. |
| services/intersection-api/api/src/main/java/.../ScmsHealthRsuProjection.java | Projection to pair RSU + SCMS health record. |
| services/intersection-api/api/src/main/java/.../ScmsHealthMapper.java | Maps projections into the response shape keyed by RSU IP. |
| services/intersection-api/api/src/main/java/.../ScmsHealthController.java | New /scms-status REST endpoint. |
| services/api/tests/src/test_iss_scms_status.py | Removes Flask endpoint tests. |
| services/api/tests/data/iss_scms_status_data.py | Removes Flask endpoint test data. |
| services/api/src/middleware.py | Removes old /iss-scms-status path from middleware config. |
| services/api/src/main.py | Unregisters the old Flask route. |
| services/api/src/iss_scms_status.py | Removes the legacy Flask resource implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…1"/"0") instead of boolean, adjust models, mappers, and tests accordingly
…"), update related components, models, and tests
…"online" for SCMS status
… ID, adjust test to validate exact one-row-per-RSU behavior
…and deterministic query behavior
…improved test readability and clarity
…roved test readability and consistency
…ing subquery logic
…oved test readability and refactor variable names for clarity
…lection, remove timestamp precedence test
jacob6838
left a comment
There was a problem hiding this comment.
1 suggestion, otherwise looks great
- Updated test cases in `ScmsHealthControllerTest` and `ScmsHealthMapperTest` to validate health values as Booleans instead of Strings. - Modified `ScmsHealthDto` to reflect Boolean type for health field. - Removed `healthToString` mapper method and updated mappings in `ScmsHealthMapper`. - Adjusted tests for inactive and active health scenarios to align with Boolean logic.
- Deleted `DateTimeConfig` and related timezone configuration properties from the application. - Updated `ScmsHealthDto` to replace `String expiration` with `Instant expiration` for ISO-8601 UTC compatibility. - Refactored `ScmsHealthMapper` to simplify mapping logic by removing timezone-based date formatting. - Adjusted tests for SCMS health mappings and projections to accommodate changes in `Instant` expiration type.
- Eliminated `APP_TIMEZONE` variable from `sample-full.env` and `docker-compose-intersection.yml` as it is no longer required.
- Introduced `formatScmsExpiration` utility for human-readable SCMS expiration dates. - Updated components and selectors to use standardized expiration display logic. - Replaced raw ISO-8601 strings with localized date formats in SCMS status and expiration views. - Enhanced maintainability by centralizing date formatting logic in `scmsApiSlice`.
…point parameter in `scmsApiSlice`
…sStatusQuery` - Removed lazy querying logic and updated SCMS status retrieval to auto-fetch based on `organization`. - Simplified components by eliminating explicit trigger calls for SCMS status data. - Updated `ScmsHealthDto` to use `boolean` for `health` field instead of `'0' | '1' | null`.
- Replaced `'0' | '1' | null` SCMS status with `boolean | null` for consistency and clarity. - Updated components, tests, and filters to handle the boolean SCMS status. - Simplified related logic in `DisplayRsuErrors` and `RsuMarker`.
…migrate-iss-scms-status-endpoint
…anagement - Added `@BeforeEach` and `@AfterEach` methods for test database cleanup and security context management to prevent test data bleeding from one suite to another.
- Added detailed test cases for `DisplayRsuErrors` covering SCMS statuses, snapshots, and edge cases. - Improved `RsuFirmwareMenu` tests to validate success/error message rendering for single and batch RSU upgrades. - Introduced mock configurations for realistic test scenarios.
- Regenerated snapshots for `DisplayRsuErrors` to reflect updated SCMS status, UI structure, and table contents.
|
I've made some updates to move to RTK in the UI, remove unnecessary code from the ScmsHealthMapper, add more test coverage, and change the data type of @drewjj @jacob6838 ready for re-review whenever you have time Recording.2026-04-20.142620.mp4 |
drewjj
left a comment
There was a problem hiding this comment.
Tests great! Thanks for updating this
- Improves query performance by indexing the `timestamp` field.
All feedback addressed. Two approvals from others. The reviewer is out for a few days, so dismissing to allow this PR to be merged in a timely manner
PR Details
Description
How Has This Been Tested?
Data Used To Test Locally
Run the following statement to insert relevant test data into the database for the already-provided RSUs:
Types of changes
Checklist: