Repository navigation
Add prek hook to catch operators missing from common-ai docs index - #71783
Merged
Merged
Conversation
The "Choosing the right operator" table in providers/common/ai/docs/operators/index.rst is hand-maintained and has already gone stale more than once (LLMSchemaCompareOperator was missing until apache#71738). Nothing else catches this: the Sphinx doc build only fails on broken `:class:` refs, not on a class that's simply absent from the table. This adds a regression test so the next missed operator fails CI instead of relying on manual review.
ColtenOuO
requested review from
Lee-W,
ashb,
gopidesupavan and
kaxil
as code owners
August 18, 2026 17:12
Lee-W
reviewed
Aug 24, 2026
Lee-W
left a comment
Member
There was a problem hiding this comment.
This is a nice thing to have, but i think we should make it a prek hook instead of a unit test
ColtenOuO
requested review from
amoghrajesh,
bugraoz93,
jason810496,
jscheffl and
potiuk
as code owners
August 24, 2026 09:39
Contributor
Author
|
Thanks for reviewing! Agree your point I've updated it to a prek hook and also updated the PR title and description. |
Lee-W
approved these changes
Aug 25, 2026
A unit test only guards this when the provider's test suite happens to be selected in CI, but the pairing it protects — the operators package and the hand-maintained docs index — is just as likely to drift from a docs-only edit. A prek hook keyed on both sides catches the gap at commit time instead.
ColtenOuO
force-pushed
the
common-ai-operators-index-test
branch
from
August 25, 2026 14:00
b4425a1 to
842c37a
Compare
potiuk
approved these changes
Aug 25, 2026
imrichardwu
pushed a commit
to imrichardwu/airflow
that referenced
this pull request
Sep 11, 2026
…pache#71783) * Add test to catch operators missing from common-ai docs index The "Choosing the right operator" table in providers/common/ai/docs/operators/index.rst is hand-maintained and has already gone stale more than once (LLMSchemaCompareOperator was missing until apache#71738). Nothing else catches this: the Sphinx doc build only fails on broken `:class:` refs, not on a class that's simply absent from the table. This adds a regression test so the next missed operator fails CI instead of relying on manual review. * Replace common-ai docs index test with a prek hook A unit test only guards this when the provider's test suite happens to be selected in CI, but the pairing it protects — the operators package and the hand-maintained docs index — is just as likely to drift from a docs-only edit. A prek hook keyed on both sides catches the gap at commit time instead.
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.
Sumarry
Adds a regression test guarding
providers/common/ai/docs/operators/index.rst's "Choosing the right operator" table, which is hand-maintained and has already silently gone stale once (LLMSchemaCompareOperatorwas missing from it until #71738).The test walks every class defined directly in
providers/common/ai/src/airflow/providers/common/ai/operators/andflags the ones that are:
airflow.sdk.BaseOperator(transitively, so operators that inherit from another local operator likeLLMOperatorstill count)BaseOperatoritself, pydanticBaseModelhelpers (SchemaMismatch,SchemaCompareResult),BaseOperatorLinksubclasses (HITLReviewLink), and imported mixins (LLMApprovalMixin,BranchMixIn) are correctly excluded and never flagged.Each remaining class name is checked against the text of
docs/operators/index.rst. Nothing else in CI catches this class of gap today.Changes
scripts/ci/prek/check_common_ai_operators_index.pyand registers it asthe
check-common-ai-operators-indexhook inproviders/.pre-commit-config.yaml.Was generative AI tooling used to co-author this PR?