test(core): confirm AgentConfigGenerator compiles the netprobe systemd-service assignment (#3425) #3484

Merged
mfreeman451 merged 1 commit from feat/netprobe-config-generator-test into staging 2026-06-01 03:15:56 +00:00
Owner

Summary

migrate-netprobe-to-native-addon §3.2 — confirm AgentConfigGenerator compiles the netprobe systemd-service assignment. The generic add-on compilation path already handles netprobe, so this is a confirm-via-test (no production code change) that locks the control-plane → agent contract the §2.2 cutover (#3483) depends on.

What the test asserts (DB-backed, agent_config_generator_test.exs)

A netprobe AddonPackage (addon_id: "netprobe", delivery: :pushed_artifact, supervision: :systemd_service, requires.os_capabilities: [cap_net_raw, cap_bpf, cap_perfmon], per-arch artifacts["linux/amd64"]) + an enabled AddonAssignment for a linux/amd64 agent → generate_config/1:

  • compiles an addon with addon_id "netprobe", :pushed_artifact/:systemd_service, the approved capability subset, the os_capabilities, and the per-arch artifact reference (object_key/sha256/target_os/target_arch).
  • Cross-system contract: to_proto_response/1 stringifies :systemd_service"systemd_service" — the exact constant the agent's classifyAddonSupervision matches to route netprobe onto the attach path. A hyphen/format drift here would silently break the cutover, so it's pinned.
  • the VisibilityConfig rides in the same response — the agent §2.2 cutover reads both: the assignment to decide attach, VisibilityConfig for the capture params.

create_approved_addon_package gained supervision/addon_id/binary/requires opts (backward-compatible defaults; the existing addon tests are unchanged and still pass).

Validation

  • Full agent_config_generator_test.exs 38/38 green against an srql-fixtures scratch CNPG DB (--include integration).
  • mix format --check-formatted + mix credo --strict clean.

Where this sits

The build → sign → publish → import → assign → compile-config → agent-attach/configure loop is now covered in code + tests on both sides (control plane emits the netprobe assignment; the agent consumes it). The remaining migrate-netprobe items are §3.1 (seed/import a real netprobe AddonPackage — needs the Linux-built+published bundle), §2.3 status, §2.4 rollback, §3.3 Edge Ops UI, and the §4.3 scratch-Linux-agent e2e (the full-flow gate; bundles can't build/run on darwin).

🤖 Generated with Claude Code

## Summary `migrate-netprobe-to-native-addon` §3.2 — **confirm `AgentConfigGenerator` compiles the netprobe systemd-service assignment**. The generic add-on compilation path already handles netprobe, so this is a **confirm-via-test (no production code change)** that locks the control-plane → agent contract the §2.2 cutover (#3483) depends on. ## What the test asserts (DB-backed, `agent_config_generator_test.exs`) A netprobe `AddonPackage` (`addon_id: "netprobe"`, `delivery: :pushed_artifact`, `supervision: :systemd_service`, `requires.os_capabilities: [cap_net_raw, cap_bpf, cap_perfmon]`, per-arch `artifacts["linux/amd64"]`) + an enabled `AddonAssignment` for a `linux/amd64` agent → `generate_config/1`: - compiles an addon with `addon_id "netprobe"`, `:pushed_artifact`/`:systemd_service`, the approved capability subset, the os_capabilities, and the **per-arch artifact reference** (object_key/sha256/target_os/target_arch). - **Cross-system contract:** `to_proto_response/1` stringifies `:systemd_service` → `"systemd_service"` — the exact constant the agent's `classifyAddonSupervision` matches to route netprobe onto the **attach path**. A hyphen/format drift here would silently break the cutover, so it's pinned. - the **`VisibilityConfig` rides in the same response** — the agent §2.2 cutover reads *both*: the assignment to decide attach, `VisibilityConfig` for the capture params. `create_approved_addon_package` gained `supervision`/`addon_id`/`binary`/`requires` opts (backward-compatible defaults; the existing addon tests are unchanged and still pass). ## Validation - Full `agent_config_generator_test.exs` **38/38 green** against an `srql-fixtures` scratch CNPG DB (`--include integration`). - `mix format --check-formatted` + `mix credo --strict` clean. ## Where this sits The build → sign → publish → import → **assign → compile-config** → agent-attach/configure loop is now covered in code + tests on both sides (control plane emits the netprobe assignment; the agent consumes it). The remaining migrate-netprobe items are §3.1 (seed/import a real netprobe `AddonPackage` — needs the Linux-built+published bundle), §2.3 status, §2.4 rollback, §3.3 Edge Ops UI, and the **§4.3 scratch-Linux-agent e2e** (the full-flow gate; bundles can't build/run on darwin). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
test(core): confirm AgentConfigGenerator compiles the netprobe systemd-service assignment (#3425)
Some checks failed
Secret Scan / gitleaks (pull_request) Successful in 26s
lint / lint (pull_request) Successful in 1m0s
lint / lint (push) Successful in 1m19s
Golang Tests / test-go (push) Successful in 1m21s
CI / build (pull_request) Failing after 15m57s
Elixir Quality / Elixir Quality (pull_request) Failing after 23m42s
c23ce8e14b
migrate-netprobe-to-native-addon §3.2. The generic add-on path already handles netprobe, so
this is a confirm-via-test (no production code change) that locks the control-plane → agent
contract the §2.2 cutover depends on.

DB-backed test in agent_config_generator_test.exs: a netprobe AddonPackage (addon_id
"netprobe", delivery=:pushed_artifact, supervision=:systemd_service,
requires.os_capabilities, per-arch artifacts["linux/amd64"]) + an enabled AddonAssignment →
generate_config/1 compiles an addon carrying the systemd-service supervision, the approved
capability subset, the os_capabilities, and the per-arch artifact reference.

Critically it pins the cross-system contract: to_proto_response/1 stringifies :systemd_service
-> "systemd_service" — the exact constant the agent's classifyAddonSupervision matches to
route netprobe onto the attach path; a hyphen/format drift would silently break the cutover.
It also asserts the VisibilityConfig rides in the SAME response (the agent reads both: the
assignment to decide attach, VisibilityConfig for the capture params).

create_approved_addon_package gained supervision/addon_id/binary/requires opts (backward-
compatible defaults; existing addon tests unchanged).

Validation: full agent_config_generator_test.exs 38/38 green against an srql-fixtures scratch
CNPG DB; mix format + credo --strict clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mfreeman451 left a comment

lgtm

lgtm
mfreeman451 deleted branch feat/netprobe-config-generator-test 2026-06-01 03:15:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
carverauto/serviceradar!3484
No description provided.