Skip to content

refactor: use Flaps CreateApp for app creation#4865

Merged
dangra merged 2 commits intomasterfrom
use-flaps-createapp
Apr 28, 2026
Merged

refactor: use Flaps CreateApp for app creation#4865
dangra merged 2 commits intomasterfrom
use-flaps-createapp

Conversation

@dangra
Copy link
Copy Markdown
Member

@dangra dangra commented Apr 27, 2026

Summary

  • switch app creation paths from GraphQL CreateApp to Flaps CreateApp
  • keep fly apps create --json compatible by refetching the full app before rendering
  • simplify machine and postgres app-create helpers to return only the fields they actually use
  • preserve existing launch output by adapting the Flaps response into the minimal app shape needed by callers

Testing

  • go test ./...
  • golangci-lint run

Copilot AI review requested due to automatic review settings April 27, 2026 20:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Fly app creation flows to use the Flaps API instead of the GraphQL-based CreateApp path, while preserving compatibility by refetching full app data where needed for rendering/output.

Changes:

  • Switch app creation in machine run, launch, apps create, and postgres launcher paths from GraphQL to Flaps CreateApp.
  • Wait for the newly created app via WaitForApp using the same Flaps client used to create it.
  • Reduce the returned app/app-compact data to only the fields needed by the calling code, refetching full app details for JSON output where required.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
internal/command/machine/run.go Uses Flaps to create ephemeral shell apps and machine-run apps; waits for app readiness and refetches compact app details when needed.
internal/command/launch/launch.go Uses Flaps to create launch-plan apps and returns a minimal fly.App for follow-on printing/flow.
internal/command/apps/create.go Uses Flaps to create apps; refetches full app via API client before JSON rendering to keep output compatible.
flypg/launcher.go Uses Flaps to create postgres cluster apps and returns only required fly.AppCompact fields.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dangra dangra force-pushed the use-flaps-createapp branch 6 times, most recently from a8780ac to 7d61590 Compare April 28, 2026 15:43
@dangra dangra force-pushed the use-flaps-createapp branch from 7d61590 to d66179c Compare April 28, 2026 15:55
@dangra dangra merged commit b5b8630 into master Apr 28, 2026
24 checks passed
@dangra dangra deleted the use-flaps-createapp branch April 28, 2026 16:24
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