Skip to content

refactor(dataplane): split dataplane.go into cohesive files (under size gate) - #440

Merged
krisarmstrong merged 1 commit into
mainfrom
refactor/split-dataplane
Jun 16, 2026
Merged

refactor(dataplane): split dataplane.go into cohesive files (under size gate)#440
krisarmstrong merged 1 commit into
mainfrom
refactor/split-dataplane

Conversation

@krisarmstrong

Copy link
Copy Markdown
Collaborator

Summary

  • dataplane.go was 2782 lines (RED flag >1200 in check-file-size.sh); now 1186 lines (below the red-flag threshold)
  • Split verbatim by protocol/concern into 8 focused files in the same dataplane package — no behavior, signature, or logic changes anywhere
  • Each CGO file carries a minimal per-file C preamble (CGO architectural requirement: C type declarations are per-file)

Split map

File Lines Responsibility
dataplane.go 1186 Full C preamble, Context struct + lifecycle, RunCustomStreamTest, RFC 2544 internal wrappers (RunSystemRecoveryTest, RunResetTest, runThroughputTestInternal, etc.)
dataplane_types.go 561 All exported Go types — no CGO, compiles on any platform
dataplane_cli.go 110 Pure-Go CLI wrapper methods: New, SetFrameSize, RunThroughputTest, RunLatencyTest, RunFrameLossTest, RunBackToBackTest
dataplane_y1564.go 189 RunY1564ConfigTest, RunY1564PerfTest
dataplane_rfc2889.go 284 5 RFC 2889 test methods + fillRFC2889Config
dataplane_rfc6349.go 158 RunRFC6349PathTest, RunRFC6349ThroughputTest, fillRFC6349Config
dataplane_y1731.go 309 4 Y.1731 test methods + session/interval helpers
dataplane_mef.go 315 RunMEFConfigTest, RunMEFPerfTest, RunMEFFullTest, fillMEFConfig
dataplane_tsn.go 378 4 TSN test methods + fillTSNConfig

Validation

go build ./...                                    ✅ (exit 0)
go vet ./internal/services/orchestrator/dataplane/... ✅ (exit 0)
golangci-lint run ./internal/services/orchestrator/dataplane/... ✅ 0 issues
go test ./internal/services/orchestrator/dataplane/... ✅ [no test files]
bash scripts/check-file-size.sh | grep -iE dataplane
  ⚠️  dataplane.go (1186 lines, max: 600)  ← WARN only, no longer RED
  ⚠️  dataplane_stub.go (781 lines, max: 600) ← pre-existing, unchanged

Test plan

  • CI build passes (CGO + Linux build matrix)
  • No exported symbol changes (go doc ./internal/services/orchestrator/dataplane/... unchanged)
  • dataplane_stub.go (non-CGO build path) is untouched

…ze gate)

dataplane.go was 2782 lines (RED flag >1200). Split by protocol/concern into
8 files in the same package with no behavior, signature, or logic changes:

- dataplane.go (1186L): C preamble, Context lifecycle, RunCustomStreamTest, internal RFC 2544 wrappers
- dataplane_types.go (561L): all Go exported types (no CGO)
- dataplane_cli.go (110L): pure-Go CLI wrapper methods (New, SetFrameSize, RunThroughput/Latency/FrameLoss/BackToBack)
- dataplane_y1564.go (189L): Y.1564 config + perf tests
- dataplane_rfc2889.go (284L): RFC 2889 five test methods + fillRFC2889Config
- dataplane_rfc6349.go (158L): RFC 6349 path + throughput tests + fillRFC6349Config
- dataplane_y1731.go (309L): Y.1731 four test methods + session/interval helpers
- dataplane_mef.go (315L): MEF config/perf/full tests + fillMEFConfig
- dataplane_tsn.go (378L): TSN four test methods + fillTSNConfig

Each CGO file carries a minimal per-file C preamble (CGO requirement).
All validation passed: go build ./..., go vet, golangci-lint (0 issues), go test.
@github-actions github-actions Bot added the go label Jun 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

License Compliance Report

All dependencies pass license compliance checks

Go Dependencies

  • Unknown: 31 package(s)
  • MIT: 26 package(s)
  • BSD-3-Clause: 16 package(s)
  • Apache-2.0: 11 package(s)
  • BSD-2-Clause: 1 package(s)

npm Dependencies

See full report in workflow artifacts

Allowed Licenses: MIT, Apache-2.0, BSD-*, ISC, CC0-1.0, MPL-2.0
Forbidden: GPL, AGPL, SSPL (strong copyleft)

@krisarmstrong
krisarmstrong enabled auto-merge (squash) June 16, 2026 02:30
@github-actions github-actions Bot removed the go label Jun 16, 2026
@krisarmstrong
krisarmstrong merged commit 021fe65 into main Jun 16, 2026
40 of 52 checks passed
@krisarmstrong
krisarmstrong deleted the refactor/split-dataplane branch June 16, 2026 05:21
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