Skip to content

feat(publish): route publish workers by workspace#371

Merged
KurodaKayn merged 5 commits into
mainfrom
feat/citus-worker-routing
Jul 3, 2026
Merged

feat(publish): route publish workers by workspace#371
KurodaKayn merged 5 commits into
mainfrom
feat/citus-worker-routing

Conversation

@KurodaKayn

Copy link
Copy Markdown
Owner

Title: feat(publish): route publish workers by workspace

Feature Description

  • Carries workspace_id through publish jobs, outbox replay, scheduled publication dispatch, lifecycle transitions, idempotency replay, and activity/event writes.
  • Rejects publish worker payloads whose workspace does not match the project while releasing the stale publish lock.
  • Records Citus Phase 5 constraint, foreign-key, and join review evidence and updates table-group readiness terms.

Implementation Approach

  • Adds workspace-scoped publish helpers and uses the project workspace for publication, account, schedule, and replay queries.
  • Backfills legacy publish job payloads by resolving the project workspace during outbox dispatch or worker processing.
  • Adds a YAML constraint review manifest plus Minitest coverage for required refactor, partition, and worker-routing sections.

Testing

  • golangci-lint run ./... from backend/ passed.
  • bash script/ci/backend.sh passed.
  • ruby script/db/test_citus_constraint_review.rb passed.
  • ruby script/db/test_citus_table_groups.rb passed.

Publish workers need tenant routing before project-domain tables can move toward Citus distribution.

Add workspace ids to publish job payloads and scope publication, schedule, account, activity, and replay lookups through the project workspace.

Mismatched worker payloads are discarded after releasing their publish lock while legacy payloads derive a workspace from the project.
Publish queue tests need to pin the tenant routing behavior added to durable worker payloads.

Assert workspace ids in queue and outbox payloads, including legacy outbox replay derivation.

Cover mismatched workspace jobs so they leave publication state untouched and release their lock.
Phase 5 needs explicit constraint and join evidence before distributed-table rehearsal.

Add a constraint review manifest and update table-group readiness terms with required primary-key, unique, and partition follow-ups.

Update the database optimization plan to mark the review and worker-routing evidence as completed.
The constraint review should stay machine-checkable as Phase 5 routing evidence evolves.

Add a Minitest guard for required unique, partition, foreign-key, join, and worker-payload review sections.

Also ensure table-group readiness terms no longer defer unresolved review work behind generic labels.
Workspace-aware publish helpers replaced the project-only private wrappers during worker routing.

Remove the unused compatibility methods that now only forward to workspace-scoped implementations.

This keeps backend lint clean without changing publish behavior.
@KurodaKayn KurodaKayn merged commit 2c44cbd into main Jul 3, 2026
14 checks passed
@KurodaKayn KurodaKayn deleted the feat/citus-worker-routing branch July 3, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant