Skip to content

Conversation

@digizeph
Copy link
Member

Summary

  • Fixed TABLE_DUMP_V2 parsing to properly store path_id when AddPath is enabled
  • Changed NetworkPrefix::path_id from u32 to Option<u32> for proper null handling
  • Updated RibEntry struct to include path_id field

Breaking Changes

  • NetworkPrefix::path_id field type changed from u32 to Option<u32>
  • NetworkPrefix::new() signature updated to accept Option<u32> for path_id
  • NetworkPrefix::encode() signature simplified (removed add_path parameter)
  • RibEntry struct now includes path_id: Option<u32> field

Test plan

  • All existing tests pass (206 tests)
  • Verified path_id is now properly stored in TABLE_DUMP_V2 parsing
  • Confirmed Option properly handles presence/absence of path_id
  • Display format correctly shows path_id when present

Fixes #217

Copilot AI review requested due to automatic review settings July 27, 2025 03:38
Copy link
Contributor

Copilot AI left a comment

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 fixes TABLE_DUMP_V2 parsing to properly handle AddPath support by changing the path_id field from u32 to Option<u32> for accurate null representation.

  • Changed NetworkPrefix::path_id from u32 to Option<u32> to properly represent presence/absence of path identifier
  • Updated TABLE_DUMP_V2 parsing to store path_id in RibEntry when AddPath is enabled
  • Simplified encoding signatures by removing the add_path parameter throughout the codebase

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/models/network/prefix.rs Core change to make path_id optional and update constructor/serialization
src/parser/utils.rs Updated NLRI parsing to use Option and simplified encoding functions
src/parser/mrt/messages/table_dump_v2/rib_afi_entries.rs Fixed TABLE_DUMP_V2 parsing to properly store path_id in RibEntry
src/models/mrt/table_dump_v2.rs Added path_id field to RibEntry struct
src/encoder/rib_encoder.rs Updated encoder to handle optional path_id
src/parser/rislive/mod.rs Updated to use None for path_id
src/parser/mrt/messages/*.rs Updated encoding calls to remove add_path parameter
src/parser/bgp/*.rs Updated BGP message encoding to remove add_path parameter
CHANGELOG.md Documented breaking changes and bug fixes

@codecov
Copy link

codecov bot commented Jul 27, 2025

Codecov Report

❌ Patch coverage is 98.46154% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.81%. Comparing base (cffddb6) to head (af06448).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/models/network/prefix.rs 97.50% 1 Missing ⚠️
...rser/mrt/messages/table_dump_v2/rib_afi_entries.rs 95.23% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #224      +/-   ##
==========================================
+ Coverage   93.71%   93.81%   +0.09%     
==========================================
  Files          67       67              
  Lines        7625     7681      +56     
==========================================
+ Hits         7146     7206      +60     
+ Misses        479      475       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@digizeph digizeph merged commit 72d24af into main Jul 27, 2025
5 checks passed
@digizeph digizeph deleted the fixes/add-path-revision branch July 27, 2025 04:49
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.

ADDPATH: path_id not properly stored in TABLE_DUMP_V2 entries

2 participants