Skip to content

fault_manager, gateway: list each rosbag recording's retention priority - #857

Draft
bburda wants to merge 1 commit into
feat/rosbag-retention-1cfrom
feat/rosbag-retention-2
Draft

bburda wants to merge 1 commit into
feat/rosbag-retention-1cfrom
feat/rosbag-retention-2

Conversation

@bburda

@bburda bburda commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

Issue 705 asks for the retention metadata on the bulk-data list, so that a client can download the most important recordings first. This PR adds each recording's retention priority to GET /api/v1/{entity}/bulk-data/rosbags. It also lets the fault manager's own App list and download every recording, and makes the download scope match what the entity's list and fault routes show.

This PR is on top of five PRs in the stack. Please review those first. The diff of this PR is against the branch of the PR directly below it.

What it adds:

  • x-medkit.priority on every rosbag descriptor: the highest retention priority of the recording's faults, from each fault's current severity. It is 0 without valid retention rules. A recording shared by several entities shows the same value under each.
  • ListRosbags.srv: request bool all_recordings, response int64[] priorities, one per row. The fault manager reads the priorities for a whole response with a fixed number of storage reads, not one read per recording.
  • The fault manager's App (and an entity that hosts it) lists and downloads every recording. In hybrid discovery the fault manager node is an App unless unmanifested_nodes: ignore; in manifest-only discovery it has to be declared.
  • Download scope. A recording downloads under an entity when the entity's list shows it or the entity's fault route shows one of its faults. Before this PR, a fault reported by two apps listed its recording under both and downloaded it under neither.
  • One unanswered fault read no longer fails a download whose scope another attached fault already proves.
  • Docs: docs/api/rest.rst, docs/requirements/specs/bulkdata.rst, docs/config/fault-manager.rst, the gateway and fault manager READMEs.

What changes for users

  • New field x-medkit.priority on each rosbag descriptor.
  • The fault manager's App lists every recording. Before, it listed only recordings of faults the fault manager reported itself.
  • A recording of a fault reported by several apps now downloads under each app that lists it.
  • ListRosbags.srv changed. The gateway and the fault manager must come from the same release.

Issue


Type

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

  • colcon build --packages-up-to ros2_medkit_fault_manager ros2_medkit_gateway ros2_medkit_integration_tests, then colcon test --packages-select ros2_medkit_fault_manager ros2_medkit_gateway ros2_medkit_integration_tests and colcon test-result --verbose.
  • The test through the real gateway and fault manager is src/ros2_medkit_integration_tests/test/features/test_rosbag_priority_list.test.py. It covers:
    • priorities per recording, and a priority that follows a severity change;
    • a recording shared by two apps, and a fault reported by two apps;
    • a node whose name is a prefix of another node's name;
    • a child-namespace node;
    • the fault manager's App;
    • all_recordings with an empty entity.
  • To try it: set snapshots.rosbag.retention.severity.CRITICAL.priority: 900 and defaults.priority: 10, confirm a WARN and a CRITICAL fault, and read GET /api/v1/apps/<app>/bulk-data/rosbags.
  • I ran this on Jazzy, with PostgreSQL 14 for the fault manager tests. Humble and Lyrical run in CI. clang-tidy on the changed files reports nothing new.

Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

@bburda
bburda added this pull request to stack #836 December 1, 2026 13:21
@bburda
bburda force-pushed the feat/rosbag-retention-2 branch from 4b2e539 to 254b11d Compare December 1, 2026 15:43
@bburda
bburda force-pushed the feat/rosbag-retention-2 branch from 254b11d to 79c4af5 Compare December 2, 2026 12:15
* feat(fault_manager,gateway): list each rosbag recording's retention priority
* fix(gateway): read every attached fault before a rosbag scope check gives up
* fix(gateway): download a recording where the list or a fault route shows it
* docs(gateway): name the fault manager's App in the rosbag download rule
@bburda
bburda force-pushed the feat/rosbag-retention-2 branch from 79c4af5 to d8ff920 Compare December 2, 2026 18:24

This branch has not been deployed

No deployments
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.

1 participant