Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ repos:
- --fuzzy-match-generates-todo
- id: insert-license
name: Add license for all YAML files except Helm templates
exclude: ^\.github/.*$|^chart/templates/.*|.*reproducible_build\.yaml$|^.*/v1-generated\.yaml$|^.*/pnpm-lock\.yaml$
exclude: ^\.github/.*$|^chart/templates/.*|.*reproducible_build\.yaml$|^.*/v1.*\.yaml$|^.*/pnpm-lock\.yaml$
types: [yaml]
files: \.ya?ml$
args:
Expand Down Expand Up @@ -281,7 +281,7 @@ repos:
^.*airflow\.template\.yaml$|
^.*init_git_sync\.template\.yaml$|
^chart/(?:templates|files)/.*\.yaml$|
.*/v1-generated\.yaml$|
.*/v1.*\.yaml$|
^.*openapi.*\.yaml$|
^\.pre-commit-config\.yaml$|
^.*reproducible_build\.yaml$|
Expand Down Expand Up @@ -1322,9 +1322,9 @@ repos:
files: |
(?x)
^airflow-core/src/airflow/ui/|
^airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-generated\.yaml$|
^airflow-core/src/airflow/api_fastapi/core_api/openapi/v1.*\.yaml$|
^airflow-core/src/airflow/api_fastapi/auth/managers/simple/ui/|
^airflow-core/src/airflow/api_fastapi/auth/managers/simple/openapi/v1-generated\.yaml$
^airflow-core/src/airflow/api_fastapi/auth/managers/simple/openapi/v1.*\.yaml$
entry: ./scripts/ci/pre_commit/compile_lint_ui.py
additional_dependencies: ['pnpm@9.7.1']
pass_filenames: false
Expand Down
2 changes: 1 addition & 1 deletion .rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ PKG-INFO
# Openapi files
.openapi-generator-ignore
version.txt
v1-generated.yaml
v1*.yaml

# Front end generated files
api-generated.ts
Expand Down
4 changes: 2 additions & 2 deletions airflow-core/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ def add_airflow_core_exclude_patterns_to_sphinx(exclude_patterns: list[str]):

graphviz_output_format = "svg"

