Skip to content

Validate provider metadata list entries instead of ignoring them - #71104

Merged
potiuk merged 3 commits into
apache:mainfrom
astronomer:queues-schema-items
Aug 9, 2026
Merged

Validate provider metadata list entries instead of ignoring them#71104
potiuk merged 3 commits into
apache:mainfrom
astronomer:queues-schema-items

Conversation

@Lee-W

@Lee-WLee-W commented Aug 4, 2026

Copy link
Copy Markdown
Member

Why

#70190 (comment)

The items blocks for queues, plugins and task-decorators listed their field names directly under items, where they are not JSON Schema keywords, so the blocks were inert and any shape passed. A provider author following what those blocks appeared to document — a dict for queues, or a path key for a decorator — got no error and was quietly dropped by the consumers instead.

What

Pinning each section to the shape the provider.yaml files and generated payloads actually use turns that into a failure at authoring time. The custom-provider howto named the same nonexistent path field.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@Lee-WLee-W self-assigned this Aug 5, 2026
@Lee-W
Lee-Wforce-pushed the queues-schema-items branch 2 times, most recently from 0af7ff4 to a509680CompareAugust 5, 2026 08:10
@Lee-W
Lee-W marked this pull request as ready for review August 5, 2026 08:34
@Lee-W
Lee-Wforce-pushed the queues-schema-items branch from a509680 to fc354e4CompareAugust 5, 2026 09:30
@kaxil
kaxil requested a review from potiukAugust 5, 2026 11:24
Comment threadairflow-core/src/airflow/provider_info.schema.json Outdated
Comment threadairflow-core/src/airflow/provider.yaml.schema.json
Lee-W added 3 commits August 7, 2026 23:02
The items blocks for queues, plugins and task-decorators listed their field
names directly under items, where they are not JSON Schema keywords, so the
blocks were inert and any shape passed. A provider author following what those
blocks appeared to document — a dict for queues, or a path key for a decorator
— got no error and was quietly dropped by the consumers instead. Pinning each
section to the shape the provider.yaml files and generated payloads actually
use turns that into a failure at authoring time. The custom-provider howto
named the same nonexistent path field.
Raised in review of apache#70190.
The runtime schema is documented as deliberately looser than the development
one, and its validate() call is unwrapped in provider discovery, so a single
installed provider emitting an outdated entry shape would abort discovery for
every provider in that process instead of costing just that entry a logged
warning. The structural descriptions stay behind so the schema no longer
documents a shape it never actually enforced.
Requiring the right keys does not stop a leftover one sitting beside them, so a
stale `path:` next to a correct `class-name:` still validated — exactly the
confusion this branch set out to remove. Every sibling item block in this
authoring schema already closes itself off this way.
@Lee-W
Lee-Wforce-pushed the queues-schema-items branch from fc354e4 to da294aaCompareAugust 7, 2026 15:05
@potiuk
potiuk merged commit 739c807 into apache:mainAug 9, 2026
76 checks passed
@Lee-W
Lee-W deleted the queues-schema-items branch August 10, 2026 09:15
dabla pushed a commit to dabla/airflow that referenced this pull request Aug 14, 2026
…che#71104)
* Validate provider metadata list entries instead of ignoring them
The items blocks for queues, plugins and task-decorators listed their field
names directly under items, where they are not JSON Schema keywords, so the
blocks were inert and any shape passed. A provider author following what those
blocks appeared to document — a dict for queues, or a path key for a decorator
— got no error and was quietly dropped by the consumers instead. Pinning each
section to the shape the provider.yaml files and generated payloads actually
use turns that into a failure at authoring time. The custom-provider howto
named the same nonexistent path field.
Raised in review of apache#70190.
* Keep runtime provider metadata validation permissive
The runtime schema is documented as deliberately looser than the development
one, and its validate() call is unwrapped in provider discovery, so a single
installed provider emitting an outdated entry shape would abort discovery for
every provider in that process instead of costing just that entry a logged
warning. The structural descriptions stay behind so the schema no longer
documents a shape it never actually enforced.
* Reject unknown keys in provider.yaml decorator and plugin entries
Requiring the right keys does not stop a leftover one sitting beside them, so a
stale `path:` next to a correct `class-name:` still validated — exactly the
confusion this branch set out to remove. Every sibling item block in this
authoring schema already closes itself off this way.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Lee-W@potiuk@kaxil