From be42f4eb7e484eb415cf4d8019ee58d2fe21f9df Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 19 Feb 2026 16:08:21 +0100 Subject: [PATCH] acc: testserver: use production as default postgres branch name to match cloud The testserver was creating default branches with UID-based names (br-XXXX), but cloud uses a fixed name "production". This caused source_branch in branch responses to differ between local and cloud runs, breaking postgres_branches acceptance tests on cloud. Co-Authored-By: Claude Sonnet 4.6 --- .../bundle/resources/postgres_branches/basic/output.txt | 2 +- .../resources/postgres_branches/recreate/out.get_branch.txt | 2 +- .../update_protected/out.plan.no_change.direct.json | 2 +- .../update_protected/out.plan.restore.direct.json | 2 +- .../update_protected/out.plan.update.direct.json | 2 +- .../resources/postgres_branches/update_protected/output.txt | 6 +++--- libs/testserver/postgres.go | 3 ++- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/acceptance/bundle/resources/postgres_branches/basic/output.txt b/acceptance/bundle/resources/postgres_branches/basic/output.txt index de26b7f0e7..ae9053d377 100644 --- a/acceptance/bundle/resources/postgres_branches/basic/output.txt +++ b/acceptance/bundle/resources/postgres_branches/basic/output.txt @@ -38,7 +38,7 @@ Deployment complete! "current_state": "READY", "default": false, "is_protected": false, - "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]", + "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production", "source_branch_lsn": "[LSN]", "source_branch_time": "[TIMESTAMP]", "state_change_time": "[TIMESTAMP]" diff --git a/acceptance/bundle/resources/postgres_branches/recreate/out.get_branch.txt b/acceptance/bundle/resources/postgres_branches/recreate/out.get_branch.txt index b67568fe15..46df988170 100644 --- a/acceptance/bundle/resources/postgres_branches/recreate/out.get_branch.txt +++ b/acceptance/bundle/resources/postgres_branches/recreate/out.get_branch.txt @@ -5,7 +5,7 @@ "current_state": "READY", "default": false, "is_protected": false, - "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]", + "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production", "source_branch_lsn": "[LSN]", "source_branch_time": "[TIMESTAMP]", "state_change_time": "[TIMESTAMP]" diff --git a/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.no_change.direct.json b/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.no_change.direct.json index 99377fbc4c..32120ec36e 100644 --- a/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.no_change.direct.json +++ b/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.no_change.direct.json @@ -14,7 +14,7 @@ "current_state": "READY", "default": false, "is_protected": false, - "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]", + "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production", "source_branch_lsn": "[LSN]", "source_branch_time": "[TIMESTAMP]", "state_change_time": "[TIMESTAMP]" diff --git a/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.restore.direct.json b/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.restore.direct.json index 55de1ec12d..110fb1aea0 100644 --- a/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.restore.direct.json +++ b/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.restore.direct.json @@ -22,7 +22,7 @@ "current_state": "READY", "default": false, "is_protected": true, - "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]", + "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production", "source_branch_lsn": "[LSN]", "source_branch_time": "[TIMESTAMP]", "state_change_time": "[TIMESTAMP]" diff --git a/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.update.direct.json b/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.update.direct.json index c466b27a61..58169e75a3 100644 --- a/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.update.direct.json +++ b/acceptance/bundle/resources/postgres_branches/update_protected/out.plan.update.direct.json @@ -22,7 +22,7 @@ "current_state": "READY", "default": false, "is_protected": false, - "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]", + "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production", "source_branch_lsn": "[LSN]", "source_branch_time": "[TIMESTAMP]", "state_change_time": "[TIMESTAMP]" diff --git a/acceptance/bundle/resources/postgres_branches/update_protected/output.txt b/acceptance/bundle/resources/postgres_branches/update_protected/output.txt index 343f8257f4..b32d48a909 100644 --- a/acceptance/bundle/resources/postgres_branches/update_protected/output.txt +++ b/acceptance/bundle/resources/postgres_branches/update_protected/output.txt @@ -33,7 +33,7 @@ Deployment complete! "current_state": "READY", "default": false, "is_protected": false, - "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]", + "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production", "source_branch_lsn": "[LSN]", "source_branch_time": "[TIMESTAMP]", "state_change_time": "[TIMESTAMP]" @@ -107,7 +107,7 @@ Deployment complete! "current_state": "READY", "default": false, "is_protected": true, - "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]", + "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production", "source_branch_lsn": "[LSN]", "source_branch_time": "[TIMESTAMP]", "state_change_time": "[TIMESTAMP]" @@ -141,7 +141,7 @@ Deployment complete! "current_state": "READY", "default": false, "is_protected": false, - "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]", + "source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production", "source_branch_lsn": "[LSN]", "source_branch_time": "[TIMESTAMP]", "state_change_time": "[TIMESTAMP]" diff --git a/libs/testserver/postgres.go b/libs/testserver/postgres.go index 3ff865d4d9..5961b2f7e3 100644 --- a/libs/testserver/postgres.go +++ b/libs/testserver/postgres.go @@ -618,10 +618,11 @@ func (s *FakeWorkspace) createOperationLocked(resourceName string, response any) } // createDefaultBranchLocked creates a default branch for a project (caller must hold lock). +// The default branch is named "production" to match cloud API behavior. func (s *FakeWorkspace) createDefaultBranchLocked(projectName string) { now := nowTime() branchUID := "br-" + nextUUID()[:20] - branchName := projectName + "/branches/" + branchUID + branchName := projectName + "/branches/production" defaultBranch := postgres.Branch{ Name: branchName,