RSU Info Endpoint Migration#338
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates RSU “info” retrieval from the legacy Python API /rsuinfo endpoint to the Intersection API /devices/rsus/info endpoint, updating the webapp to call the new service and removing the old Python implementation.
Changes:
- Updated the webapp RSU info client to call the Intersection API (
/devices/rsus/info) and adjusted unit tests accordingly. - Added Intersection API controller/service/repository query and DTOs to produce the RSU GeoJSON response.
- Removed the Python API
/rsuinfoendpoint implementation and its tests, and removed the route wiring.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| webapp/src/EnvironmentVars.tsx | Replaces the RSU info “endpoint” env var with a fixed Intersection API path constant. |
| webapp/src/apis/rsu-api.ts | Switches getRsuInfo to use authApiHelper against the Intersection API. |
| webapp/src/apis/rsu-api.test.ts | Updates expected URL and auth header format for the new RSU info call. |
| services/intersection-api/api/src/test/java/us/dot/its/jpo/ode/api/controllers/devices/rsus/InfoControllerTest.java | Adds MockMvc tests for the new Intersection API RSU info endpoint. |
| services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/services/RsuInfoService.java | Implements mapping from RSU entities to GeoJSON DTOs. |
| services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/repositories/RsuRepository.java | Adds an org-filtered RSU query with fetch joins for model/manufacturer/options. |
| services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/models/postgres/dtos/RsuGeoInfoPropertiesDto.java | Introduces the RSU “properties” DTO with JSON field names matching prior output. |
| services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/models/postgres/dtos/RsuGeoInfoDto.java | Introduces the GeoJSON Feature DTO for RSU info responses. |
| services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/models/geojson/GeoJsonPointDto.java | Adds a GeoJSON Point DTO. |
| services/intersection-api/api/src/main/java/us/dot/its/jpo/ode/api/controllers/devices/rsus/InfoController.java | Adds the /devices/rsus/info controller endpoint. |
| services/api/tests/src/test_rsuinfo.py | Removes Python API unit tests for the deleted /rsuinfo endpoint. |
| services/api/src/rsuinfo.py | Removes the Python API /rsuinfo endpoint implementation. |
| services/api/src/middleware.py | Removes /rsuinfo from org-required and feature tag maps. |
| services/api/src/main.py | Removes route wiring for the Python API /rsuinfo endpoint. |
Comments suppressed due to low confidence (2)
webapp/src/apis/rsu-api.test.ts:16
- These tests build the expected URL using
EnvironmentVars.CVIZ_API_SERVER_URL!, butCVIZ_API_SERVER_URLisn’t set inbeforeEach. That can make the URL become"undefined/...", masking misconfiguration and making the assertions less meaningful. SetEnvironmentVars.CVIZ_API_SERVER_URLexplicitly in the test setup.
beforeEach(() => {
fetchMock.mockClear()
fetchMock.doMock()
EnvironmentVars.rsuOnlineEndpoint = 'VITE_ENV/rsu-online-status'
EnvironmentVars.rsuCountsEndpoint = 'VITE_ENV/rsucounts'
EnvironmentVars.rsuCommandEndpoint = 'VITE_ENV/rsu-command'
EnvironmentVars.wzdxEndpoint = 'VITE_ENV/wzdx-feed'
EnvironmentVars.geoMsgDataEndpoint = 'VITE_ENV/rsu-geo-data'
EnvironmentVars.ssmSrmEndpoint = 'VITE_ENV/rsu-ssm-srm-data'
EnvironmentVars.adminAddOrg = 'VITE_ENV/admin-new-org'
EnvironmentVars.adminOrg = 'VITE_ENV/admin-org'
})
services/api/src/main.py:58
/rsuinfowas removed from the Python API routes, but there are still references to that endpoint in the Python API docs and tests (e.g.,services/api/README.mdandservices/api/tests/src/test_middleware.py). Those should be updated/removed to keep the repo consistent and avoid misleading documentation or failing tests after this breaking change.
if api_environment.ENABLE_RSU_FEATURES:
api.add_resource(RsuOnlineStatus, "/rsu-online-status")
api.add_resource(RsuQueryCounts, "/rsucounts")
api.add_resource(RsuQueryMsgFwd, "/rsu-msgfwd-query")
api.add_resource(RsuSnmpFwdFetch, "/rsu-msgfwd-fetch")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
jacob6838
reviewed
Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Details
Description
This includes the migration of the Python API's
/rsuinfoto the Intersection API's/devices/rsus/infoendpoint./rsuinfoendpoint has been fully removed from the Python API.How Has This Been Tested?
This has been tested locally through Docker with the following profile:
COMPOSE_PROFILES=basic,webapp,intersection,mongo_full,kafka_full,kafka_connect_standaloneOnce the main page of the CV Manager loads, look for the 2 RSU dots to verify baseline RSU info has been pulled from the Intersection API and populated on the map. This validates the functionality.
Types of changes
Checklist: