Skip to content

feat(mpg): support the Developer plan - #5484

Merged
miguel-fly merged 10 commits into
masterfrom
miguel/mpg-maintenance-window-any-time
Nov 20, 2026
Merged

miguel-fly merged 10 commits into
masterfrom
miguel/mpg-maintenance-window-any-time

Conversation

@miguel-fly

@miguel-fly miguel-fly commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Issue

  • superfly/mpg#829

Problem

  • Managed Postgres is adding clusters whose maintenance can run at any time. They have no maintenance window.
  • For them, the API will answer null to GET /v1/postgres/:id/maintenance_window, and 422 to a change.
  • fly mpg maintenance-window show prints null as a window: no day, 00:00, 0 hours. --json prints an empty window.
  • fly mpg create hides the dev-256 plan: the plan picker and the plan lists leave it out.
  • flyctl calls it "Dev 256 MB" at $5/mo. The API and the docs call it Developer, at $4/mo.
  • Scale shows 33 GB of memory. It has 32 GB.
  • fly launch onto an existing v2 cluster sets DATABASE_URL to just /<db>. It reads the cluster from the v1 API, which has no credentials for v2 clusters. Newer ui-ex answers that call with 409, and launch then fails instead.
  • Apps on Developer get the pgbouncer URL. On Developer both hostnames go straight to Postgres, and the plan hands out the direct URL.

Solution

  • show says maintenance can run at any time. --json prints null.
  • set is unchanged: it already shows the API's message.
  • The plan picker lists Developer at $4/mo, first, as the cheapest plan. Basic stays the default.
  • The --plan help of create and fork, and the unknown plan error, list it as Dev-256.
  • --plan takes Developer as well as dev-256.
  • Scale shows 32 GB.
  • fly launch onto an existing cluster sets the URL fly mpg attach sets, on the plan's database.
  • fly mpg create and fly launch with a new cluster give a Developer cluster's apps the direct URL. Other plans keep the pooled one.
  • fly mpg attach and fly launch onto an existing cluster use the API's new database_url when it's there, and the pooled URL when it isn't.

Details

  • Moves fly-go to v0.12.5, the release with flaps: return a nil maintenance window when the API sends none fly-go#338: its maintenance window methods return nil when the API sends null. Before, null came back as an empty window.
  • The rest of the maintenance window change is that new return type in the flaps client interface and its mocks.
  • A cluster with a window shows it as before, in a table or as JSON.
  • fly mpg status and fly mpg list don't show the window and don't change.
  • --plan takes a plan's key or its name, in any case: dev-256 and Developer both work. The plan lists show Dev-256.
  • create and fork send a --plan they know as the plan's key: --plan Dev-256 and --plan Developer send dev-256. fork sends any other --plan to the API as before.
  • Without a terminal, create still picks Basic when --plan is left out.
  • The plan list loses its Hidden field: only dev-256 used it.
  • create's --plan help now builds its list from the plan list, as fork's does.
  • The API still decides who can have dev-256: it turns it down for orgs without the mpg-dev-256 flag.
  • Tests: TestRunMaintenanceWindowShowAnyTime and TestRunMaintenanceWindowShowAnyTimeJSON are new. The 422 case of TestMaintenanceWindowErrors already covers set.
  • Tests: TestRunCreatePlanFlag takes the dev-256 and DEV-256 cases of TestRunCreateHiddenPlan, which is gone, and adds Developer and developer. Its unknown plan case now expects Dev-256 in the list.
  • Tests: TestRunFork checks that Dev-256, Developer and PERFORMANCE go out as dev-256, dev-256 and Performance, and that an unknown plan goes out as typed.
  • No test for the picker's default: the prompt has no test seam.
  • fly launch finds the cluster as fly mpg attach does: Machines API first, the v1 API only for v1 clusters. A v1 cluster costs one more call. A v2 cluster with no credentials yet stops with attach's error instead of getting a broken secret.
  • create and launch pick the endpoint by the plan the API returns for the cluster: direct for dev-256, pooler for the rest.
  • ui-ex adds database_url to the cluster's credentials in a separate PR: the direct URL on clusters without PgBouncers, the pooled one otherwise. pgbouncer_uri doesn't change, so older flyctl keeps working.
  • create's error for a ready cluster with no endpoint now says "endpoint", not "pooler endpoint".
  • Tests: TestAttachExistingManagedPostgres covers a v2 cluster with and without database_url, one without credentials yet, and a v1 cluster.
  • Tests: TestRunCreate_Credentials and TestConnectionURI check the direct URL on Developer and the pooled one on Basic. TestRunAttach_databaseURL checks database_url and the fallback.

Examples

  • Expected outputs, not captured: the API doesn't send null yet.
  • Examples 1 and 2: Before is master given the empty window fly-go returns today. After is the new tests'.
  • Examples 3 and 4: master's output for the 422 and for a full window.
  • Example 5: captured from builds of master and of this branch.
  • Example 6: expected output, not captured: the picker needs a terminal.
  • Example 7: captured from builds of master and of this branch.
  • Example 8: captured from builds of 794f285 and of d6cce81, against a local fake of the APIs.
  • Examples 9 and 10: captured from builds of d6cce81 and of this branch, against a local fake of the APIs.

Example 1: show a cluster with no window

fly mpg maintenance-window show abc123
Before
Maintenance Window
 Day        │
 Start Time │ 00:00
 Duration   │ 0 hours
 Timezone   │
After
Maintenance can run at any time on cluster abc123.

Example 2: the same, with --json

fly mpg maintenance-window show abc123 --json
Before
{
    "day": "",
    "start_hour": 0,
    "duration_hours": 0,
    "timezone": ""
}
After
null

