Skip to content

Trim whitespace from flyctl resource selectors - #5709

Open
benbjohnson wants to merge 2 commits into
masterfrom
benbjohnson/trim-app-names
Open

benbjohnson wants to merge 2 commits into
masterfrom
benbjohnson/trim-app-names

Conversation

@benbjohnson

@benbjohnson benbjohnson commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Change Summary

What and why

Leading or trailing whitespace, including a carriage return, can make an exact lookup miss a valid app, organization, region, or resource ID.

How

  • Trim app names from --app, FLY_APP, and app config. Trim organization slugs from --org and FLY_ORG. Keep source precedence.
  • Trim region codes in flags and config, including individual entries in lists and list aliases.
  • Trim Machine, volume, and Managed Postgres cluster IDs in flags and positional selectors. Preserve mount paths and arguments passed through to psql.
  • Reject whitespace-only selector values before any fallback or prompt.

Related to

Trailing carriage returns in copied names and resource IDs.

Verification

  • make test
  • git diff --check

Documentation

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

A copied app name can carry leading whitespace or a trailing carriage return into an exact API lookup. Trim edge whitespace and reject whitespace-only targets without changing the app source precedence.
@benbjohnson
benbjohnson requested a review from a team as a code owner December 3, 2026 15:12
@foundations-pr-bot foundations-pr-bot Bot added the risk:low Production risk (low), set by foundations-pr-bot or a person label Dec 3, 2026
Normalize organization slugs, region codes and resource IDs at their input boundaries. Reject blank selectors before they reach default selection, and preserve the text of mount paths and psql arguments.
@benbjohnson benbjohnson changed the title Trim whitespace from flyctl app names Trim whitespace from flyctl resource selectors Dec 3, 2026
@foundations-pr-bot foundations-pr-bot Bot added risk:medium Production risk (medium), set by foundations-pr-bot or a person and removed risk:low Production risk (low), set by foundations-pr-bot or a person labels Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:medium Production risk (medium), set by foundations-pr-bot or a person

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant