Provider namespacing: generic --providers/--cash-only/--awards-only (work-4byx)#12
Merged
Merged
Conversation
…work-4byx) Replaces the per-provider PP flag block (--no-pp/--pp-only/--pp-airlines/ --pp-cabin) with a generic provider-namespaced surface that scales to N providers. Lands before work-2eoa (Seats.aero) so that issue ships as a registry addition + a config.toml section, not eight new flags. New surface on `flight search`: --providers pp[,seats] CSV of providers to use (default: all enabled) --cash-only Skip every award provider --awards-only Skip cash table; show award providers only --provider-opt KEY=VAL Repeatable; e.g. pp.airlines=United,Delta Per-provider tuning moves out of the CLI into ~/.config/flight-cli/config.toml ([providers.<name>] tables). CLI --provider-opt overrides config.toml values for a single invocation. Deprecated aliases retained for one release (hidden=True so --help is clean; runtime warning surfaces when set). Conflicts between old and new flags raise a clear error rather than silently picking one. Pyright-clean. 29 new tests across test_config.py, test_provider_selection.py, and test_registry.py covering loader, CLI parsing, alias forwarding, conflict detection, config<-CLI merge precedence, registry filter matching.
The skill listed --no-pp; replace with the new --cash-only / --awards-only / --providers / --provider-opt surface so agents construct invocations using the canonical flags. Deprecated aliases still work but the skill shouldn't teach them.
This was referenced May 17, 2026
- E501: split 3 long error-message lines under 100 chars - B008: extract --provider-opt typer.Option to module-level _PROVIDER_OPT (and make the default None, not [], handling None at the callsite) - RUF043: raw string for pytest.raises match=r"missing '\.'" - TC003: pathlib.Path moved into TYPE_CHECKING blocks (two test files) - PLR0912: noqa on _resolve_providers (single-purpose validator/merge) - reportUnknownVariableType: explicit Any annotations + cast around tomllib's dict parses; tightens the loader's pyright surface - reportUnusedFunction: pragma on _should_run_pp (still tested but no longer called from cli.py — slated for removal with the deprecated flag block); module-header for test fixtures whose use is via pytest parameter-name discovery - Replace `any(x for x in (...))` with plain `or` chain (pyright knows the types now) All in service of getting the work-4byx PR's CI green. No behavior change.
ak2k
added a commit
that referenced
this pull request
May 17, 2026
…ork-4uls)
Trims the per-command help output by hiding three implementation-detail
flags nobody touches in normal use, and front-doors output-format selection
behind a single --format flag.
Hidden flags (still work for one-off overrides; just not in --help):
--rps reads FLIGHT_RPS env / [http].rps config / default 1.0
--impersonate reads FLIGHT_IMPERSONATE / [http].impersonate / "chrome"
--no-cache reads FLIGHT_NO_CACHE / [cache].enabled inversion / off
Resolution order: explicit CLI flag wins, then env, then config.toml, then
hard-coded default. Bad env values raise a clear error rather than silent
fallback.
Output format:
--format {table,json} new front door; table is the default
--json deprecated alias for --format json; runtime
warning, conflicts with explicit --format X
for X != json
csv/tsv/yaml were in the original work-4uls plan but deferred to a follow-up:
the cash-itinerary shape isn't naturally tabular without a flattening pass
that deserves its own design. Filing a separate bd issue.
_config.py grew three new helpers (http_rps, http_impersonate, cache_disabled)
and three env-var constants. 28 new tests across test_runtime_knobs.py and
test_format_resolver.py. Pyright clean.
Stacked on top of work-4byx (#12).
ak2k
added a commit
that referenced
this pull request
May 17, 2026
…ork-4uls)
Trims the per-command help output by hiding three implementation-detail
flags nobody touches in normal use, and front-doors output-format selection
behind a single --format flag.
Hidden flags (still work for one-off overrides; just not in --help):
--rps reads FLIGHT_RPS env / [http].rps config / default 1.0
--impersonate reads FLIGHT_IMPERSONATE / [http].impersonate / "chrome"
--no-cache reads FLIGHT_NO_CACHE / [cache].enabled inversion / off
Resolution order: explicit CLI flag wins, then env, then config.toml, then
hard-coded default. Bad env values raise a clear error rather than silent
fallback.
Output format:
--format {table,json} new front door; table is the default
--json deprecated alias for --format json; runtime
warning, conflicts with explicit --format X
for X != json
csv/tsv/yaml were in the original work-4uls plan but deferred to a follow-up:
the cash-itinerary shape isn't naturally tabular without a flattening pass
that deserves its own design. Filing a separate bd issue.
_config.py grew three new helpers (http_rps, http_impersonate, cache_disabled)
and three env-var constants. 28 new tests across test_runtime_knobs.py and
test_format_resolver.py. Pyright clean.
Stacked on top of work-4byx (#12).
ak2k
added a commit
that referenced
this pull request
May 17, 2026
…ork-4uls) (#13) * Surface hygiene: hide --rps/--impersonate/--no-cache, add --format (work-4uls) Trims the per-command help output by hiding three implementation-detail flags nobody touches in normal use, and front-doors output-format selection behind a single --format flag. Hidden flags (still work for one-off overrides; just not in --help): --rps reads FLIGHT_RPS env / [http].rps config / default 1.0 --impersonate reads FLIGHT_IMPERSONATE / [http].impersonate / "chrome" --no-cache reads FLIGHT_NO_CACHE / [cache].enabled inversion / off Resolution order: explicit CLI flag wins, then env, then config.toml, then hard-coded default. Bad env values raise a clear error rather than silent fallback. Output format: --format {table,json} new front door; table is the default --json deprecated alias for --format json; runtime warning, conflicts with explicit --format X for X != json csv/tsv/yaml were in the original work-4uls plan but deferred to a follow-up: the cash-itinerary shape isn't naturally tabular without a flattening pass that deserves its own design. Filing a separate bd issue. _config.py grew three new helpers (http_rps, http_impersonate, cache_disabled) and three env-var constants. 28 new tests across test_runtime_knobs.py and test_format_resolver.py. Pyright clean. Stacked on top of work-4byx (#12). * ci: empty commit to retrigger checks after base retarget to main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the four PP-specific flags on
flight search(--no-pp,--pp-only,--pp-airlines,--pp-cabin) with a generic provider-namespaced surface that scales to N providers without flag growth. Lands beforework-2eoa(Seats.aero) so that follow-up issue ships as a registry addition + a config.toml section, not eight new flags requiring deprecation.Closes the namespacing half of bd
work-4byx.New surface
Per-provider tuning (airlines, cabins, etc.) moves out of the CLI into
~/.config/flight-cli/config.toml:Precedence: defaults < config.toml <
--provider-optCLI overrides.Deprecation strategy
The old flags remain functional with
hidden=True(no longer in--help) and emit a runtime warning when set. They forward into the new shape via_resolve_providers. Conflicts between old and new (e.g.--no-pp+--cash-only) raise a clear error rather than silently picking one. Scheduled to remove after one release.What didn't change
ppis the only meaningful entry in--providers/ config /--provider-optfor now. The data flow is provider-blind end-to-end;work-2eoabecomes a[providers.seats]table + aSeatsProviderregistration.flight fare/flight gflightcommands also route through_resolve_providersso legacy invocations still produce the expected behavior with the same warning.Test plan
tests/test_config.py,tests/test_provider_selection.py,tests/test_registry.py)0 errors, 0 warnings, 0 informations--cash-only,--providers pp,--provider-opt pp.cabins=Economy, deprecated--no-pp, conflict detectionflight searchshows the four new flags; legacy flags hiddenFollow-ups
work-2eoalands, the resolver'slegacy_pp_*parameters can be removed entirely (one-release deprecation window).work-4uls(surface hygiene) layers on top of this — same_config.pyloader picks up[http]and[cache]sections for--rps/--impersonate/--no-cachemigration.