activity-core/Makefile

55 lines
2.4 KiB
Makefile
Raw Normal View History

-include .env
export
.PHONY: sync-event-types sync-activity-definitions test migrate sync-all \
dev-up dev-down railiance-up railiance-down \
start-worker start-api start-event-router help
sync-activity-definitions: ## Sync ActivityDefinition files into DB
feat(WP-0003b): parser, workflow wiring, triggers, webhooks T44: ActivityDefinition markdown file parser (definition_parser.py) - Scans activity-definitions/*.md and ACTIVITY_DEFINITION_DIRS paths - Parses YAML frontmatter + fenced rule/instruction blocks - Raises ParseError on any malformed file — never silently skips T45: ActivityDefinition sync command - Migration 0006: adds rules_json/instructions_json JSONB columns - sync_activity_definitions.py + make sync-activity-definitions - Called at worker startup before schedule sync T46: Rule/instruction pipeline wired into RunActivityWorkflow - New evaluate_rules and emit_tasks Temporal activities - Workflow passes event_envelope_json to enable rule evaluation - EventRouter now passes full envelope JSON as 4th workflow arg - IssueSink.emit() writes task_spawn_log rows per task T47: ScheduledTriggerConfig model (one-off future datetime trigger) T48: One-off Temporal Schedule support - Fixed timezone_name → time_zone_name (was causing all schedule tests to fail) - Added ScheduleCalendarSpec-based one-off schedule with remaining_actions=1 - cancel_scheduled() for admin cancellation - Fixed backfill() call to use *args unpacking (not list wrapper) - Fixed ScheduleAlreadyRunningError catch in upsert_schedule - sync_schedules now handles ScheduledTriggerConfig definitions T49: Webhook receiver - POST /webhooks/gitea — HMAC-SHA256 via X-Gitea-Signature-256 - POST /webhooks/github — HMAC-SHA256 via X-Hub-Signature-256 - Normalisers: repo.created, push, issue.closed → EventEnvelope - Publishes to NATS activity.{type} subject after registry validation - Mounted in api.py at /webhooks prefix T50: Gitea event type definitions - gitea.repo.created.md, gitea.push.md, gitea.issue.closed.md - Each includes normaliser field mapping in Consumer Notes Tests: 18 passed, 1 skipped (integration). Fixed embedded Temporal server visibility latency in test_upsert_schedule_creates_schedule. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-14 23:02:33 +02:00
uv run python -m activity_core.sync_activity_definitions
sync-event-types: ## Sync event type YAML files into DB
uv run python scripts/sync_event_types.py
test: ## Run test suite
uv run pytest tests/ -v
# ── Database ──────────────────────────────────────────────────────────────────
migrate: ## Apply all pending Alembic migrations
uv run alembic upgrade head
sync-all: sync-event-types sync-activity-definitions ## Sync event types and activity definitions
# ── Infrastructure ─────────────────────────────────────────────────────────────
dev-up: ## Start full dev stack (Temporal + PG + ES + NATS)
docker compose -f docker-compose.dev.yml up -d
dev-down: ## Stop and remove dev stack containers
docker compose -f docker-compose.dev.yml down
railiance-up: ## Build image and start full railiance stack (no Elasticsearch)
docker compose -f docker-compose.railiance.yml up -d --build
railiance-down: ## Stop and remove railiance stack containers
docker compose -f docker-compose.railiance.yml down
# ── Local dev processes ───────────────────────────────────────────────────────
start-worker: ## Start Temporal worker (reads env from .env if present)
uv run python -m activity_core.worker
start-api: ## Start FastAPI server on :8010 with hot reload
uv run uvicorn activity_core.api:app --host 0.0.0.0 --port 8010 --reload
start-event-router: ## Start NATS event router
uv run python -m activity_core.event_router
# ── Help ──────────────────────────────────────────────────────────────────────
help: ## Show this help message
@grep -E '^[a-zA-Z_-]+:.*?##' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-24s\033[0m %s\n", $$1, $$2}' | \
sort