Example 3: change the window of a cluster with no window

fly mpg maintenance-window set abc123 --day monday
Before
Error: could not update maintenance window for cluster abc123: Maintenance can run at any time (Request ID: <id>)
  • flyctl also adds (Trace ID: <id>) when the request has a valid trace ID.
After
  • The same: flyctl prints the API's message.

Example 4: show a cluster with a window

fly mpg maintenance-window show abc123
Before
Maintenance Window
 Day        │ Sunday
 Start Time │ 01:00
 Duration   │ 3 hours
 Timezone   │ America/New_York
After
  • The same.

Example 5: --plan help

fly mpg create --help
Before
      --plan string              The plan to use for the Postgres
                                 cluster: Basic, Starter, Launch, Scale,
                                 Performance
After
      --plan string              The plan to use for the Postgres
                                 cluster: Dev-256, Basic, Starter,
                                 Launch, Scale, Performance
  • fly mpg fork --help gains Dev-256 the same way.

Example 6: pick a plan

fly mpg create
Before
? Select a plan for your Managed Postgres cluster  [Use arrows to move, type to filter]
> Basic: Shared x 2, 1 GB RAM, $38/mo
  Starter: Shared x 2, 2 GB RAM, $72/mo
  Launch: Performance x 2, 8 GB RAM, $282/mo
  Scale: Performance x 4, 33 GB RAM, $962/mo
  Performance: Performance x 8, 64 GB RAM, $1922/mo
After
? Select a plan for your Managed Postgres cluster  [Use arrows to move, type to filter]
  Developer: Shared x 1, 256 MB RAM, $4/mo
> Basic: Shared x 2, 1 GB RAM, $38/mo
  Starter: Shared x 2, 2 GB RAM, $72/mo
  Launch: Performance x 2, 8 GB RAM, $282/mo
  Scale: Performance x 4, 32 GB RAM, $962/mo
  Performance: Performance x 8, 64 GB RAM, $1922/mo

Example 7: an unknown plan without a terminal

fly mpg create --name plan-check-db --org personal --plan hobby < /dev/null
Before
Error: unknown plan "hobby"; valid plans are Basic, Starter, Launch, Scale, Performance
After
Error: unknown plan "hobby"; valid plans are Dev-256, Basic, Starter, Launch, Scale, Performance

Example 8: launch onto an existing cluster

fly launch --from-manifest manifest.json --no-deploy
  • The manifest picks existing cluster abc123 and database plan-check-db.
Before
Attaching to existing Managed Postgres cluster abc123...
Managed Postgres cluster abc123 is now attached to plan-check-app-zz91
The following secret was added to plan-check-app-zz91:
  DATABASE_URL=/plan-check-db
After
Attaching to existing Managed Postgres cluster abc123...
Managed Postgres cluster abc123 is now attached to plan-check-app-zz91
The following secret was added to plan-check-app-zz91:
  DATABASE_URL=postgresql://fly-user:secret@pgbouncer.abc123.flympg.net/plan-check-db

Example 9: create a Developer cluster

fly mpg create --name plan-check-db --org personal --region iad --plan Developer
Before
  Plan: dev-256
  Connection string: postgres://fly-user:secret@pgbouncer.abc123.flympg.net:5432/fly-db
After
  Plan: dev-256
  Connection string: postgres://fly-user:secret@direct.abc123.flympg.net:5432/fly-db
  • --plan basic prints the pgbouncer URL before and after.

Example 10: launch onto an existing cluster whose credentials have database_url

fly launch --from-manifest manifest.json --no-deploy
Before
  DATABASE_URL=postgresql://fly-user:secret@pgbouncer.abc123.flympg.net/plan-check-db
After
  DATABASE_URL=postgresql://fly-user:secret@direct.abc123.flympg.net/plan-check-db
  • Without database_url (ui-ex before its change), After is the pgbouncer URL, as Before.

Notes

  • The show help says what it prints for a cluster with no window. The CLI docs pick it up when they sync after the release.
  • The CLI docs pick up the new --plan help the same way.

Rollout

  • Safe before the API change: the API sends a window for every cluster today, and this shows it as before.
  • Ship before the ui-ex deploy of superfly/ui-ex#6910, ideally. Not a blocker.
  • Releases with fly mpg maintenance-window before this one (v0.5.11 and v0.5.12) show the empty window of Example 1 until they update, whatever the order.
  • Every org sees Developer in the picker. Until dev-256 launches, an org without the mpg-dev-256 flag that picks it gets plan is not available after the region prompt, and no cluster is made.
  • So the release with this change should go out with the dev-256 launch or after it.
  • Safe before the ui-ex change: without database_url, attach and launch keep the pooled URL.

[Opus 5.5 on Miguel's behalf]

@miguel-fly
miguel-fly marked this pull request as ready for review November 18, 2026 03:04
@miguel-fly
miguel-fly requested a review from a team as a code owner November 18, 2026 03:04

@tripledoublev tripledoublev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jfyi on ordering: fly-go release first, then the updated pin gets added here.

@miguel-fly miguel-fly changed the title feat(mpg): show "any time" for clusters with no maintenance window feat(mpg): show "any time" for clusters with no maintenance window, list dev-256 as Developer at $4/mo Nov 20, 2026
@miguel-fly miguel-fly changed the title feat(mpg): show "any time" for clusters with no maintenance window, list dev-256 as Developer at $4/mo feat(mpg): support the Developer plan Nov 20, 2026
@miguel-fly
miguel-fly merged commit 6ec6e2c into master Nov 20, 2026
24 checks passed
@miguel-fly
miguel-fly deleted the miguel/mpg-maintenance-window-any-time branch November 20, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants