Commit Graph

10 Commits

Author SHA1 Message Date
sharang a27072b6d0 ci(tenant-registry): pin golangci-lint to v2.12.2 (Go 1.25 compatible)
ci / shared (pull_request) Failing after 3s
ci / test (pull_request) Failing after 5s
ci / image (pull_request) Has been skipped
go.mod's 'go 1.25.0' directive (auto-set by go mod tidy because
testcontainers-go v0.42.0 requires it) made the runner's bundled
golangci-lint (built on Go 1.24) refuse to load the config.
Pin to v2.12.2, the latest at time of writing, which is built on
Go 1.25.

Also: previous gofmt commit had subject 'style: gofmt -w' which our
custom commitlint regex rejects (style isn't in the type allowlist).
Squashed into this commit so the PR's commits all pass commitlint.

Refs: M4.1
2026-05-19 12:04:57 +02:00
sharang 96aeb51779 style: gofmt -w
ci / shared (pull_request) Failing after 2s
ci / test (pull_request) Failing after 16s
ci / image (pull_request) Has been skipped
2026-05-19 12:03:10 +02:00
sharang c92fbad94b feat(schema): M4.1 — full tenant_registry schema + migrate binary
ci / shared (pull_request) Successful in 6s
ci / test (pull_request) Failing after 4s
ci / image (pull_request) Has been skipped
PLATFORM_ARCHITECTURE.md §5c schema, end-to-end:

  enums:    tenant_status (demo/trial/active/frozen/archived),
            tenant_kind (customer/demo), idp_kind (oidc/saml),
            tenant_project_status (active/archived)

  tables:   tenants            id/slug/name/status/kind/plan/erp_id/
                               stripe_id/trial_ends_at/contract_dates/
                               sales_owner
            tenant_projects    sub-tenancy (GCP-Project style); opt-in via
                               product manifest.supports_projects=true
            tenant_products    tenant ↔ product matrix + JSONB config
            tenant_idp_config  enterprise SSO (OIDC/SAML metadata + verified)
            api_keys           argon2 hash + prefix + scopes + revoked_at;
                               single source of truth across all products
            audit_log          Retraced-compatible: actor/action/target/
                               product/metadata; indexed for cross-product
                               filtering (PRODUCT_INTEGRATION_SPEC.md §8.4)

  triggers: updated_at auto-bump on every mutable table.
  fks:      ON DELETE CASCADE for owned rows; SET NULL for audit_log so
            forensic history outlives the tenant delete.

cmd/migrate (new binary):
  golang-migrate as a library with the migrations embedded via
  migrations/embed.go → embed.FS. Sub-commands: up / down / version /
  force. Ships as a self-contained binary; in prod it's the Orca init
  container per IMPLEMENTATION_PLAN.md §1.7.

Dockerfile builds both binaries; the migrate one runs as the init step.

Tests (require Docker; gated by -short):
  TestMigrate_upDownRoundTrip   schema → 6 tables + 4 enums; down→empty;
                                up-after-down succeeds (round-trip clean)
  TestSeed_canInsertAndQuery    insert across every table; FK cascade
                                works; audit_log SET-NULL keeps the row
  TestSlugConstraint            tenant.slug regex rejects too-short /
                                leading dash / trailing dash / uppercase /
                                underscore

Makefile:
  make migrate-up / down / down-all / version / create NAME=...
  make test-short  → skip integration when Docker isn't around
  make build-migrate  → just the migrator binary

The handler-layer in-memory store is unchanged; M4.2 swaps it for the
pgx-backed implementation against this schema.

Refs: M4.1
2026-05-19 12:01:37 +02:00
sharang 80181855bc feat(schema): M4.1 — full tenant_registry schema + migrate binary
PLATFORM_ARCHITECTURE.md §5c schema, end-to-end:

  enums:    tenant_status (demo/trial/active/frozen/archived),
            tenant_kind (customer/demo), idp_kind (oidc/saml),
            tenant_project_status (active/archived)

  tables:   tenants            id/slug/name/status/kind/plan/erp_id/
                               stripe_id/trial_ends_at/contract_dates/
                               sales_owner
            tenant_projects    sub-tenancy (GCP-Project style); opt-in via
                               product manifest.supports_projects=true
            tenant_products    tenant ↔ product matrix + JSONB config
            tenant_idp_config  enterprise SSO (OIDC/SAML metadata + verified)
            api_keys           argon2 hash + prefix + scopes + revoked_at;
                               single source of truth across all products
            audit_log          Retraced-compatible: actor/action/target/
                               product/metadata; indexed for cross-product
                               filtering (PRODUCT_INTEGRATION_SPEC.md §8.4)

  triggers: updated_at auto-bump on every mutable table.
  fks:      ON DELETE CASCADE for owned rows; SET NULL for audit_log so
            forensic history outlives the tenant delete.

cmd/migrate (new binary):
  golang-migrate as a library with the migrations embedded via
  migrations/embed.go → embed.FS. Sub-commands: up / down / version /
  force. Ships as a self-contained binary; in prod it's the Orca init
  container per IMPLEMENTATION_PLAN.md §1.7.

Dockerfile builds both binaries; the migrate one is invoked separately
as the init step.

Tests (require Docker; gated by -short):
  TestMigrate_upDownRoundTrip   schema → 6 tables + 4 enums; down→empty;
                                up-after-down succeeds (round-trip clean)
  TestSeed_canInsertAndQuery    insert across every table; FK cascade
                                works; audit_log SET-NULL keeps the row
  TestSlugConstraint            tenant.slug regex rejects too-short /
                                leading dash / trailing dash / uppercase /
                                underscore

Makefile:
  make migrate-up / down / down-all / version / create NAME=...
  make test-short  → skip integration when Docker isn't around
  make build-migrate  → just the migrator binary

The handler-layer in-memory store is unchanged; M4.2 swaps it for the
pgx-backed implementation against this schema.

Refs: M4.1
2026-05-19 12:01:16 +02:00
sharang e70ed771ca fix(dev): default port :8080 → :8090
ci / shared (push) Successful in 4s
ci / test (push) Successful in 9s
ci / image (push) Has been skipped
Unblock local dev: Keycloak owns :8080, so tenant-registry shifts to :8090. Prod is functionally unchanged.

Refs: M5.1
2026-05-19 09:47:36 +00:00
sharang af9f331781 feat(server): tenant-registry skeleton boots against dev stack
ci / shared (push) Successful in 4s
ci / test (push) Successful in 11s
ci / image (push) Has been skipped
Minimal Go service: /healthz + /v1/tenants/by-slug/:slug + /v1/tenants/:id with an in-memory store seeded with the acme tenant. Stdlib-only; pgx + JWT validation land in M4.1 follow-up.
2026-05-19 09:35:04 +00:00
sharang e960a5ff9d chore(domain): yourplatform.com → breakpilot.com
ci / shared (push) Successful in 4s
ci / test (push) Has been skipped
ci / image (push) Has been skipped
Apply platform-domain decision (2026-05-18). No services touched; docs/config only.

Refs: M1.1
2026-05-18 20:28:42 +00:00
sharang daff430960 ci: rework workflow for Gitea Actions (M0.2)
ci / shared (push) Successful in 3s
ci / test (push) Has been skipped
ci / image (push) Has been skipped
Switches commitlint to bash regex, gitleaks to inline binary, trivy to inline binary (v0.70.0). Per-stack jobs gated on hashFiles.

Refs: M0.2
2026-05-18 19:42:27 +00:00
sharang db14bfac9f chore: bootstrap repo scaffolding (M0.1)
ci / shared (push) Failing after 6s
ci / test (push) Failing after 3s
ci / image (push) Has been skipped
Bootstraps §1.2 scaffolding (README, CONTRIBUTING, CODEOWNERS, CHANGELOG, PR + issue templates, LICENSE, CI workflow, release workflow, commitlint, cliff, .editorconfig, .gitignore, .env.example) and ships a proprietary all-rights-reserved LICENSE naming both founders.

Refs: M0.1
2026-05-18 19:15:33 +00:00
sharang a24d372bcb Initial commit 2026-05-18 19:05:34 +00:00