mirror of
https://github.com/DeBrosOfficial/orama.git
synced 2026-06-16 22:54:12 +00:00
Workflow hardening based on the four-cycle release-debugging session:
Centralized versioning
- Add /VERSION at repo root as single source of truth.
- core/Makefile reads VERSION via `$(shell cat ../VERSION)`.
- Add `make bump VER=X.Y.Z` target that updates /VERSION and syncs
sdk/package.json in one shot.
Version mismatch guards
- All three release workflows (release.yaml, release-apt.yml,
publish-sdk.yml) now verify the release tag matches /VERSION at the
very first step. Stale-VERSION releases fail fast with a clear hint
to run `make bump`.
GoReleaser v2 migration
- Upgrade goreleaser-action v5 -> v6 (pinned `~> v2`).
- Add `version: 2` to .goreleaser.yaml.
- Migrate to v2 syntax: `archives.format` -> `formats: [...]`,
`brews.folder` -> `directory`, `snapshot.name_template` ->
`version_template`, `builds`-style references replaced with `ids:`.
- `before.hooks` can use map syntax again (v2 supports it).
Homebrew tap on stable only
- `brews.skip_upload` is now `'{{ if .Prerelease }}true{{ else }}false{{ end }}'`.
- Stops nightly releases from polluting the tap and from hitting 401
on stale HOMEBREW_TAP_TOKEN. Stable main releases still publish.
CI on every push
- New ci.yml runs `go vet` + `go test -race` on the core module and
typecheck/build/unit-tests on the SDK for every push to main/nightly
and every PR. version-sanity job warns when /VERSION and
sdk/package.json drift.
Version bump for next pipeline test
- /VERSION: 0.122.8
- sdk/package.json: 0.122.8
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
196 lines
7.6 KiB
Makefile
196 lines
7.6 KiB
Makefile
TEST?=./...
|
|
|
|
.PHONY: test
|
|
test:
|
|
@echo Running tests...
|
|
go test -v $(TEST)
|
|
|
|
# Gateway-focused E2E tests assume gateway and nodes are already running
|
|
# Auto-discovers configuration from ~/.orama and queries database for API key
|
|
# No environment variables required
|
|
.PHONY: test-e2e test-e2e-deployments test-e2e-fullstack test-e2e-https test-e2e-quick test-e2e-prod test-e2e-shared test-e2e-cluster test-e2e-integration test-e2e-production
|
|
|
|
# Production E2E tests - includes production-only tests
|
|
test-e2e-prod:
|
|
@if [ -z "$$ORAMA_GATEWAY_URL" ]; then \
|
|
echo "❌ ORAMA_GATEWAY_URL not set"; \
|
|
echo "Usage: ORAMA_GATEWAY_URL=https://dbrs.space make test-e2e-prod"; \
|
|
exit 1; \
|
|
fi
|
|
@echo "Running E2E tests (including production-only) against $$ORAMA_GATEWAY_URL..."
|
|
go test -v -tags "e2e production" -timeout 30m ./e2e/...
|
|
|
|
# Generic e2e target
|
|
test-e2e:
|
|
@echo "Running comprehensive E2E tests..."
|
|
@echo "Auto-discovering configuration from ~/.orama..."
|
|
go test -v -tags e2e -timeout 30m ./e2e/...
|
|
|
|
test-e2e-deployments:
|
|
@echo "Running deployment E2E tests..."
|
|
go test -v -tags e2e -timeout 15m ./e2e/deployments/...
|
|
|
|
test-e2e-fullstack:
|
|
@echo "Running fullstack E2E tests..."
|
|
go test -v -tags e2e -timeout 20m -run "TestFullStack" ./e2e/...
|
|
|
|
test-e2e-https:
|
|
@echo "Running HTTPS/external access E2E tests..."
|
|
go test -v -tags e2e -timeout 10m -run "TestHTTPS" ./e2e/...
|
|
|
|
test-e2e-shared:
|
|
@echo "Running shared E2E tests..."
|
|
go test -v -tags e2e -timeout 10m ./e2e/shared/...
|
|
|
|
test-e2e-cluster:
|
|
@echo "Running cluster E2E tests..."
|
|
go test -v -tags e2e -timeout 15m ./e2e/cluster/...
|
|
|
|
test-e2e-integration:
|
|
@echo "Running integration E2E tests..."
|
|
go test -v -tags e2e -timeout 20m ./e2e/integration/...
|
|
|
|
test-e2e-production:
|
|
@echo "Running production-only E2E tests..."
|
|
go test -v -tags "e2e production" -timeout 15m ./e2e/production/...
|
|
|
|
test-e2e-quick:
|
|
@echo "Running quick E2E smoke tests..."
|
|
go test -v -tags e2e -timeout 5m -run "TestStatic|TestHealth" ./e2e/...
|
|
|
|
# Network - Distributed P2P Database System
|
|
# Makefile for development and build tasks
|
|
|
|
.PHONY: build clean test deps tidy fmt vet lint install-hooks push-devnet push-testnet rollout-devnet rollout-testnet release bump
|
|
|
|
# Single source of truth — repo-root VERSION file. Update with `make bump VER=X.Y.Z`
|
|
# or by editing /VERSION directly. Release workflows verify this matches the tag.
|
|
VERSION := $(shell cat ../VERSION 2>/dev/null | tr -d '[:space:]' || echo unknown)
|
|
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
|
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
LDFLAGS := -X 'main.version=$(VERSION)' -X 'main.commit=$(COMMIT)' -X 'main.date=$(DATE)'
|
|
LDFLAGS_LINUX := -s -w $(LDFLAGS)
|
|
|
|
# Build targets
|
|
build: deps
|
|
@echo "Building network executables (version=$(VERSION))..."
|
|
@mkdir -p bin
|
|
go build -ldflags "$(LDFLAGS)" -o bin/identity ./cmd/identity
|
|
go build -ldflags "$(LDFLAGS)" -o bin/orama-node ./cmd/node
|
|
go build -ldflags "$(LDFLAGS)" -o bin/orama ./cmd/cli/
|
|
# Inject gateway build metadata via pkg path variables
|
|
go build -ldflags "$(LDFLAGS) -X 'github.com/DeBrosOfficial/network/pkg/gateway.BuildVersion=$(VERSION)' -X 'github.com/DeBrosOfficial/network/pkg/gateway.BuildCommit=$(COMMIT)' -X 'github.com/DeBrosOfficial/network/pkg/gateway.BuildTime=$(DATE)'" -o bin/gateway ./cmd/gateway
|
|
go build -ldflags "$(LDFLAGS)" -o bin/sfu ./cmd/sfu
|
|
go build -ldflags "$(LDFLAGS)" -o bin/turn ./cmd/turn
|
|
go build -ldflags "$(LDFLAGS)" -o bin/orama-sni-router ./cmd/sni-router
|
|
@echo "Build complete! Run ./bin/orama version"
|
|
|
|
# Cross-compile CLI for Linux (only binary needed locally; VPS builds everything else from source)
|
|
build-linux: deps
|
|
@echo "Cross-compiling CLI for linux/amd64 (version=$(VERSION))..."
|
|
@mkdir -p bin-linux
|
|
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS_LINUX)" -trimpath -o bin-linux/orama ./cmd/cli/
|
|
@echo "✓ CLI built at bin-linux/orama"
|
|
@echo ""
|
|
@echo "Prefer 'make build-archive' for full pre-built binary archive."
|
|
|
|
# Build pre-compiled binary archive for deployment (all binaries + deps)
|
|
build-archive: deps
|
|
@echo "Building binary archive (version=$(VERSION))..."
|
|
go build -ldflags "$(LDFLAGS)" -o bin/orama ./cmd/cli/
|
|
./bin/orama build --output /tmp/orama-$(VERSION)-linux-amd64.tar.gz
|
|
|
|
# Install git hooks
|
|
install-hooks:
|
|
@echo "Installing git hooks..."
|
|
@bash scripts/install-hooks.sh
|
|
|
|
# Install orama CLI to ~/.local/bin and configure PATH
|
|
install: build
|
|
@bash scripts/install.sh
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
@echo "Cleaning build artifacts..."
|
|
rm -rf bin/
|
|
rm -rf data/
|
|
@echo "Clean complete!"
|
|
|
|
# Push binary archive to devnet nodes (fanout distribution)
|
|
push-devnet:
|
|
./bin/orama node push --env devnet
|
|
|
|
# Push binary archive to testnet nodes (fanout distribution)
|
|
push-testnet:
|
|
./bin/orama node push --env testnet
|
|
|
|
# Full rollout to devnet (build + push + rolling upgrade)
|
|
rollout-devnet:
|
|
./bin/orama node rollout --env devnet --yes
|
|
|
|
# Full rollout to testnet (build + push + rolling upgrade)
|
|
rollout-testnet:
|
|
./bin/orama node rollout --env testnet --yes
|
|
|
|
# Bump the repo-root VERSION file and sync sdk/package.json.
|
|
# Usage: make bump VER=0.122.9
|
|
bump:
|
|
@if [ -z "$(VER)" ]; then \
|
|
echo "Usage: make bump VER=X.Y.Z"; exit 1; \
|
|
fi
|
|
@echo "$(VER)" > ../VERSION
|
|
@cd ../sdk && npm version $(VER) --no-git-tag-version > /dev/null
|
|
@echo "Bumped VERSION and sdk/package.json to $(VER)"
|
|
@echo "Next: git add ../VERSION ../sdk/package.json && git commit -m 'release: $(VER)'"
|
|
|
|
# Interactive release workflow (tag + push)
|
|
release:
|
|
@bash scripts/release.sh
|
|
|
|
# Check health of all nodes in an environment
|
|
# Usage: make health ENV=devnet
|
|
health:
|
|
@if [ -z "$(ENV)" ]; then \
|
|
echo "Usage: make health ENV=devnet|testnet"; \
|
|
exit 1; \
|
|
fi
|
|
./bin/orama monitor report --env $(ENV)
|
|
|
|
# Help
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " build - Build all executables"
|
|
@echo " install - Build and install 'orama' CLI to ~/.local/bin"
|
|
@echo " clean - Clean build artifacts"
|
|
@echo " test - Run unit tests"
|
|
@echo ""
|
|
@echo "E2E Testing:"
|
|
@echo " make test-e2e-prod - Run all E2E tests incl. production-only (needs ORAMA_GATEWAY_URL)"
|
|
@echo " make test-e2e-shared - Run shared E2E tests (cache, storage, pubsub, auth)"
|
|
@echo " make test-e2e-cluster - Run cluster E2E tests (libp2p, olric, rqlite, namespace)"
|
|
@echo " make test-e2e-integration - Run integration E2E tests (fullstack, persistence, concurrency)"
|
|
@echo " make test-e2e-deployments - Run deployment E2E tests"
|
|
@echo " make test-e2e-production - Run production-only E2E tests (DNS, HTTPS, cross-node)"
|
|
@echo " make test-e2e-quick - Quick smoke tests (static deploys, health checks)"
|
|
@echo " make test-e2e - Generic E2E tests (auto-discovers config)"
|
|
@echo ""
|
|
@echo " Example:"
|
|
@echo " ORAMA_GATEWAY_URL=https://orama-devnet.network make test-e2e-prod"
|
|
@echo ""
|
|
@echo "Deployment:"
|
|
@echo " make build-archive - Build pre-compiled binary archive for deployment"
|
|
@echo " make push-devnet - Push binary archive to devnet nodes"
|
|
@echo " make push-testnet - Push binary archive to testnet nodes"
|
|
@echo " make rollout-devnet - Full rollout: build + push + rolling upgrade (devnet)"
|
|
@echo " make rollout-testnet - Full rollout: build + push + rolling upgrade (testnet)"
|
|
@echo " make health ENV=devnet - Check health of all nodes in an environment"
|
|
@echo " make release - Interactive release workflow (tag + push)"
|
|
@echo ""
|
|
@echo "Maintenance:"
|
|
@echo " deps - Download dependencies"
|
|
@echo " tidy - Tidy dependencies"
|
|
@echo " fmt - Format code"
|
|
@echo " vet - Vet code"
|
|
@echo " lint - Lint code (fmt + vet)"
|
|
@echo " help - Show this help"
|