kaxil opened a new pull request, #63322:
URL: https://github.com/apache/airflow/pull/63322

   Consolidates ~25 duplicated module type definitions across 9 files into a 
single `dev/registry/registry_tools/types.py`. Adding a new module type (e.g. 
AuthManagers) now requires editing 2-3 files instead of ~10.
   
   **Before:** type definitions hardcoded in `extract_metadata.py`, 
`extract_parameters.py`, `extract_versions.py`, `provider-card.njk`, 
`provider-version.njk`, `statsData.js`, `search.js`
   **After:** Python scripts import from `registry_tools.types`, frontend reads 
generated `types.json`
   
   ## What changed
   
   - `dev/registry` is now a uv workspace member with `registry_tools/` package
   - `registry_tools/types.py` defines `MODULE_TYPES`, `BASE_CLASS_IMPORTS`, 
and derived lookups
   - `generate_types_json.py` writes `types.json` for the Eleventy frontend
   - Pre-commit hook (`check_registry_types_json_sync.py`) validates 
`types.json` stays in sync
   - Module counts now derived from `modules.json` (runtime `issubclass` 
discovery) instead of AST suffix matching — fixes the Databricks operator 
undercount (showed 4 instead of 12)
   - Stats grid removed from provider version page (redundant with the filter 
sidebar)
   - Logos auto-copied to `registry/public/logos/` for local dev convenience
   
   ## Bug fixes included
   
   - **`"Base" in name` filter**: Substring match was dropping legitimate 
classes like `DatabaseOperator`, `KnowledgeBaseActiveSensor`, 
`BedrockCreateKnowledgeBaseOperator`. Changed to `name.startswith("Base")` in 
`extract_versions.py`.
   - **Operator undercount**: `extract_metadata.py` counted module *files* not 
*classes*. Removed AST counting entirely — counts now come from `modules.json` 
which uses runtime `issubclass` checks in breeze.
   
   ## Adding a new module type after this PR
   
   1. Add entry to `MODULE_TYPES` in `dev/registry/registry_tools/types.py`
   2. Run `uv run python dev/registry/generate_types_json.py`
   3. Add CSS variable + class in `tokens.css` / `main.css`
   4. If runtime discovery needed, add base class to `BASE_CLASS_IMPORTS`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to