Skip to content

serviceability: rename NewInterface to Interface and old enum to InterfaceDeprecated#3677

Open
elitegreg wants to merge 1 commit intomainfrom
gm/rename-interface-canonical
Open

serviceability: rename NewInterface to Interface and old enum to InterfaceDeprecated#3677
elitegreg wants to merge 1 commit intomainfrom
gm/rename-interface-canonical

Conversation

@elitegreg
Copy link
Copy Markdown
Contributor

Summary

  • Final cross-cutting step in the forward-compatible Device interfaces refactor — closes #3663. Design: gist.
  • Pure rename: the legacy enum InterfaceInterfaceDeprecated, the new struct NewInterfaceInterface, the Device::new_interfaces field → Device::interfaces, and the legacy Device::interfaces field → Device::deprecated_interfaces. Equivalent rename across the Go, Python, and TypeScript serviceability SDKs.
  • No on-disk format change. Borsh is positional, so the regenerated sdk/serviceability/testdata/fixtures/device.bin is byte-identical to the committed one.

Notes for reviewers

  • The activator/ crate was deleted from the workspace in an earlier change, so the issue's "activator (minimal touch)" bullet is a no-op here.
  • Device::find_interface_legacy is now unused — kept for this rename per the "pure rename" scope, separate cleanup follow-up.
  • This PR is large (~70 files) but mechanical. Splitting along Rust ↔ SDK lines is possible if reviewers prefer; happy to do that on request.
  • One small JSON-shape adjustment in the Go SDK: added json:\",omitempty\" to Device.DeprecatedInterfaces so it doesn't surface as a null field when callers populate only the new vec. The original Go SDK had omitempty on the new (formerly NewInterfaces) field; this PR keeps that behavior on the new canonical field and extends it to the deprecated slot for symmetry. JSON consumers that previously read Interfaces (legacy) now read either Interfaces (canonical) or DeprecatedInterfaces depending on which form they want.

Testing Verification

  • make rust-fmt, make rust-lint, and cargo test --workspace --exclude doublezero-geolocation all pass. (The geolocation test compile failure on this branch reproduces on origin/main; pre-existing, unrelated.)
  • make generate-fixtures confirmed device.bin is byte-identical pre/post rename.
  • Python (uv run pytest) and TypeScript (bun test) SDK suites: 119 + 142 tests passing respectively.
  • Go SDK tests pass (go test ./smartcontract/sdk/go/...).
  • Manual sanity sweep: grep -r "NewInterface\b\|new_interfaces\b\|newInterfaces\b" returns only generated openconfig types and an unrelated controlplane NewInterface Go constructor — no remaining references in the doublezero serviceability surface.

@elitegreg elitegreg force-pushed the gm/rename-interface-canonical branch 2 times, most recently from 15cc59e to 5e0b36a Compare May 6, 2026 15:58
…rfaceDeprecated

Final cross-cutting step in the forward-compatible Device interfaces refactor (issue #3663). Pure rename — no behavior change, no on-disk format change. The regenerated `device.bin` fixture is byte-identical to the committed one because Borsh is positional, not name-based.

  Interface (legacy enum)        -> InterfaceDeprecated
  NewInterface (struct)          -> Interface
  Device.new_interfaces field    -> Device.interfaces
  Device.interfaces (legacy)     -> Device.deprecated_interfaces

Same shape applied to Go (`Device.NewInterfaces` / `Device.Interfaces` -> `Device.Interfaces` / `Device.DeprecatedInterfaces`), Python, and TypeScript SDKs. The `Interface` / `DeviceInterface` element type in each SDK already represents the canonical (new) format and needs no rename.

The `activator/` crate was already deleted from the workspace, so the issue's "activator (minimal touch)" bullet is a no-op here.
@elitegreg elitegreg force-pushed the gm/rename-interface-canonical branch from 5e0b36a to f148176 Compare May 6, 2026 17:56
@elitegreg elitegreg marked this pull request as ready for review May 6, 2026 19:10
@elitegreg elitegreg enabled auto-merge (squash) May 6, 2026 19:10
@elitegreg elitegreg requested a review from ben-dz May 6, 2026 19:28
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.

serviceability: rename NewInterface to Interface and old enum to InterfaceDeprecated

1 participant