banger/CONTRIBUTING.md
2026-05-01 19:34:44 -03:00

1.9 KiB

Contributing

Build from source

make build
sudo ./build/bin/banger system install --owner "$USER"

make build produces three binaries under ./build/bin/:

  • banger — the user-facing CLI
  • bangerd — the owner-user daemon (exposes /run/banger/bangerd.sock)
  • banger-vsock-agent — the in-guest companion

system install copies them into /usr/local, writes install metadata under /etc/banger, lays down bangerd.service and bangerd-root.service, and starts both. After that, daily commands like banger vm run are unprivileged.

To inspect or refresh the services:

banger system status
sudo banger system restart

The two-service split (owner daemon + privileged root helper) is explained in docs/privileges.md, including the exact capability set the root helper holds.

Tests

make test            # go test ./...
make coverage        # per-package + total statement coverage
make lint            # gofmt + go vet + shellcheck

The smoke suite (make smoke) builds coverage-instrumented binaries, installs them as a temporary systemd service, and runs end-to-end scenarios against real Firecracker. Requires a KVM-capable host and sudo. The suite lives under internal/smoketest/ (build-tagged smoke); make smoke-list prints scenario names; make smoke-one SCENARIO=<name> runs just one (comma-separated for several). See the smoke comments in the Makefile for details.

Pre-commit hook

make install-hooks

Points core.hooksPath at .githooks/, which runs lint + test + build on every commit. Bypass with git commit --no-verify; revert with git config --unset core.hooksPath.

Internals