Unify SID Structure representations - #453
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The representation change is consistently applied with validation, cloning, serialization, and regression coverage.
Pull request overview
Unifies SRv6 SID structures around *table.SIDStructure across table, PCEP, gRPC, CLI, and CSPF paths.
Changes:
- Centralizes parsing, validation, cloning, and equality.
- Preserves absent versus explicit zero-value semantics.
- Updates serialization, conversion, and tests.
File summaries
| File | Description |
|---|---|
pkg/table/ted.go |
Adds shared SID structure operations. |
pkg/table/ted_test.go |
Tests parsing, cloning, and equality. |
pkg/table/sr_policy.go |
Replaces byte slices with structure pointers. |
pkg/table/sr_policy_test.go |
Updates equality, JSON, and validation tests. |
pkg/table/sid_validate.go |
Uses named structure fields during validation. |
pkg/table/sid_validate_test.go |
Updates external validation fixtures. |
pkg/table/sid_validate_internal_test.go |
Updates internal uSID fixtures. |
pkg/server/session.go |
Deep-clones structures in snapshots. |
pkg/server/session_internal_test.go |
Verifies snapshot independence. |
pkg/server/grpc_server.go |
Delegates parsing to pkg/table. |
pkg/server/grpc_server_internal_test.go |
Updates server conversion expectations. |
pkg/server/grpc_convert.go |
Formats named fields for protobuf output. |
pkg/packet/pcep/object.go |
Converts PCEP encoding to the shared type. |
pkg/packet/pcep/object_test.go |
Updates PCEP round-trip fixtures. |
pkg/cspf/cspf_test.go |
Updates CSPF fixtures. |
pkg/cspf/cspf_internal_test.go |
Updates internal CSPF fixtures. |
cmd/pola/ted_view.go |
Reuses the shared type in TED views. |
cmd/pola/ted_view_test.go |
Tests absent and explicit-zero views. |
cmd/pola/ted_text_test.go |
Updates text-rendering fixtures. |
cmd/pola/grpc/grpc_client.go |
Uses centralized client-side parsing. |
cmd/pola/grpc/grpc_client_internal_test.go |
Updates client conversion tests. |
Review details
- Files reviewed: 21/21 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Description
Unify SRv6 SID Structure handling around
*SIDStructure.SIDStructureByteswith*SIDStructurepkg/tableType of change
How was this tested?
make test-scenario-parallelChecklist
make cipasses locally