Conversation
Deploying chat with
|
| Latest commit: |
0fb2f42
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e479b015.chat-46r.pages.dev |
| Branch Preview URL: | https://ft-indexing-tools.chat-46r.pages.dev |
c53b29f to
fff5478
Compare
|
bugbot run |
|
Amazingggggg |
There was a problem hiding this comment.
Bugbot free trial expires on July 29, 2025
Learn more in the Cursor dashboard.
| }, | ||
| script: (domain: string) => { | ||
| if (domain.endsWith(HOSTING_APPS_DOMAIN)) { | ||
| if (domain.endsWith(HOSTING_APPS_DOMAIN) && domain.includes(DOUBLE_DASH)) { |
There was a problem hiding this comment.
Bug: Domain Format Change Breaks Existing Deployments
The Entrypoint.script method now requires domains to contain DOUBLE_DASH (e.g., app--deploymentid.deco.page) in addition to ending with HOSTING_APPS_DOMAIN. This breaks backward compatibility for existing apps deployed without the new deployment ID format, as their domains will now return null from Entrypoint.script, potentially disrupting routing.
Locations (1)
f35f542 to
5647ac6
Compare
|
@claude review |
|
Claude finished @viktormarinho's task —— View job Code Review Complete ✅I've reviewed the deployment isolation implementation. This is a significant architectural change that introduces deployment-based hosting with several critical issues that need to be addressed. Todo List:
SummaryThe PR introduces a deployment-based architecture for hosting apps, which is a valuable feature for preview environments and rollback capabilities. However, there are several critical bugs and backward compatibility issues that need to be resolved before merging. Critical Issues (Must Fix)1. Database Migration Order & Type MismatchFile: The migration creates a foreign key to a table that doesn't exist yet:
Fix: Either reorder migrations or change the 2. Backward Compatibility Breaking ChangeFile: script: (domain: string) => {
if (domain.endsWith(HOSTING_APPS_DOMAIN) && domain.includes(DOUBLE_DASH)) {
return domain.split(HOSTING_APPS_DOMAIN)[0];
}
return null;
},This breaks existing deployments without the Fix: Support both old and new formats: script: (domain: string) => {
if (domain.endsWith(HOSTING_APPS_DOMAIN)) {
return domain.split(HOSTING_APPS_DOMAIN)[0];
}
return null;
},3. Database Constraint MismatchFile: onConflict: "deployment_id,route_pattern,custom_domain"The upsert operation specifies a conflict resolution that doesn't match the actual database schema. The schema only has a unique constraint on Fix: Update to match the actual unique constraint or add the missing constraint to the schema. Additional Issues Found4. Domain Ownership Check Logic GapFile: const targetAddress = Entrypoint.host(scriptSlug);This doesn't account for deployment IDs when checking domain ownership. If a domain is configured to point to 5. Incomplete File Storage MigrationFile: // TODO (@mcandeia) files should be stored in R2 instead.
// files,Files are commented out in deployment creation, which means deployments lose their file data. This breaks the ability to reconstruct or compare deployments. 6. Missing Deployment ID Generation StrategyThe PR generates deployment IDs using Architecture Concerns7. Route Deletion StrategyFile: The route diffing logic deletes and recreates routes on each deployment. This could cause brief downtime during deployments and doesn't handle the case where multiple deployments share routes. 8. Missing Rollback ImplementationWhile the PR mentions rollback capabilities as motivation, there's no implementation of rollback functionality in the API. Recommendations
Minor Issues
The concept is solid and addresses real needs, but the implementation has critical bugs that must be resolved before merging to prevent breaking existing production deployments. |
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
5647ac6 to
80fba56
Compare
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
|
approved async w/ @tlgimenes |
feat: Add deployment isolation for hosting apps
Summary
Introduces a new deployment-based architecture for hosting apps to enable breaking change checks and safer production rollouts.
Motivation
Currently, hosting apps are deployed directly without the ability to:
Changes
Database Schema
New table:
deco_chat_hosting_apps_deploymentsid(text): Custom deployment identifier (e.g., "v1.0.0", "preview", "production")hosting_app_id(uuid): FK to hosting appscloudflare_deployment_id(text): Cloudflare worker identifierfiles(jsonb): Deployment-specific filesUpdated table:
deco_chat_hosting_routeshosting_app_idtodeployment_idAPI Changes
updateDatabase()to create deployment records