Skip to content

Commit 51486c4

Browse files
Promote Postgres commands out of early access (#506)
Moves `pg` commands out of the `ea` subcommand to the top level. Make em GA! - Before: `render ea pg list` - After: `render pg list` GROW-2582 GitOrigin-RevId: d08916f73c7fc5166ea5967ce985d292167e0116
1 parent 62816c9 commit 51486c4

18 files changed

Lines changed: 62 additions & 68 deletions

cmd/pg.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@ func newPgCmd(children ...*cobra.Command) *cobra.Command {
77
Use: "postgres",
88
Aliases: []string{"pg"},
99
Short: "Manage Render Postgres databases (alias: pg)",
10-
Long: `Manage Render Postgres databases.
11-
12-
Lives under 'ea' while the command surface stabilizes. Postgres itself is
13-
generally available, but the flag set and output format for these commands may
14-
still change. We'll promote them out of 'ea' once we're confident in the
15-
contract.`,
10+
Long: `Manage Render Postgres databases.`,
11+
GroupID: GroupCore.ID,
1612
}
1713
cmd.AddCommand(children...)
1814
return cmd

cmd/pg_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ func executePGCommand(t *testing.T, server *renderapi.Server, args ...string) (C
3434
}
3535

3636
root := newRootCmd()
37-
ea := newEarlyAccessCmd()
38-
root.AddCommand(ea)
39-
setupPGCommands(ea, deps)
37+
setupPGCommands(root, deps)
4038
setupRootCmdPersistentRun(root, deps)
4139

4240
var stdout, stderr bytes.Buffer

cmd/pgcreate.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ Use --confirm to skip the wizard and create immediately from flags and defaults.
3232
When --confirm is used with the default interactive output mode, output is
3333
printed as text. Use --output json, yaml, or text for non-interactive output.`,
3434
Example: ` # Launch the interactive wizard
35-
render ea pg create
35+
render pg create
3636
3737
# Create immediately with defaults and text output
38-
render ea pg create --confirm
38+
render pg create --confirm
3939
4040
# Create immediately with explicit values
41-
render ea pg create --confirm --name analytics --plan pro_8gb --version 17 --region ohio
41+
render pg create --confirm --name analytics --plan pro_8gb --version 17 --region ohio
4242
4343
# Include flag-only settings while using the wizard for prompted values
44-
render ea pg create \
44+
render pg create \
4545
--ip-allow-list "cidr=203.0.113.5/32,description=office" \
4646
--ip-allow-list "cidr=10.0.0.0/8,description=internal"
4747
4848
# Machine-readable output
49-
render ea pg create --output json`,
49+
render pg create --output json`,
5050
}
5151

5252
cmd.Flags().String("name", "", "Set the database name (generated if not provided)")

cmd/pgcreate_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func executePGCreate(t *testing.T, server *renderapi.Server, extraArgs ...string
1717
server.Owners.Add(renderapi.NewOwner(client.Owner{Id: pgActiveWorkspaceID, Name: "Test Workspace"}))
1818
t.Setenv("RENDER_WORKSPACE", pgActiveWorkspaceID)
1919

20-
return executePGCommand(t, server, append([]string{"ea", "postgres", "create"}, extraArgs...)...)
20+
return executePGCommand(t, server, append([]string{"pg", "create"}, extraArgs...)...)
2121
}
2222

