Skip to content

Fail headless fly launch when there is nothing to build - #5297

Merged
igor-ladkin merged 8 commits into
masterfrom
igor-ladkin/launch-no-blank-app-headless
Oct 23, 2026
Merged

igor-ladkin merged 8 commits into
masterfrom
igor-ladkin/launch-no-blank-app-headless

Conversation

@igor-ladkin

@igor-ladkin igor-ladkin commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Change Summary

What and Why:

Without a terminal, in a directory where fly launch finds neither a Dockerfile nor a framework, it printed "Continuing with a blank app.", created the app, wrote fly.toml, skipped the deploy and exited 0, with no hint that nothing was deployed. A coding agent takes that exit 0 as a successful launch.

Along the way: fly launch --no-create-app created the app anyway. Launch only read the hidden --no-create alias, and ApplyAliases copies an alias into the canonical flag but not the reverse, so the canonical spelling was ignored: the app was created, provisioned and deployed.

How:

In that case fly launch now fails before creating anything: "found nothing to build; add a Dockerfile, or pass --no-deploy to create an empty app". With --now, which overrides --no-deploy, it says to drop --now as well.

It still continues when nothing would be mistaken for a launch: with a terminal, with --no-deploy (unless --now), with --manifest (only prints the plan) and with --no-create-app (only writes fly.toml). fly launch plan propose keeps its existing error.

Launch now reads --no-create-app through one helper that also accepts --no-create, everywhere it decides whether to create, provision or deploy. plan propose keeps its own --no-create flag.

TestDetermineSourceInfoNothingToBuild covers these cases, and TestNoCreateApp covers both spellings.

Related to: superfly/ui-ex#5643


Documentation

  • Fresh Produce
  • In superfly/docs, or asked for help from docs team
  • n/a

In a directory with no Dockerfile and no runtime or framework a scanner
recognizes, fly launch printed "Continuing with a blank app", created the
app, wrote fly.toml, skipped the deploy (a blank app has nothing to
deploy) and exited 0 without saying nothing was deployed. A coding agent
or CI job running it without a terminal reads that exit 0 as a successful
launch.

Without a terminal and without --no-deploy, it now fails during source
detection, before the app is created: "found nothing to build; add a
Dockerfile, or pass --no-deploy to create an empty app". This reuses the
check plan propose already makes for blank apps.

--no-deploy still creates the empty app, runs with a terminal are
unchanged, plan propose keeps its own error, and plan generate is
unaffected because it defaults to --no-deploy.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T13:43:50.226423Z 15d8be7 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

--manifest encodes the plan and returns before anything is created or
deployed, so the headless nothing-to-build failure only broke
`fly launch --manifest > plan.json` for an empty directory.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

…o build

--no-create-app creates no app, provisions nothing and doesn't deploy, so
like --manifest it can't be mistaken for a launch. Check the canonical
flag name: ApplyAliases copies --no-create into it, but not the reverse.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

firstDeploy lets --now override --no-deploy, so that pair asks for a
deploy and would again create an empty app and exit 0.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Launch read only the --no-create alias, and ApplyAliases copies an alias
into the canonical flag but not the reverse, so --no-create-app created,
provisioned and deployed anyway. Read both names everywhere; plan
propose keeps its own --no-create flag.

Also tell headless fly launch --now with nothing to build to drop --now:
it overrides --no-deploy, so suggesting --no-deploy alone fails again.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

A CI job with a pseudo-TTY still made a blank app and exited 0; launch
already treats CI as non-interactive elsewhere (canEnterUi, billing).

noCreateApp now follows ApplyAliases: an explicit --no-create-app wins,
so --no-create --no-create-app=false creates the app.
@igor-ladkin

Copy link
Copy Markdown
Contributor Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

setupGitHubActions fetched the uncreated app to mint a token, failing
the config-only launch. The workflow files are still written.
@igor-ladkin

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 16064bc39c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@igor-ladkin
igor-ladkin requested a review from a team October 13, 2026 11:51

@tomr-fly tomr-fly 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.

LGTM! The only thing I thought of is whether the flag works for apps like Phoenix too. Do we need to cover those in this as well?

Phoenix (and other scanners) generate secrets such as SECRET_KEY_BASE
and set them on the app before fly.toml is written. With no app, that
failed the config-only launch. List the secrets to set later instead;
generated values aren't printed, any fresh value works.
@igor-ladkin

Copy link
Copy Markdown
Contributor Author

@tomr-fly good question. We maybe interested in it but I haven't checked how CLI behaves when we get a scanner hit. Do framework scanner check if app is deployable somehow? I don't know this part. Can be a follow up if we find any significant issues later.

chatgpt-codex-connector[bot]

This comment was marked as low quality.

@igor-ladkin
igor-ladkin force-pushed the igor-ladkin/launch-no-blank-app-headless branch from 8bb99ec to 15d8be7 Compare October 22, 2026 14:30
@igor-ladkin
igor-ladkin merged commit 6667848 into master Oct 23, 2026
46 checks passed
@igor-ladkin
igor-ladkin deleted the igor-ladkin/launch-no-blank-app-headless branch October 23, 2026 08:03
igor-ladkin added a commit that referenced this pull request Oct 23, 2026
Resolve launch.go with the deferred provisioning error reading
--no-create-app through noCreateApp (from #5297), and keep the tests
from both sides.
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