Skip to content

feat(flags): add Flags.ProcessBase short-flag-free subset of Flags.Process (CHAOS-1324)#12

Open
chrisgeo wants to merge 1 commit into
mainfrom
feat/chaos-1324-process-base
Open

feat(flags): add Flags.ProcessBase short-flag-free subset of Flags.Process (CHAOS-1324)#12
chrisgeo wants to merge 1 commit into
mainfrom
feat/chaos-1324-process-base

Conversation

@chrisgeo

@chrisgeo chrisgeo commented May 2, 2026

Copy link
Copy Markdown

Staging branch — fork-internal review before any apple/container upstream filing.

Linear: CHAOS-1324

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Tools like compose run and compose exec need to expose their own -e KEY=VALUE / -u USER / -w DIR UX (the docker-compose convention) but can't @OptionGroup Flags.Process because swift-argument-parser hits a parse-time clash on those short flags (Flags.Process registers -e, -u, -w, -i, -t).

The current downstream workaround is verbose --run-env / --run-user / --run-workdir aliases that nobody types willingly. Adding Flags.ProcessBase upstream lets wrapping tools inherit the safe long-form options (--cwd, --env-file) while reclaiming the short flags for their own subcommand-specific UX.

What this PR changes

  • Sources/Services/ContainerAPIService/Client/Flags.swift: a new public struct Flags.ProcessBase with two fields (cwd: String?, envFile: [String]), declared with the same long-form @Option attributes as the matching fields on Flags.Process. No short flags. Existing Flags.Process is unchanged.

Total: 1 file, +37/−0.

Wire compatibility

Pure additive. Flags.Process is byte-for-byte unchanged. Existing callers see no diff; new callers can opt into ProcessBase explicitly.

Testing

  • Tested locally (full swift build clean on macOS 26 / Apple silicon, all targets).
  • Added/updated tests — none yet; the surface is a single struct with no behavior beyond swift-argument-parser registration. Happy to add a parse-positive / parse-negative test if desired.
  • Added/updated docs — public API doc comment added on the new struct explaining when to choose it over Flags.Process.

Status

Draft, fork-staged. Routing to full-chaos/container:main first so we can review the surface internally before opening the apple/container companion issue + upstream PR (same pattern as CHAOS-1319 / CHAOS-1320).

@linear

linear Bot commented May 2, 2026

Copy link
Copy Markdown

@chrisgeo chrisgeo force-pushed the feat/chaos-1324-process-base branch from 28d98b7 to 91e9908 Compare May 23, 2026 19:09
…ocess

Adds a new public 'Flags.ProcessBase' struct alongside the existing
'Flags.Process'. ProcessBase is a minimal subset that does NOT claim
the common short flags (-e, -u, -w, -i, -t), so downstream tools that
wrap 'container' can @OptionGroup ProcessBase without colliding on
those names.

Motivation
----------

Tools like 'compose run' and 'compose exec' need to expose their own
'-e KEY=VALUE' / '-u USER' / '-w DIR' UX (the docker-compose
convention) but currently can't @OptionGroup Flags.Process because
swift-argument-parser hits a parse-time clash on the short flags.
The compose tooling's workaround is to declare verbose '--run-env',
'--run-user', '--run-workdir' aliases that nobody types willingly.

Adding ProcessBase upstream lets those wrappers inherit the safe
long-form options (--cwd, --env-file) while reclaiming the short
flags for their own subcommand-specific UX.

What this PR changes
--------------------

- Sources/Services/ContainerAPIService/Client/Flags.swift: a new public
  struct 'Flags.ProcessBase' with two fields ('cwd: String?',
  'envFile: [String]'), declared with the same long-form @option
  attributes as the matching fields on 'Flags.Process'. No short
  flags. Existing 'Flags.Process' is unchanged.

Total: 1 file, +37/-0.

Wire compatibility
------------------

Pure additive — 'Flags.Process' is unchanged. Existing callers see no
diff; new callers can opt into ProcessBase explicitly.

Verification
------------

Full 'swift build' clean on macOS 26 / Apple silicon (release config,
all targets).
@chrisgeo chrisgeo force-pushed the feat/chaos-1324-process-base branch from 91e9908 to 28cd619 Compare May 23, 2026 19:09
@chrisgeo chrisgeo marked this pull request as ready for review May 23, 2026 19:09
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.

1 participant