Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c50d248
feat: supabase auth users sync background runner in dashboard api
ben-fornefeld Mar 28, 2026
68a6265
chore: auto-commit generated changes
github-actions[bot] Mar 28, 2026
9d8fe63
feat(db): enhance auth user sync triggers to retain direct operations…
ben-fornefeld Mar 30, 2026
1e5f28b
Merge branch 'feature/supabase-users-sync-worker' of https://github.c…
ben-fornefeld Mar 30, 2026
56154df
feat(sync): implement user sync queue with enhanced error handling an…
ben-fornefeld Mar 30, 2026
3a431aa
feat(sync): add supabase auth user sync configuration and secrets man…
ben-fornefeld Mar 31, 2026
eb69678
chore: remove smoke test
ben-fornefeld Mar 31, 2026
bb9fa39
add: e2e runner test
ben-fornefeld Mar 31, 2026
461d2ec
chore: change dashboard-api env variable management
ben-fornefeld Mar 31, 2026
ce0cbd1
refactor(sync): update user sync logic to utilize new database structure
ben-fornefeld Mar 31, 2026
4d622ce
fix: lint
ben-fornefeld Mar 31, 2026
84ecd06
test: apply database migrations in end-to-end test setup
ben-fornefeld Mar 31, 2026
3f56979
Merge origin/main into feature/supabase-users-sync-worker
ben-fornefeld Apr 1, 2026
386d0c6
feat(sync): enhance user sync processing and acknowledgment
ben-fornefeld Apr 1, 2026
3e3fa3c
refactor(gcp): remove auth_db_connection_string resources and update …
ben-fornefeld Apr 1, 2026
5e0972b
chore(dashboard-api): refactor environment variable management
ben-fornefeld Apr 1, 2026
6b5a5c8
refactor: use river for queue worker
ben-fornefeld Apr 1, 2026
1113654
chore: auto-commit generated changes
github-actions[bot] Apr 1, 2026
fb0afd4
chore: auto-commit generated changes
github-actions[bot] Apr 1, 2026
bd4dd80
chore: update pgx dependency to v5.9.1 and golang.org/x/mod to v0.34.…
ben-fornefeld Apr 1, 2026
97e305a
Merge branch 'feature/supabase-users-sync-worker' of https://github.c…
ben-fornefeld Apr 1, 2026
c98878f
chore: fix lint
ben-fornefeld Apr 2, 2026
e314b96
chore: auto-commit generated changes
github-actions[bot] Apr 2, 2026
db124a4
improve: retrying for river jobs
ben-fornefeld Apr 2, 2026
0e7f147
Merge branch 'feature/supabase-users-sync-worker' of https://github.c…
ben-fornefeld Apr 2, 2026
eed510b
refactor: enhance auth user sync worker and streamline environment va…
ben-fornefeld Apr 2, 2026
8226f67
chore: rename config and fix test
ben-fornefeld Apr 2, 2026
8485d7a
improve: config
ben-fornefeld Apr 2, 2026
37f842f
Merge origin/main into feature/supabase-users-sync-worker
ben-fornefeld Apr 2, 2026
c0b1102
chore: auto-commit generated changes
github-actions[bot] Apr 2, 2026
87ef8f0
fix: correct env var name in template to match Go config
cursoragent Apr 2, 2026
45a7ccb
fix: update permissions for trigger_user on river_job and sequences i…
ben-fornefeld Apr 3, 2026
638429a
Merge branch 'feature/supabase-users-sync-worker' of https://github.c…
ben-fornefeld Apr 3, 2026
07d4c25
refactor: update environment variable handling and improve auth user …
ben-fornefeld Apr 6, 2026
bd1ebb1
chore: auto-commit generated changes
github-actions[bot] Apr 6, 2026
126d984
fix: lint
ben-fornefeld Apr 6, 2026
d4ba4c2
Merge branch 'feature/supabase-users-sync-worker' of https://github.c…
ben-fornefeld Apr 6, 2026
2ac1f83
Merge main into feature/supabase-users-sync-worker
ben-fornefeld Apr 9, 2026
da28e6a
chore: auto-commit generated changes
github-actions[bot] Apr 9, 2026
1512ede
chore: auto-commit generated changes
github-actions[bot] Apr 9, 2026
d25d531
refactor(dashboard-api): align auth user sync worker with review feed…
ben-fornefeld Apr 9, 2026
fe217ea
chore: auto-commit generated changes
github-actions[bot] Apr 9, 2026
40a5cd0
refactor(db): split supabase auth sync source client
ben-fornefeld Apr 9, 2026
c25caba
chore(db): address follow-up nits
ben-fornefeld Apr 9, 2026
18f7839
fix(dashboard-api): stop river worker gracefully on shutdown
ben-fornefeld Apr 9, 2026
9667b77
refactor(dashboard-api): simplify service lifecycle orchestration
ben-fornefeld Apr 9, 2026
37eb463
chore: auto-commit generated changes
github-actions[bot] Apr 9, 2026
c5d82f0
refactor(db): drop supabase replica client plumbing
ben-fornefeld Apr 9, 2026
e4d5bff
fix: use write db for supabase db get user read
ben-fornefeld Apr 9, 2026
4862139
chore: fix lint
ben-fornefeld Apr 9, 2026
4ecc627
fix(dashboard-api): lazy-init supabase worker client
ben-fornefeld Apr 9, 2026
29bbf59
chore(dashboard-api): reduce supabase worker pool size
ben-fornefeld Apr 9, 2026
48a620c
test(dashboard-api): tighten auth user sync coverage
ben-fornefeld Apr 10, 2026
2eda1d4
chore: auto-commit generated changes
github-actions[bot] Apr 10, 2026
bb31094
feat(dashboard-api): add supabase db config override
ben-fornefeld Apr 10, 2026
2a2311a
Merge remote-tracking branch 'origin/main' into feature/supabase-user…
ben-fornefeld Apr 10, 2026
11d0f0f
refactor(dashboard-api): narrow infra sync runner changes
ben-fornefeld Apr 10, 2026
1dc74e1
chore: auto-commit generated changes
github-actions[bot] Apr 10, 2026
1359257
chore: auto-commit generated changes
github-actions[bot] Apr 10, 2026
15291ac
refactor(supabase): drop unused trigger role setup
ben-fornefeld Apr 10, 2026
2c86213
refactor(dashboard-api): use shared not-found helper
ben-fornefeld Apr 10, 2026
fbb8835
chore: remove env vars artifact
ben-fornefeld Apr 10, 2026
1838a3b
refactor(dashboard-api): tie river worker to signal context
ben-fornefeld Apr 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.gcp.template
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ CLICKHOUSE_CLUSTER_SIZE=1

