Skip to content

refactor: consolidate shared primitives into internal/plumbing#118

Merged
privateip merged 3 commits into
mainfrom
refactor/internal-plumbing
Jun 17, 2026
Merged

refactor: consolidate shared primitives into internal/plumbing#118
privateip merged 3 commits into
mainfrom
refactor/internal-plumbing

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Summary

  • Dissolves pkg/common/ and internal/agent/srv6/ into focused sub-packages under internal/plumbing/: intf, srv6, sysctl, vrf
  • Moves SRv6 endpoint encode/decode to intf (pure functions, no kernel deps); folds routeingress into srv6 as unexported helpers; replaces big.Int bit ops with encoding/binary
  • Replaces internal/cmd/version with internal/metadata; adds Executable var (runtime path) and wires all four build-time vars into Taskfile build task and Dockerfile ldflags
  • Adds docstrings, package-level doc comments, internal/plumbing/doc.go, and intf unit tests (HexToBase62/Base62ToHex round-trip, EncodeSRv6Endpoint, DecodeSRv6Endpoint)
  • Fixes Taskfile build to also produce bin/galactic-agent (was missing)
  • Updates AGENTS.md, ARCHITECTURE.md, CONVENTIONS.md to reflect the new layout

Test plan

  • task build — both bin/galactic-cni and bin/galactic-agent produced
  • task test:unit — all internal/plumbing/intf tests pass
  • task lint — no lint errors
  • Verify metadata.Version is stamped correctly: strings.Contains(bin/galactic-cni --version, git-sha)

🤖 Generated with Claude Code

@privateip privateip requested a review from a team as a code owner June 17, 2026 12:26
@privateip privateip requested a review from mattdjenkinson June 17, 2026 12:26
@privateip privateip force-pushed the refactor/internal-plumbing branch from 101fa3a to 1833130 Compare June 17, 2026 12:43
privateip and others added 3 commits June 17, 2026 08:51
Dissolve pkg/common/ and internal/agent/srv6/ into focused sub-packages
under internal/plumbing/ (intf, srv6, sysctl, vrf). Move SRv6 endpoint
encode/decode to intf as pure functions; fold routeingress into srv6 as
unexported helpers; replace big.Int bit ops with encoding/binary.

- Add docstrings, package doc comments, and internal/plumbing/doc.go
- Add intf unit tests: HexToBase62/Base62ToHex round-trip, Encode/Decode
- Replace internal/cmd/version with internal/metadata; add Executable var
- Wire build-time ldflags into Taskfile build task and Dockerfile
- Add galactic-agent to Taskfile build task (was missing)
- Update AGENTS.md, ARCHITECTURE.md, CONVENTIONS.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The refactor moved all code out of pkg/common/util; the ci.sh script
still referenced the old path causing test:unit to fail.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Fix goconst: extract repeated test string literals into constants
  in internal/plumbing/intf/intf_test.go
- Fix gofmt: correct import ordering in internal/cni/cni.go and
  internal/cni/veth/veth.go
- Fix lll: wrap long flag description lines in cmd/galactic-agent/main.go
- Fix Dockerfile: remove stale COPY pkg/ pkg/ (pkg/ was deleted)
- Fix ci.sh: gate kernel module install on GITHUB_ACTIONS=true so
  task test:e2e works locally without sudo apt-get
- Fix Taskfile yaml-ext: exclude deploy/containerlab/clab-gvpc/ from
  .yml extension check

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@privateip privateip force-pushed the refactor/internal-plumbing branch from 1833130 to 18aa07c Compare June 17, 2026 12:52
@privateip privateip merged commit 1193a7f into main Jun 17, 2026
5 checks passed
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