Skip to content

Run check-provider-yaml-valid when prek scripts or providers config change#70230

Merged
dabla merged 4 commits into
apache:mainfrom
dabla:fix/selective-tests-provider-hooks
Jul 23, 2026
Merged

Run check-provider-yaml-valid when prek scripts or providers config change#70230
dabla merged 4 commits into
apache:mainfrom
dabla:fix/selective-tests-provider-hooks

Conversation

@dabla

@dabla dabla commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Currently, selective checks skip check-provider-yaml-valid unless a provider.yaml, pyproject.toml, or provider Python file changed. This means that when only scripts/ci/prek/check_provider_yaml_files.py or providers/.pre-commit-config.yaml is modified, the check is silently skipped — so a bug introduced in the check script itself goes undetected in CI.

This was the root cause of the FileNotFoundError for providers/apache/provider.yaml reported after #70007 merged: the
_resolve_provider_yaml_files() function mapped any provider Python file to <pkg>/provider.yaml without guarding against non-provider-package paths like apache/, but check-provider-yaml-valid never ran in that PR's CI to catch it.

Changes

  • Add providers/.pre-commit-config.yaml to
    ALL_PROVIDERS_DISTRIBUTION_CONFIG_FILES so changes to the providers
    prek configuration are treated like provider.yaml changes.
  • Add PREK_FILES as an additional condition: when any prek script
    changes, check-provider-yaml-valid is no longer skipped.
  • Add a test covering both trigger paths.
  • Update dev/breeze/doc/ci/04_selective_checks.md to document the new
    rule.

Related

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

Claude Sonnet 4.6 (GitHub Copilot CLI)


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

…hange

When only `scripts/ci/prek/check_provider_yaml_files.py` or
`providers/.pre-commit-config.yaml` changed, selective checks incorrectly
skipped `check-provider-yaml-valid` because those paths matched neither
`ALL_PROVIDERS_DISTRIBUTION_CONFIG_FILES` nor `ALL_PROVIDERS_PYTHON_FILES`.
This meant a bug introduced in the check script itself (like the path
resolution bug in apache#70007) would go undetected in CI.

Fix by:
- Including `providers/.pre-commit-config.yaml` in
  `ALL_PROVIDERS_DISTRIBUTION_CONFIG_FILES`
- Adding `PREK_FILES` as a third condition that keeps
  `check-provider-yaml-valid` from being skipped

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dabla
dabla force-pushed the fix/selective-tests-provider-hooks branch from 287e67c to 81fbfcb Compare July 22, 2026 11:27
Comment thread dev/breeze/doc/ci/04_selective_checks.md Outdated
Comment thread dev/breeze/tests/test_selective_checks.py
Comment thread dev/breeze/tests/test_selective_checks.py
@dabla
dabla force-pushed the fix/selective-tests-provider-hooks branch from 376320a to 101c4b7 Compare July 22, 2026 12:29
@dabla
dabla merged commit ff0ac28 into apache:main Jul 23, 2026
155 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 ff0ac28 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.

@Lee-W

Lee-W commented Jul 23, 2026

Copy link
Copy Markdown
Member

#70282

Lee-W added a commit that referenced this pull request Jul 24, 2026
…ers config change (#70230) (#70282)

Co-authored-by: David Blain <info@dabla.be>
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.

4 participants