Skip to content

RSU Info Endpoint Migration#338

Merged
drewjj merged 8 commits into
developfrom
Feature/rsu-info-migration
Jul 8, 2026
Merged

RSU Info Endpoint Migration#338
drewjj merged 8 commits into
developfrom
Feature/rsu-info-migration

Conversation

@drewjj

@drewjj drewjj commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

PR Details

Description

This includes the migration of the Python API's /rsuinfo to the Intersection API's /devices/rsus/info endpoint.

  • Functionality has been maintained between implementations so it returns an identical object to the web application.
  • The /rsuinfo endpoint has been fully removed from the Python API.
  • The web application has been updated to hit the Intersection API for the RSU info.
  • Tests have been both added and modified for the changes.

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_standalone

Once 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

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • My changes require new environment variables:
    • I have updated the docker-compose, K8s YAML, and all dependent deployment configuration files.
  • My changes require updates to the documentation:
    • I have updated the documentation accordingly.
  • My changes require updates and/or additions to the unit tests:
    • I have modified/added tests to cover my changes.
  • All existing tests pass.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /rsuinfo endpoint 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!, but CVIZ_API_SERVER_URL isn’t set in beforeEach. That can make the URL become "undefined/...", masking misconfiguration and making the assertions less meaningful. Set EnvironmentVars.CVIZ_API_SERVER_URL explicitly 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

  • /rsuinfo was 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.md and services/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.

Comment thread webapp/src/apis/rsu-api.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@pmonington pmonington left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

@drewjj drewjj requested a review from jacob6838 July 8, 2026 03:03

@jacob6838 jacob6838 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@drewjj drewjj merged commit 3204506 into develop Jul 8, 2026
13 checks passed
@drewjj drewjj deleted the Feature/rsu-info-migration branch July 8, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants