Skip to content

refactor: use Flaps DeleteApp for app deletion#4869

Merged
dangra merged 1 commit intomasterfrom
use-flaps-deleteapp
Apr 28, 2026
Merged

refactor: use Flaps DeleteApp for app deletion#4869
dangra merged 1 commit intomasterfrom
use-flaps-deleteapp

Conversation

@dangra
Copy link
Copy Markdown
Member

@dangra dangra commented Apr 28, 2026

Summary

  • switch app deletion paths from API client DeleteApp to Flaps DeleteApp
  • update builder cleanup paths to use Flaps for deleting builder apps
  • make the mock Flaps client DeleteApp nil-safe for tests

Testing

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

Copilot AI review requested due to automatic review settings April 28, 2026 16:48
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

Refactors application deletion to use the Flaps client’s DeleteApp instead of the API client, aligning destructive app operations with the Machines/Flaps pathway and updating related builder cleanup logic.

Changes:

  • Switch apps destroy to delete apps via flapsutil.ClientFromContext(ctx).DeleteApp.
  • Update remote builder cleanup paths to delete builder apps via Flaps.
  • Make the mock Flaps client’s DeleteApp handler nil-safe to avoid test panics when unset.

Reviewed changes

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

File Description
internal/mock/flaps_client.go Makes DeleteApp a no-op when DeleteAppFunc isn’t provided, improving test robustness.
internal/command/apps/destroy.go Uses Flaps DeleteApp for app destruction while retaining API client usage for lookups/add-on cleanup.
internal/build/imgsrc/ensure_builder.go Switches builder-app deletion/cleanup to Flaps DeleteApp, including error-path cleanup.

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

@dangra dangra merged commit cd20495 into master Apr 28, 2026
51 of 54 checks passed
@dangra dangra deleted the use-flaps-deleteapp branch April 28, 2026 18: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