# Dashboard API instance count (default: 0)
DASHBOARD_API_COUNT=
# Dashboard API Supabase DB connection string (default: POSTGRES_CONNECTION_STRING)
SUPABASE_DB_CONNECTION_STRING=
# Enable dashboard-api auth user sync background worker (default: false)
ENABLE_AUTH_USER_SYNC_BACKGROUND_WORKER=

# Filestore cache for builds shared across cluster (default:false)
FILESTORE_CACHE_ENABLED=
Expand Down
20 changes: 6 additions & 14 deletions iac/modules/job-dashboard-api/jobs/dashboard-api.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,12 @@ job "dashboard-api" {
}

env {
GIN_MODE = "release"
ENVIRONMENT = "${environment}"
NODE_ID = "$${node.unique.id}"
PORT = "$${NOMAD_PORT_api}"
POSTGRES_CONNECTION_STRING = "${postgres_connection_string}"
AUTH_DB_CONNECTION_STRING = "${auth_db_connection_string}"
AUTH_DB_READ_REPLICA_CONNECTION_STRING = "${auth_db_read_replica_connection_string}"
CLICKHOUSE_CONNECTION_STRING = "${clickhouse_connection_string}"
SUPABASE_JWT_SECRETS = "${supabase_jwt_secrets}"
REDIS_URL = "${redis_url}"
REDIS_CLUSTER_URL = "${redis_cluster_url}"
REDIS_TLS_CA_BASE64 = "${redis_tls_ca_base64}"
OTEL_COLLECTOR_GRPC_ENDPOINT = "${otel_collector_grpc_endpoint}"
LOGS_COLLECTOR_ADDRESS = "${logs_collector_address}"
NODE_ID = "$${node.unique.id}"
PORT = "$${NOMAD_PORT_api}"

%{ for key, value in env ~}
${key} = "${value}"
%{ endfor ~}
}

