Skip to content

[AIP-94] Add airflowctl providers get - #68854

Merged
henry3260 merged 11 commits into
apache:mainfrom
henry3260:add-airflowctl-providers-get
Oct 28, 2026
Merged

henry3260 merged 11 commits into
apache:mainfrom
henry3260:add-airflowctl-providers-get

Conversation

@henry3260

@henry3260 henry3260 commented Jun 22, 2026 •

Copy link
Copy Markdown
Member

Why

Part of AIP-94. The public REST API only exposed a provider list endpoint, so there was no way for airflowctl (or any API client) to look up a single installed provider by package name, and no way to see the full provider metadata (provider_info from provider.yaml) — the list endpoint returns only the name, version, description, and documentation URL.

What

Public API (airflow-core)

  • Add GET /api/v2/providers/{provider_name} returning a new ProviderDetailsResponse — the summary fields plus the full provider_info mapping — with 404 for unknown providers and the same PROVIDERS access-view guard as the list endpoint.
  • Add map_provider_details in api_fastapi/core_api/services/public/providers.py; regenerate the OpenAPI spec, UI openapi-gen client, and the API permissions reference doc.
  • Tests: TestGetProvider covering 200/404/401/403 in test_providers.py.

CLI (airflow-ctl)

  • Add airflowctl providers get <provider_name> (new provider_command.py), printing a summary by default and the complete provider metadata with --full.
  • Add ProvidersOperations.get in api/operations.py and the regenerated ProviderDetailsResponse datamodel.
  • Behavior change in merge_commands (ctl/cli_config.py): custom subcommands now replace auto-generated subcommands with the same name instead of being appended alongside them. This is needed because the OpenAPI-generated CLI already derives a providers get from the new endpoint; without deduplication the group would contain two get subcommands. Previously duplicate names were a latent bug — nothing relied on the old append behavior.

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5)

@boring-cyborg boring-cyborg Bot added area:airflow-ctl area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. backport-to-airflow-ctl/v0-1-test kind:documentation labels Jun 22, 2026
@henry3260
henry3260 force-pushed the add-airflowctl-providers-get branch from b363485 to bb92d08 Compare June 23, 2026 05:36
@henry3260
henry3260 force-pushed the add-airflowctl-providers-get branch from bb92d08 to bd6c668 Compare July 21, 2026 06:25
@henry3260
henry3260 force-pushed the add-airflowctl-providers-get branch from bd6c668 to 883bf75 Compare August 12, 2026 12:53
@henry3260
henry3260 marked this pull request as ready for review August 12, 2026 13:59
@henry3260 henry3260 added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Aug 16, 2026

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

Can you provide more context as to why such an endpoint is needed atm? (And if returning everything is needed)

@henry3260
henry3260 force-pushed the add-airflowctl-providers-get branch from 883bf75 to 73ec697 Compare September 1, 2026 17:16
@henry3260

Copy link
Copy Markdown
Member Author

Can you provide more context as to why such an endpoint is needed atm? (And if returning everything is needed)

The core CLI command airflow providers get is already decorated with @deprecated_for_airflowctl("airflowctl providers get"), so the deprecation warning points users to an airflowctl command that doesn't exist yet, this PR adds it (part of the AIP-94 CLI migration). The full metadata is returned for parity with the deprecated command's --full flag, which prints the complete provider metadata (connection types, extra links, hooks, etc.).

@henry3260
henry3260 force-pushed the add-airflowctl-providers-get branch from 73ec697 to 9628516 Compare September 18, 2026 16:20
@henry3260
henry3260 requested a review from vincbeck as a code owner September 18, 2026 16:20
@henry3260
henry3260 force-pushed the add-airflowctl-providers-get branch 2 times, most recently from 4a8d140 to d8c7254 Compare September 30, 2026 19:53
@yuseok89 yuseok89 mentioned this pull request Oct 7, 2026
24 of 41 tasks
@henry3260
henry3260 force-pushed the add-airflowctl-providers-get branch from d8c7254 to 647a42b Compare October 7, 2026 15:44

@yuseok89 yuseok89 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.

I noticed some provider metadata is missing from --full and left the details inline. The static checks also need to pass before merging.

henry3260 and others added 6 commits October 16, 2026 17:03
airflowctl needs a stable server-side source for detailed installed-provider metadata without loading provider entry points on the client.
Provider metadata lives on the API server, and users need summary and full output compatible with the core CLI while the AIP-94 migration progresses.
The core command this replaces, airflow providers get, declares its
flag as ("-f", "--full") and is already marked
@deprecated_for_airflowctl("airflowctl providers get"). Users moving
across should not have to unlearn the short form.
The OpenAPI schema marks documentation_url as required on
ProviderDetailsResponse, so the client model must not give it a
default. With the default in place the datamodel codegen hook rewrites
the file on every run, which fails the pre-push and CI checks.
Serializing the raw provider.yaml dict meant every key added to provider
metadata in the future would be exposed through the public API by
default, and the OpenAPI spec described provider_info as an untyped
object. Modelling the response after provider_info.schema.json (the
schema every provider is validated against at discovery time) turns
serialization into an explicit allowlist and gives the generated UI and
airflowctl clients real types. Also drops a no-op catch-reraise in the
airflowctl providers operation, per review feedback on the PR.
The typed provider_info model drops every key it does not declare, so a
provider whose metadata is made up mostly of the keys shared with the
summary response came back nearly empty: `airflowctl providers get --full`
returned less than the `airflow providers get --full` command it replaces.
@henry3260
henry3260 force-pushed the add-airflowctl-providers-get branch from 8c9e9fb to bccfae8 Compare October 16, 2026 09:09

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates! I compared airflowctl providers get --full against the deprecated airflow providers get --full for all 109 installed providers: 28 match exactly, the rest lose some connection-type and config metadata (details inline).

The provider detail response reused the kebab-case key names from
provider.yaml, which would have made these the only non-snake_case
fields in the public API and unusable as attributes in the generated
clients. Reading the kebab-case keys is a parsing concern, so it moves
to validation_alias and leaves serialization on the field names.

Comparing the response against the deprecated `airflow providers get
--full` also showed metadata silently dropped because the models did
not declare it: ui-field-behaviour, conn-fields and external-services
on connection types, and is_template and see_also on config options.
…iders-get

# Conflicts:
#	airflow-core/src/airflow/ui/openapi-gen/requests/services.gen.ts

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only needs a rebase before we can merge.

Keys ``ProviderInfoResponse`` does not declare are dropped from the response
without raising, so a key added to ``provider_info.schema.json`` would go
missing from ``GET /providers/{package_name}`` with nothing to signal it. This
PR lost ``ui-field-behaviour``, ``conn-fields``, ``external-services``,
``is_template`` and ``see_also`` that way until review spotted them by hand.
@henry3260
henry3260 enabled auto-merge (squash) October 28, 2026 16:19
@henry3260
henry3260 merged commit 3293ced into apache:main Oct 28, 2026
282 of 284 checks passed
@shahar1 shahar1 mentioned this pull request Nov 4, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:airflow-ctl area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. kind:documentation ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants