feat(site-deployment): multi-tenant per-client deploy targets (MT)#13
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR threads a per-client site_deployment transport configuration through the surpass-plan execution path so autonomous edits/deploys target each tenant’s own GitHub repo and Vercel hook (instead of the shared env-based WEBSITE_BOT_REPO).
Changes:
- Adds
ClientSiteDeploymentConfigand optionalsite_deploymentonClientConfigfor MT deploy targets. - Introduces
siteConfigFromClient(...)and threads an explicitSiteDeploymentConfigthrough site-deployment action functions and the plan executor dispatch path. - Extends the add-client onboarding script and adds/updates tests for MT config resolution and routing.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/services/site-deployment.test.ts | Adds coverage for siteConfigFromClient dry-run guard and explicit-config repo routing in updateMetaTitle. |
| tests/services/plan-executor.test.ts | Verifies per-client config threading through dispatch + deploy, dry-run fallback, and FAQ no-op behavior. |
| src/types/index.ts | Adds ClientSiteDeploymentConfig and optional site_deployment field to ClientConfig. |
| src/services/site-deployment.ts | Adds siteConfigFromClient and threads optional config through deployment actions / deploy trigger. |
| scripts/add-client.ts | Prompts for and stores config.site_deployment during onboarding, warning when incomplete (dry-run). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Threads a per-client `site_deployment` transport config end-to-end so each client's autonomous surpass-plan edits write to THAT client's repo/deploy hook instead of the single shared WEBSITE_BOT_REPO. Unblocks the multi-tenant serp:execute-surpass-plans fan-out (enable-flip stays a separate operational change; enabled:false untouched). - types: ClientSiteDeploymentConfig (all fields optional, JSONB reality) + optional site_deployment on ClientConfig (no migration). - site-deployment: siteConfigFromClient(Partial<ClientConfig>) with the same dry-run safety invariant as siteConfigFromEnv (absent/blank token or repo, or the NODE_ENV/SITE_DEPLOY_DRY_RUN kills, force dryRun). readFile now short-circuits in dry-run (no outbound GET), so an unconfigured tenant is a true no-op. Optional config? on all 7 action fns. - plan-executor: ActionDispatcher gains a 4th siteConfig param; executor resolves siteConfigFromClient(job.data.clientConfig) and threads it through every dispatch + the final triggerVercelDeploy. faq_content_update stays a no-op. - add-client: prompts for + stores config.site_deployment; process.stdout/ stderr.write for new output (AGENTS.md no-console.log). - tests: siteConfigFromClient full/missing/blank(G6)/NODE_ENV; explicit config overrides env; dry-run makes no GET/PUT; plan-executor per-client routing, dry-run fallback, faq no-write. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VqWfuXWTn5jo8f5fnkSozx
cryptoxdog
force-pushed
the
feat/mt-site-deployment
branch
from
July 19, 2026 01:06
2ad643c to
5f40db1
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What & why
Threads a per-client
site_deploymenttransport config end-to-end so each client's autonomous surpass-plan edits write to that client's repo / Vercel deploy hook instead of the single sharedWEBSITE_BOT_REPO. This is the C-02 enabler for multi-tenantserp:execute-surpass-plans.The scheduler fan-out already attaches the full
clients.configjsonb asjob.data.clientConfigto every per-client job, so this is a surgical thread-through — no schema migration (clients.configis jsonb).Code-only. The
enabled:false → trueflip onserp:execute-surpass-plansis intentionally not in this PR — it stays a separate operational change made only after real per-client config is in the DB. Safety is enforced at thesiteConfigFromClientboundary, so the flip is safe-by-construction once config exists.Changes
src/types/index.ts) — addClientSiteDeploymentConfigand an optionalsite_deploymentonClientConfig.src/services/site-deployment.ts)siteConfigFromClient(clientConfig)— builds the per-tenant config with the same dry-run safety invariant assiteConfigFromEnv: absent or blank token/repo (and theNODE_ENV/SITE_DEPLOY_DRY_RUNenv kills) forcedryRun:true. A half-populatedsite_deploymentnever performs a live write.config?: SiteDeploymentConfigon all 7 action fns (updateMetaTitle,updateMetaDescription,injectSchema,updateHeading,rewritePageContent,updateFaq,triggerVercelDeploy). Additive — existing no-arg callers still compile.src/services/plan-executor.ts) — widenActionDispatcherwith a 4thsiteConfigparam (alias updated before any dispatcher body), resolvesiteConfigFromClient(job.data.clientConfig ?? {})inexecuteSurpassPlans, thread it through every dispatch and the finaltriggerVercelDeploy.faq_content_updatekeeps its documented no-op.scripts/add-client.ts) — prompt for + storeconfig.site_deployment; warn when incomplete (client operates in dry-run).Tests
siteConfigFromClient: full→dryRun:false; missing token→dryRun:true; empty-string repo→dryRun:true(G6); NODE_ENV=test global kill honored even with a full config.updateMetaTitlewith an explicit config reads/writes against the injected repo, not the env fallback.site_deployment→ dry-run fallback;faq_content_updatedispatches no write (G3).Verification
tsc --noEmit= 0 (the sole remaining error is a pre-existing@infisical/sdkmodule-resolution artifact of this sandbox's dependency install, unrelated to this change and resolved in CI).vitest run— 40/40 green.Rollback
If a future enable-flip causes an unintended write: flip
enabled:true → falseand redeploy; confirm no job re-enqueues next cycle; audit recentgapAnalysesrows atstatus='executing'.🤖 Generated with Claude Code
Generated by Claude Code