config {
Expand Down
32 changes: 20 additions & 12 deletions iac/modules/job-dashboard-api/main.tf
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
locals {
base_env = {
GIN_MODE = "release"
ENVIRONMENT = var.environment
POSTGRES_CONNECTION_STRING = var.postgres_connection_string
AUTH_DB_CONNECTION_STRING = var.auth_db_connection_string
AUTH_DB_READ_REPLICA_CONNECTION_STRING = var.auth_db_read_replica_connection_string
SUPABASE_DB_CONNECTION_STRING = var.supabase_db_connection_string
CLICKHOUSE_CONNECTION_STRING = var.clickhouse_connection_string
SUPABASE_JWT_SECRETS = var.supabase_jwt_secrets
REDIS_URL = var.redis_url
REDIS_CLUSTER_URL = var.redis_cluster_url
REDIS_TLS_CA_BASE64 = var.redis_tls_ca_base64
ENABLE_AUTH_USER_SYNC_BACKGROUND_WORKER = tostring(var.enable_auth_user_sync_background_worker)
OTEL_COLLECTOR_GRPC_ENDPOINT = "localhost:${var.otel_collector_grpc_port}"
LOGS_COLLECTOR_ADDRESS = "http://localhost:${var.logs_proxy_port.port}"
}
}

resource "nomad_job" "dashboard_api" {
jobspec = templatefile("${path.module}/jobs/dashboard-api.hcl", {
update_stanza = var.update_stanza
node_pool = var.node_pool
image_name = var.image
environment = var.environment

count = var.count_instances

memory_mb = 512
cpu_count = 1

postgres_connection_string = var.postgres_connection_string
auth_db_connection_string = var.auth_db_connection_string
auth_db_read_replica_connection_string = var.auth_db_read_replica_connection_string
clickhouse_connection_string = var.clickhouse_connection_string
supabase_jwt_secrets = var.supabase_jwt_secrets
redis_url = var.redis_url
redis_cluster_url = var.redis_cluster_url
redis_tls_ca_base64 = var.redis_tls_ca_base64
env = local.base_env

subdomain = "dashboard-api"

otel_collector_grpc_endpoint = "localhost:${var.otel_collector_grpc_port}"
logs_collector_address = "http://localhost:${var.logs_proxy_port.port}"
})
}
11 changes: 11 additions & 0 deletions iac/modules/job-dashboard-api/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ variable "auth_db_read_replica_connection_string" {
default = ""
}

variable "supabase_db_connection_string" {
type = string
sensitive = true
default = ""
}

variable "clickhouse_connection_string" {
type = string
sensitive = true
Expand All @@ -44,6 +50,11 @@ variable "supabase_jwt_secrets" {
sensitive = true
}

variable "enable_auth_user_sync_background_worker" {
type = bool
default = false
}

variable "otel_collector_grpc_port" {
type = number
default = 4317
Expand Down
2 changes: 2 additions & 0 deletions iac/provider-gcp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ tf_vars := \
$(call tfvar, LOKI_BOOT_DISK_TYPE) \
$(call tfvar, LOKI_USE_V13_SCHEMA_FROM) \
$(call tfvar, DASHBOARD_API_COUNT) \
$(call tfvar, SUPABASE_DB_CONNECTION_STRING) \
$(call tfvar, ENABLE_AUTH_USER_SYNC_BACKGROUND_WORKER) \
$(call tfvar, DEFAULT_PERSISTENT_VOLUME_TYPE) \
$(call tfvar, PERSISTENT_VOLUME_TYPES) \
$(call tfvar, DB_MAX_OPEN_CONNECTIONS) \
Expand Down
4 changes: 3 additions & 1 deletion iac/provider-gcp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ module "nomad" {
otel_collector_resources_cpu_count = var.otel_collector_resources_cpu_count

# Dashboard API
dashboard_api_count = var.dashboard_api_count
dashboard_api_count = var.dashboard_api_count
supabase_db_connection_string = var.supabase_db_connection_string
enable_auth_user_sync_background_worker = var.enable_auth_user_sync_background_worker

# Docker reverse proxy
docker_reverse_proxy_port = var.docker_reverse_proxy_port
Expand Down
18 changes: 10 additions & 8 deletions iac/provider-gcp/nomad/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,16 @@ module "dashboard_api" {

image = data.google_artifact_registry_docker_image.dashboard_api_image[0].self_link

postgres_connection_string = data.google_secret_manager_secret_version.postgres_connection_string.secret_data
auth_db_connection_string = data.google_secret_manager_secret_version.postgres_connection_string.secret_data
auth_db_read_replica_connection_string = trimspace(data.google_secret_manager_secret_version.postgres_read_replica_connection_string.secret_data)
clickhouse_connection_string = local.clickhouse_connection_string
supabase_jwt_secrets = trimspace(data.google_secret_manager_secret_version.supabase_jwt_secrets.secret_data)
redis_url = local.redis_url
redis_cluster_url = local.redis_cluster_url
redis_tls_ca_base64 = trimspace(data.google_secret_manager_secret_version.redis_tls_ca_base64.secret_data)
postgres_connection_string = data.google_secret_manager_secret_version.postgres_connection_string.secret_data
auth_db_connection_string = data.google_secret_manager_secret_version.postgres_connection_string.secret_data
auth_db_read_replica_connection_string = trimspace(data.google_secret_manager_secret_version.postgres_read_replica_connection_string.secret_data)
supabase_db_connection_string = var.supabase_db_connection_string
clickhouse_connection_string = local.clickhouse_connection_string
supabase_jwt_secrets = trimspace(data.google_secret_manager_secret_version.supabase_jwt_secrets.secret_data)
redis_url = local.redis_url
redis_cluster_url = local.redis_cluster_url
redis_tls_ca_base64 = trimspace(data.google_secret_manager_secret_version.redis_tls_ca_base64.secret_data)
enable_auth_user_sync_background_worker = var.enable_auth_user_sync_background_worker

otel_collector_grpc_port = var.otel_collector_grpc_port
logs_proxy_port = var.logs_proxy_port
Expand Down
11 changes: 11 additions & 0 deletions iac/provider-gcp/nomad/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,17 @@ variable "dashboard_api_count" {
default = 0
}

variable "supabase_db_connection_string" {
type = string
default = ""
sensitive = true
}

variable "enable_auth_user_sync_background_worker" {
type = bool
default = false
}

variable "volume_token_issuer" {
type = string
}
Expand Down
11 changes: 11 additions & 0 deletions iac/provider-gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@ variable "dashboard_api_count" {
default = 0
}

variable "supabase_db_connection_string" {
type = string
default = ""
sensitive = true
}

variable "enable_auth_user_sync_background_worker" {
type = bool
default = false
}

variable "docker_reverse_proxy_port" {
type = object({
name = string
Expand Down
4 changes: 2 additions & 2 deletions packages/api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
github.com/google/uuid v1.6.0
github.com/grafana/loki/v3 v3.6.4
github.com/hashicorp/nomad/api v0.0.0-20251216171439-1dee0671280e
github.com/jackc/pgx/v5 v5.7.5
github.com/jackc/pgx/v5 v5.9.1
github.com/launchdarkly/go-sdk-common/v3 v3.3.0
github.com/launchdarkly/go-server-sdk/v7 v7.13.0
github.com/oapi-codegen/gin-middleware v1.0.2
Expand Down Expand Up @@ -386,7 +386,7 @@ require (
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
golang.org/x/image v0.38.0 // indirect
golang.org/x/mod v0.33.0 // indirect
golang.org/x/mod v0.34.0 // indirect
golang.org/x/oauth2 v0.34.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/text v0.35.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions packages/api/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/auth/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ require (
github.com/jackc/pgerrcode v0.0.0-20250907135507-afb5586c32a6 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgx/v5 v5.7.5 // indirect
github.com/jackc/pgx/v5 v5.9.1 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/jellydator/ttlcache/v3 v3.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions packages/auth/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/clickhouse/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgx/v5 v5.7.5 // indirect
github.com/jackc/pgx/v5 v5.9.1 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/joho/godotenv v1.5.1 // indirect
github.com/jonboulle/clockwork v0.5.0 // indirect
Expand Down Expand Up @@ -93,7 +93,7 @@ require (
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.49.0 // indirect
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
golang.org/x/mod v0.33.0 // indirect
golang.org/x/mod v0.34.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.42.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions packages/clickhouse/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/client-proxy/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ require (
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
golang.org/x/mod v0.33.0 // indirect
golang.org/x/mod v0.34.0 // indirect
golang.org/x/net v0.52.0 // indirect
golang.org/x/sync v0.20.0 // indirect
golang.org/x/sys v0.42.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions packages/client-proxy/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions packages/dashboard-api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ generate:

.PHONY: build
build:
# Allow for passing commit sha directly for docker builds
$(eval COMMIT_SHA ?= $(shell git rev-parse --short HEAD))
$(eval EXPECTED_MIGRATION_TIMESTAMP ?= $(expectedMigration))
CGO_ENABLED=0 go build -o bin/dashboard-api -ldflags "-X=main.commitSHA=$(COMMIT_SHA) -X=main.expectedMigrationTimestamp=$(EXPECTED_MIGRATION_TIMESTAMP)" .

.PHONY: build-and-upload
build-and-upload:
$(eval COMMIT_SHA := $(shell git rev-parse --short HEAD))
$(eval EXPECTED_MIGRATION_TIMESTAMP := $(expectedMigration))
@ docker build --platform linux/amd64 --tag $(IMAGE_REGISTRY) --push --build-arg COMMIT_SHA="$(COMMIT_SHA)" --build-arg EXPECTED_MIGRATION_TIMESTAMP="$(EXPECTED_MIGRATION_TIMESTAMP)" -f ./Dockerfile ..
$(eval COMMIT_SHA := $(shell git rev-parse --short HEAD))
$(eval EXPECTED_MIGRATION_TIMESTAMP := $(expectedMigration))
@docker build --platform linux/amd64 --tag $(IMAGE_REGISTRY) --push --build-arg COMMIT_SHA="$(COMMIT_SHA)" --build-arg EXPECTED_MIGRATION_TIMESTAMP="$(EXPECTED_MIGRATION_TIMESTAMP)" -f ./Dockerfile ..

.PHONY: run
run:
Expand Down
Loading
Loading