Skip to content

Unify SID Structure representations - #453

Merged
watal merged 1 commit into
developfrom
refactor/unify-sid-structure
Sep 7, 2026
Merged

Unify SID Structure representations#453
watal merged 1 commit into
developfrom
refactor/unify-sid-structure

Conversation

@watal

@watal watal commented Sep 7, 2026

Copy link
Copy Markdown
Member

Description

Unify SRv6 SID Structure handling around *SIDStructure.

  • Replace SIDStructureBytes with *SIDStructure
  • Centralize parsing and validation in pkg/table
  • Preserve nil vs. explicitly declared zero-value semantics
  • Clone SID structures when creating independent snapshots/segments

Type of change

  • New feature
  • Bug fix
  • Refactoring
  • Documentation
  • Build / CI

How was this tested?

make test-scenario-parallel

Checklist

  • make ci passes locally
  • Tests added or updated if needed
  • Documentation updated if needed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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.

@watal
watal merged commit 423a76a into develop Sep 7, 2026
14 checks passed
@watal
watal deleted the refactor/unify-sid-structure branch September 7, 2026 09:33
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.

2 participants