main_openapi_path = Path(main_openapi_file).parent.joinpath("v1-generated.yaml")
sam_openapi_path = Path(sam_openapi_file).parent.joinpath("v1-generated.yaml")
main_openapi_path = Path(main_openapi_file).parent.joinpath("v1-rest-api-generated.yaml")
sam_openapi_path = Path(sam_openapi_file).parent.joinpath("v1-simple-auth-manager-generated.yaml")
redoc = [
{
"name": "Simple auth manager token API",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint:fix": "eslint --fix && tsc --p tsconfig.app.json",
"format": "pnpm prettier --write .",
"preview": "vite preview",
"codegen": "openapi-rq -i \"../openapi/v1-generated.yaml\" -c axios --format prettier -o openapi-gen --operationId",
"codegen": "openapi-rq -i \"../openapi/v1-simple-auth-manager-generated.yaml\" -c axios --format prettier -o openapi-gen --operationId",
"test": "vitest run",
"coverage": "vitest run --coverage"
},
Expand Down
2 changes: 1 addition & 1 deletion airflow-core/src/airflow/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint:fix": "eslint --fix && tsc --p tsconfig.app.json",
"format": "pnpm prettier --write .",
"preview": "vite preview",
"codegen": "openapi-rq -i \"../api_fastapi/core_api/openapi/v1-generated.yaml\" -c axios --format prettier -o openapi-gen --operationId",
"codegen": "openapi-rq -i \"../api_fastapi/core_api/openapi/v1-rest-api-generated.yaml\" -c axios --format prettier -o openapi-gen --operationId",
"test": "vitest run",
"coverage": "vitest run --coverage"
},
Expand Down
2 changes: 1 addition & 1 deletion contributing-docs/16_adding_api_endpoints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Step 4: Run Pre-commit Hooks
-----------------------------
1. Ensure all code meets the project's quality standards by running pre-commit hooks.
2. Pre-commit hooks include static code checks, formatting, and other validations.
3. Persisted openapi spec is located in ``v1-generated.yaml`` and a hook will take care of updating it based on your new endpoint, you just need to add and commit the change.
3. Persisted openapi spec is located in ``v1-rest-api-generated.yaml` and a hook will take care of updating it based on your new endpoint, you just need to add and commit the change.
4. Run the following command to execute all pre-commit hooks:

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion dev/breeze/src/airflow_breeze/utils/selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def __hash__(self):
r"^airflow-core/tests/unit/api_fastapi/",
],
FileGroupForCi.API_CODEGEN_FILES: [
r"^airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-generated\.yaml",
r"^airflow-core/src/airflow/api_fastapi/core_api/openapi/.*generated\.yaml",
r"^clients/gen",
],
FileGroupForCi.HELM_FILES: [
Expand Down
2 changes: 1 addition & 1 deletion dev/breeze/tests/test_selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ def test_expected_output_push(
id="Tests for all airflow core types except providers should run if model file changed",
),
pytest.param(
("airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-generated.yaml",),
("airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml",),
{
"selected-providers-list-as-string": "",
"all-python-versions": "['3.9']",
Expand Down
6 changes: 4 additions & 2 deletions devel-common/src/docs/provider_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,11 @@
)
from airflow.providers.fab.auth_manager.openapi import __file__ as fab_auth_manager_flask_api_file

fab_auth_manager_flask_api_path = Path(fab_auth_manager_flask_api_file).parent.joinpath("v1.yaml")
fab_auth_manager_flask_api_path = Path(fab_auth_manager_flask_api_file).parent.joinpath(
"v1-flask-api.yaml"
)
fab_auth_manager_fastapi_api_path = Path(fab_auth_manager_fastapi_api_file).parent.joinpath(
"v1-generated.yaml"
"v1-fab-auth-manager-generated.yaml"
)
redoc = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def get_fastapi_app(self) -> FastAPI | None:

def get_api_endpoints(self) -> None | Blueprint:
folder = Path(__file__).parents[0].resolve() # this is airflow/auth/managers/fab/
with folder.joinpath("openapi", "v1.yaml").open() as f:
with folder.joinpath("openapi", "v1-flask-api.yaml").open() as f:
specification = safe_load(f)
return FlaskApi(
specification=specification,
Expand Down
11 changes: 6 additions & 5 deletions scripts/in_container/run_update_fastapi_api_spec.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
Expand Down Expand Up @@ -32,12 +33,12 @@
if TYPE_CHECKING:
from fastapi import FastAPI

OPENAPI_SPEC_FILE = Path(CORE_API_PATH).parent.joinpath("openapi", "v1-generated.yaml")
SIMPLE_AUTH_MANAGER_OPENAPI_SPEC_FILE = Path(SIMPLE_AUTH_MANAGER_PATH).parent.joinpath(
"openapi", "v1-generated.yaml"
OPENAPI_SPEC_FILE = Path(CORE_API_PATH).parent / "openapi" / "v1-rest-api-generated.yaml"
SIMPLE_AUTH_MANAGER_OPENAPI_SPEC_FILE = (
Path(SIMPLE_AUTH_MANAGER_PATH).parent / "openapi" / "v1-simple-auth-manager-generated.yaml"
)
FAB_AUTH_MANAGER_OPENAPI_SPEC_FILE = Path(FAB_AUTH_MANAGER_API_PATH).parent.joinpath(
"openapi", "v1-generated.yaml"
FAB_AUTH_MANAGER_OPENAPI_SPEC_FILE = (
Path(FAB_AUTH_MANAGER_API_PATH).parent / "openapi" / "v1-fab-auth-manager-generated.yaml"
)


Expand Down
Loading