Skip to content

Commit 06304ac

Browse files
pieternclaude
andauthored
acc: Use production as default postgres branch name (#4557)
## Changes 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 Opus 4.6 <noreply@anthropic.com>
1 parent 10d976b commit 06304ac

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

acceptance/bundle/resources/postgres_branches/basic/output.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Deployment complete!
3838
"current_state": "READY",
3939
"default": false,
4040
"is_protected": false,
41-
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]",
41+
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production",
4242
"source_branch_lsn": "[LSN]",
4343
"source_branch_time": "[TIMESTAMP]",
4444
"state_change_time": "[TIMESTAMP]"

acceptance/bundle/resources/postgres_branches/recreate/out.get_branch.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"current_state": "READY",
66
"default": false,
77
"is_protected": false,
8-
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]",
8+
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production",
99
"source_branch_lsn": "[LSN]",
1010
"source_branch_time": "[TIMESTAMP]",
1111
"state_change_time": "[TIMESTAMP]"

acceptance/bundle/resources/postgres_branches/update_protected/out.plan.no_change.direct.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"current_state": "READY",
1515
"default": false,
1616
"is_protected": false,
17-
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]",
17+
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production",
1818
"source_branch_lsn": "[LSN]",
1919
"source_branch_time": "[TIMESTAMP]",
2020
"state_change_time": "[TIMESTAMP]"

acceptance/bundle/resources/postgres_branches/update_protected/out.plan.restore.direct.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"current_state": "READY",
2323
"default": false,
2424
"is_protected": true,
25-
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]",
25+
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production",
2626
"source_branch_lsn": "[LSN]",
2727
"source_branch_time": "[TIMESTAMP]",
2828
"state_change_time": "[TIMESTAMP]"

acceptance/bundle/resources/postgres_branches/update_protected/out.plan.update.direct.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"current_state": "READY",
2323
"default": false,
2424
"is_protected": false,
25-
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]",
25+
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production",
2626
"source_branch_lsn": "[LSN]",
2727
"source_branch_time": "[TIMESTAMP]",
2828
"state_change_time": "[TIMESTAMP]"

acceptance/bundle/resources/postgres_branches/update_protected/output.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Deployment complete!
3333
"current_state": "READY",
3434
"default": false,
3535
"is_protected": false,
36-
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]",
36+
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production",
3737
"source_branch_lsn": "[LSN]",
3838
"source_branch_time": "[TIMESTAMP]",
3939
"state_change_time": "[TIMESTAMP]"
@@ -107,7 +107,7 @@ Deployment complete!
107107
"current_state": "READY",
108108
"default": false,
109109
"is_protected": true,
110-
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]",
110+
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production",
111111
"source_branch_lsn": "[LSN]",
112112
"source_branch_time": "[TIMESTAMP]",
113113
"state_change_time": "[TIMESTAMP]"
@@ -141,7 +141,7 @@ Deployment complete!
141141
"current_state": "READY",
142142
"default": false,
143143
"is_protected": false,
144-
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/[BRANCH_UID]",
144+
"source_branch": "projects/test-pg-proj-[UNIQUE_NAME]/branches/production",
145145
"source_branch_lsn": "[LSN]",
146146
"source_branch_time": "[TIMESTAMP]",
147147
"state_change_time": "[TIMESTAMP]"

libs/testserver/postgres.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,10 +618,11 @@ func (s *FakeWorkspace) createOperationLocked(resourceName string, response any)
618618
}
619619

620620
// createDefaultBranchLocked creates a default branch for a project (caller must hold lock).
621+
// The default branch is named "production" to match cloud API behavior.
621622
func (s *FakeWorkspace) createDefaultBranchLocked(projectName string) {
622623
now := nowTime()
623624
branchUID := "br-" + nextUUID()[:20]
624-
branchName := projectName + "/branches/" + branchUID
625+
branchName := projectName + "/branches/production"
625626

626627
defaultBranch := postgres.Branch{
627628
Name: branchName,

0 commit comments

Comments
 (0)