2323
func TestPGCreate_ZeroFlags_AppliesDefaults(t *testing.T) {
@@ -126,13 +126,13 @@ func TestPGCreate_InteractiveConfirm_PrintsTextSuccess(t *testing.T) {
126126
assert.Contains(t, result.Stdout, pg.Id)
127127
}
128128

129-
func TestPGCreate_PGAlias(t *testing.T) {
129+
func TestPGCreate_PostgresCommandName(t *testing.T) {
130130
server := renderapi.NewServer(t)
131131
server.Owners.Add(renderapi.NewOwner(client.Owner{Id: pgActiveWorkspaceID, Name: "Test Workspace"}))
132132
t.Setenv("RENDER_WORKSPACE", pgActiveWorkspaceID)
133133

134134
_, err := executePGCommand(t, server,
135-
"ea", "pg", "create",
135+
"postgres", "create",
136136
"--name", "alias-pg",
137137
"--output", "text",
138138
)
@@ -156,7 +156,7 @@ func TestPGCreate_ParameterOverrideFlagIsUnknown(t *testing.T) {
156156

157157
func TestPGCreate_NoWorkspaceConfigured(t *testing.T) {
158158
server := renderapi.NewServer(t)
159-
result, err := executePGCommand(t, server, "ea", "postgres", "create", "--output", "text")
159+
result, err := executePGCommand(t, server, "pg", "create", "--output", "text")
160160
require.Error(t, err)
161161
assert.Contains(t, result.Stderr, "no workspace")
162162
assert.Empty(t, server.Postgres.Instances)

cmd/pgdelete.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,22 @@ Name lookup is scoped to your active workspace. If a name isn't found, switch
4141
workspaces with 'render workspace set <name|ID>' and try again, or pass the
4242
Postgres ID instead (which works across workspaces).`,
4343
Example: ` # Preview deletion (no changes made)
44-
render ea pg delete dpg-abc123def456ghi789jkl0
44+
render pg delete dpg-abc123def456ghi789jkl0
4545
4646
# Delete by ID
47-
render ea pg delete dpg-abc123def456ghi789jkl0 --confirm
47+
render pg delete dpg-abc123def456ghi789jkl0 --confirm
4848
4949
# Delete by name
50-
render ea pg delete my-db --confirm
50+
render pg delete my-db --confirm
5151
5252
# Disambiguate a name that exists in multiple environments
53-
render ea pg delete my-db --environment production --confirm
53+
render pg delete my-db --environment production --confirm
5454
5555
# Disambiguate a name that exists in multiple projects
56-
render ea pg delete my-db --project analytics --confirm
56+
render pg delete my-db --project analytics --confirm
5757
5858
# JSON output
59-
render ea pg delete dpg-abc123def456ghi789jkl0 --confirm --output json`,
59+
render pg delete dpg-abc123def456ghi789jkl0 --confirm --output json`,
6060
}
6161

6262
cmd.Flags().String("project", "",

cmd/pgdelete_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func executePGDelete(t *testing.T, server *renderapi.Server, extraArgs ...string
1616
server.Owners.Add(renderapi.NewOwner(client.Owner{Id: pgActiveWorkspaceID, Name: "Test Workspace"}))
1717
t.Setenv("RENDER_WORKSPACE", pgActiveWorkspaceID)
1818

19-
return executePGCommand(t, server, append([]string{"ea", "pg", "delete"}, extraArgs...)...)
19+
return executePGCommand(t, server, append([]string{"pg", "delete"}, extraArgs...)...)
2020
}
2121

2222
func TestPGDelete_PreviewByID_DoesNotDelete(t *testing.T) {

cmd/pgget.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ Name lookup is scoped to your active workspace. If a name isn't found, switch
2727
workspaces with 'render workspace set <name|ID>' and try again, or pass the
2828
Postgres ID instead (which works across workspaces).`,
2929
Example: ` # Get by ID
30-
render ea pg get dpg-abc123def456ghi789jkl0
30+
render pg get dpg-abc123def456ghi789jkl0
3131
3232
# Get by name
33-
render ea pg get my-db
33+
render pg get my-db
3434
3535
# Include connection strings (contains credentials)
36-
render ea pg get my-db --include-sensitive-connection-info
36+
render pg get my-db --include-sensitive-connection-info
3737
3838
# Disambiguate by project
39-
render ea pg get my-db --project my-project
39+
render pg get my-db --project my-project
4040
4141
# Disambiguate a name that exists in multiple environments
42-
render ea pg get my-db --environment production
42+
render pg get my-db --environment production
4343
4444
# JSON output
45-
render ea pg get dpg-abc123def456ghi789jkl0 --output json`,
45+
render pg get dpg-abc123def456ghi789jkl0 --output json`,
4646
}
4747

4848
cmd.Flags().String("project", "",

cmd/pgget_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ func newPGGetHarness(t *testing.T) pgGetHarness {
2828
return pgGetHarness{t: t, server: server}
2929
}
3030

31-
// execute invokes the `render ea pg get` command, passing through all extraArgs
31+
// execute invokes the `render pg get` command, passing through all extraArgs
3232
func (h pgGetHarness) execute(extraArgs ...string) (CommandResult, error) {
3333
h.t.Helper()
3434

35-
return executePGCommand(h.t, h.server, append([]string{"ea", "pg", "get"}, extraArgs...)...)
35+
return executePGCommand(h.t, h.server, append([]string{"pg", "get"}, extraArgs...)...)
3636
}
3737

3838
func TestPGGet_ByID(t *testing.T) {

cmd/pglist.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ Use --project to narrow results to a single project, --environment to narrow
2323
to a single environment, or both — when both are supplied, the environment is
2424
resolved within that project.`,
2525
Example: ` # List all Postgres databases in the active workspace
26-
render ea pg list
26+
render pg list
2727
2828
# List all Postgres databases in a project
29-
render ea pg list --project my-project
29+
render pg list --project my-project
3030
3131
# Filter by environment name
32-
render ea pg list --environment production
32+
render pg list --environment production
3333
3434
# Disambiguate an environment name by project
35-
render ea pg list --project my-project --environment production
35+
render pg list --project my-project --environment production
3636
3737
# JSON output
38-
render ea pg list --output json`,
38+
render pg list --output json`,
3939
}
4040

4141
cmd.Flags().String("project", "",

cmd/pglist_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ func newPGListHarness(t *testing.T) pgListHarness {
2727
return pgListHarness{t: t, server: server}
2828
}
2929

30-
// execute invokes the `render ea pg list` command, passing through all extraArgs
30+
// execute invokes the `render pg list` command, passing through all extraArgs
3131
func (h pgListHarness) execute(extraArgs ...string) (CommandResult, error) {
3232
h.t.Helper()
3333

34-
return executePGCommand(h.t, h.server, append([]string{"ea", "pg", "list"}, extraArgs...)...)
34+
return executePGCommand(h.t, h.server, append([]string{"pg", "list"}, extraArgs...)...)
3535
}
3636

3737
func TestPGList_NoDatabases(t *testing.T) {

0 commit comments

Comments
 (0)