Skip to content

feat: Entrypoint for schedule controller - #542

Merged
thesujai merged 5 commits into
mainfrom
feat/entry-point-schedule-controller
Sep 2, 2026
Merged

feat: Entrypoint for schedule controller#542
thesujai merged 5 commits into
mainfrom
feat/entry-point-schedule-controller

Conversation

@thesujai

@thesujai thesujai commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Entrypoint for schedule controller

Closes #

Changes

Entrypoint for schedule controller

How was this tested?

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Split deployments depend on exactly one controller per database and correct SERVER_URL; misconfiguration could duplicate dispatch or leave schedules idle, and Helm value renames (replicaCountserver.replicaCount) are a breaking chart upgrade.

Overview
Adds dist/controller-main.js so schedule dispatch and other periodic control loops can run as a single-replica process in distributed mode (STANDALONE=false), calling the server API over HTTP via new SERVER_URL (default http://localhost:$PORT). Standalone still runs the controller in the server process; the dedicated entry exits cleanly when STANDALONE=true.

Build & dev: tsup emits controller-main; package scripts add start:controller and parallel dev:controller for local split-process dev. Logs gain a component field (server | controller) in JSON mode.

Deployments: Docker Compose, Railway IaC, and the Helm chart each gain a second controller workload (fixed 1 replica, Recreate / zero overlap on Railway) with SERVER_URL pointed at the server service. Helm moves server scaling knobs under server.replicaCount / server.strategy and documents the controller Deployment (no Service, distinct selector labels so traffic never hits controller pods).

Reviewed by Cursor Bugbot for commit 00c57ce. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 00c57ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@truefoundry/trueforge Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 63b9a5f. Configure here.

Comment thread packages/trueforge/src/controller-main.ts
Comment thread packages/trueforge/package.json
Comment thread charts/trueforge/templates/controller-deployment.yaml
Comment thread docker-compose.yml Outdated
Comment thread packages/trueforge/src/controller-main.ts Outdated
Comment thread packages/trueforge/src/config.ts Outdated
Comment thread packages/trueforge/.env.example Outdated
Comment thread packages/trueforge/tsup.config.ts
Comment thread packages/trueforge/src/controller-main.ts Outdated
Comment thread packages/trueforge/src/controller-main.ts
Comment thread packages/trueforge/src/controller-main.ts Outdated
Comment thread docker-compose.yml
Comment thread charts/trueforge/values.yaml Outdated
Comment thread charts/trueforge/values.yaml Outdated

@chiragjn chiragjn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with minor comments

@thesujai
thesujai enabled auto-merge (squash) September 2, 2026 08:31
@thesujai
thesujai merged commit 55cc5e7 into main Sep 2, 2026
11 checks passed
@thesujai
thesujai deleted the feat/entry-point-schedule-controller branch September 2, 2026 08:36
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.

4 participants