refactor: consolidate shared primitives into internal/plumbing#118
Merged
Conversation
101fa3a to
1833130
Compare
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>
1833130 to
18aa07c
Compare
scotwells
approved these changes
Jun 17, 2026
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.
Summary
pkg/common/andinternal/agent/srv6/into focused sub-packages underinternal/plumbing/:intf,srv6,sysctl,vrfintf(pure functions, no kernel deps); foldsrouteingressintosrv6as unexported helpers; replacesbig.Intbit ops withencoding/binaryinternal/cmd/versionwithinternal/metadata; addsExecutablevar (runtime path) and wires all four build-time vars into Taskfilebuildtask and Dockerfile ldflagsinternal/plumbing/doc.go, andintfunit tests (HexToBase62/Base62ToHex round-trip, EncodeSRv6Endpoint, DecodeSRv6Endpoint)Taskfile buildto also producebin/galactic-agent(was missing)Test plan
task build— bothbin/galactic-cniandbin/galactic-agentproducedtask test:unit— allinternal/plumbing/intftests passtask lint— no lint errorsmetadata.Versionis stamped correctly:strings.Contains(bin/galactic-cni --version, git-sha)🤖 Generated with Claude Code