Pulse/Makefile
rcourtman 3e61849242 Drop standalonePageModel snippet from agentless contract test; bump test timeout to 20m
TestAgentlessAvailabilityTargetKindStaysCanonical was pinning the
former agentless-machine classification in
frontend-modern/src/features/standalone/standalonePageModel.ts
(resource.availability?.targetKind,
availabilityTargetKindFor(resource) === 'machine'). Commit 1e16cf34f
intentionally narrowed the Machines surface to Pulse Agent resources
only, removing that classification, but did not update the test. The
server-side contract for availability targetKind across
config/availability.go, monitoring/availability_poller.go, types.go,
and frontend-modern/src/api/availabilityTargets.ts is preserved and
still pinned by the same test for any future consumer.

Makefile go test timeout bumped from 10m to 20m. The rc.5 backend
test run cleared 10m with slack; the rc.6 backend test run hit 13m
in internal/api before the binary panic-killed itself. 20m gives
headroom without hiding regressions for the rc.6 release path while
the package-size growth is tracked separately.
2026-05-27 17:17:13 +01:00

123 lines
3.8 KiB
Makefile

# Pulse Makefile for development
.PHONY: build run dev dev-status dev-logs dev-stop dev-restart dev-backend-restart dev-verify dev-foreground frontend backend all clean distclean dev-hot lint lint-backend lint-frontend format format-backend format-frontend build-agents control-plane handoff
FRONTEND_DIR := frontend-modern
FRONTEND_DIST := $(FRONTEND_DIR)/dist
FRONTEND_EMBED_DIR := internal/api/frontend-modern
GO_TEST_PACKAGES := ./cmd/... ./internal/... ./pkg/... ./scripts/... ./tests/...
# Build everything (including all agent binaries)
all: frontend backend build-agents
# Build frontend only
frontend:
npm --prefix $(FRONTEND_DIR) run build
@echo "✓ Frontend build synced to $(FRONTEND_EMBED_DIR)"
# Build backend only (includes embedded frontend)
backend:
go build -o pulse ./cmd/pulse
# Build both and run
build: frontend backend
# Run the built binary
run: build
./pulse
# Development - managed local runtime
dev:
npm run dev
dev-status:
npm run dev:status
dev-logs:
npm run dev:logs
dev-stop:
npm run dev:stop
dev-restart:
npm run dev:restart
dev-backend-restart:
npm run dev:backend-restart
dev-verify:
npm run dev:verify
dev-foreground:
npm run dev:foreground
dev-hot:
npm run dev:foreground
# Clean build artifacts
clean:
rm -f pulse
rm -rf $(FRONTEND_DIST) $(FRONTEND_EMBED_DIR)
distclean: clean
./scripts/cleanup.sh
# Quick managed restart for development
restart: dev-restart
# Run linters for both backend and frontend
lint: lint-backend lint-frontend
lint-backend:
golangci-lint run ./...
lint-frontend:
npm --prefix $(FRONTEND_DIR) run lint
# Apply formatters
format: format-backend format-frontend
format-backend:
gofmt -w cmd internal pkg
format-frontend:
npm --prefix $(FRONTEND_DIR) run format
# Build control plane binary
control-plane:
@VERSION=$$(cat VERSION | tr -d '\n') && \
go build -ldflags="-s -w -X main.Version=v$$VERSION" -trimpath -o pulse-control-plane ./cmd/pulse-control-plane
test:
@./scripts/ensure_test_assets.sh
@echo "Running backend tests..."
go test -race -timeout 20m $$(go list $(GO_TEST_PACKAGES))
# Run integration tests (requires Ollama at OLLAMA_URL or 127.0.0.1:11434)
test-integration:
@echo "Running AI integration tests against Ollama..."
@echo "Set OLLAMA_URL to override default (http://127.0.0.1:11434)"
go test -tags=integration -v ./internal/ai/providers/... -run "TestIntegration"
# Run both unit and integration tests
test-all: test test-integration
# Build all agent binaries for all platforms
build-agents:
@echo "Building agent binaries for all platforms..."
@mkdir -p bin
@VERSION=$$(cat VERSION | tr -d '\n') && \
echo "Building unified agent binaries..." && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X main.Version=v$$VERSION" -trimpath -o bin/pulse-agent-linux-amd64 ./cmd/pulse-agent && \
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w -X main.Version=v$$VERSION" -trimpath -o bin/pulse-agent-linux-arm64 ./cmd/pulse-agent && \
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w -X main.Version=v$$VERSION" -trimpath -o bin/pulse-agent-darwin-amd64 ./cmd/pulse-agent && \
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w -X main.Version=v$$VERSION" -trimpath -o bin/pulse-agent-darwin-arm64 ./cmd/pulse-agent && \
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w -X main.Version=v$$VERSION" -trimpath -o bin/pulse-agent-windows-amd64.exe ./cmd/pulse-agent
@echo "✓ All agent binaries built in bin/"
# Session handoff — merge a Claude session's handoff entry into MEMORY.md (flock-safe)
# Usage: make handoff SESSION_ID=<id>
# Expects handoff content at /tmp/handoff-$(SESSION_ID).md
handoff:
@if [ -z "$(SESSION_ID)" ]; then echo "Error: SESSION_ID required (make handoff SESSION_ID=xxx)" >&2; exit 1; fi
@./scripts/session-handoff.sh "$(SESSION_ID)" "/tmp/handoff-$(SESSION_ID).md"