Skip to content

Flag conn-fields in hook but absent from provider.yaml in static checks#69655

Merged
dabla merged 17 commits into
apache:mainfrom
dabla:feature/add-static-check-conn-fields-provider-yaml
Jul 16, 2026
Merged

Flag conn-fields in hook but absent from provider.yaml in static checks#69655
dabla merged 17 commits into
apache:mainfrom
dabla:feature/add-static-check-conn-fields-provider-yaml

Conversation

@dabla

@dabla dabla commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

The check_conn_fields_match_form_widgets static check introduced in #69473
only validated one direction: stale keys declared in conn-fields (YAML) that no
longer exist in get_connection_form_widgets(). It did not catch the opposite
case — a field added to the hook's form widgets but forgotten in conn-fields
which means the field silently disappears from the new React connection UI.

PR #64643 (Samba auth_protocol) exposed this gap: auth_protocol was added to
get_connection_form_widgets() but not to conn-fields in provider.yaml, and
the check passed without complaint.

The fix makes the check bidirectional: when conn-fields is declared, its keys
must exactly match the hook's widget keys. Both directions are now reported as
errors with distinct fix hints. The "no conn-fields at all" case is still
silently skipped (opting out of the React UI form is intentional).


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

Claude Sonnet 4.6


  • 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.

@potiuk
potiuk force-pushed the feature/add-static-check-conn-fields-provider-yaml branch from d67b4c8 to 2107311 Compare July 9, 2026 20:21
@dabla
dabla force-pushed the feature/add-static-check-conn-fields-provider-yaml branch from d156316 to 5dab8c9 Compare July 11, 2026 15:48
@dabla dabla self-assigned this Jul 11, 2026
… Azure and Snowflake providers so those are in sync with defined fields in get_connection_form_widgets method of corresponding hook
@dabla
dabla requested a review from shahar1 as a code owner July 12, 2026 10:22
@dabla
dabla force-pushed the feature/add-static-check-conn-fields-provider-yaml branch from 581f42f to 19686cc Compare July 14, 2026 14:33
@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

uv.lock on main just moved via #69694 ("[main] Upgrade important CI environment"), commit c8d313a and this PR currently conflicts.

Quickest fix:

git fetch upstream main && git rebase upstream/main
rm uv.lock && uv lock
git add uv.lock && git rebase --continue
git push --force-with-lease

Automated nudge — ignore if you're not ready to rebase. This comment is updated in place on future uv.lock bumps.

@jason810496 jason810496 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 once the CI pass, thanks.

@dabla dabla closed this Jul 16, 2026
@dabla dabla reopened this Jul 16, 2026
@dabla
dabla merged commit 58b5a80 into apache:main Jul 16, 2026
244 of 277 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport failed to create: v3-3-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-3-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 58b5a80 v3-3-test

This should apply the commit to the v3-3-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

dabla added a commit to dabla/airflow that referenced this pull request Jul 17, 2026
…ks (apache#69655)

* Flag conn-fields in hook but absent from provider.yaml

* Added missing conn-fields in provider.yaml of Hive, Google, Azure and Snowflake providers so those are in sync with defined fields in get_connection_form_widgets method of corresponding hook

* Added cloud_environment in provider.yaml for AzureBaseHook

* Fixed addition of cloud_environment in get_provider_info

---------

Co-authored-by: BKD7702 <bkd7702@infrabel.be>

(cherry picked from commit 58b5a80)
dabla added a commit to dabla/airflow that referenced this pull request Jul 17, 2026
…ks (apache#69655)

* Flag conn-fields in hook but absent from provider.yaml

* Added missing conn-fields in provider.yaml of Hive, Google, Azure and Snowflake providers so those are in sync with defined fields in get_connection_form_widgets method of corresponding hook

* Added cloud_environment in provider.yaml for AzureBaseHook

* Fixed addition of cloud_environment in get_provider_info

---------

Co-authored-by: BKD7702 <bkd7702@infrabel.be>

(cherry picked from commit 58b5a80)
dabla added a commit that referenced this pull request Jul 17, 2026
…ks (#69655) (#69996)

* Flag conn-fields in hook but absent from provider.yaml

* Added missing conn-fields in provider.yaml of Hive, Google, Azure and Snowflake providers so those are in sync with defined fields in get_connection_form_widgets method of corresponding hook

* Added cloud_environment in provider.yaml for AzureBaseHook

* Fixed addition of cloud_environment in get_provider_info

---------

Co-authored-by: BKD7702 <bkd7702@infrabel.be>

(cherry picked from commit 58b5a80)
@dabla

dabla commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Backport to v3-3-test succeeded via PR #69996 .

shahar1 added a commit to shahar1/airflow that referenced this pull request Jul 23, 2026
…elogs

The Airflow 3 API server builds the connection form from provider metadata
rather than by importing hooks, so adding these fields to provider.yaml is what
makes them appear in the UI at all. Hive connections gain Ssl and Zoo Keeper
Namespace, Azure gains Azure Cloud Environment, and Google and Snowflake gain
fields of their own. Excluding the change hid a visible one from users.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants