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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,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.*\.yaml$|^.*/openapi/_private_ui.*\.yaml$|^.*/pnpm-lock\.yaml$
exclude: ^\.github/.*$|^chart/templates/.*|.*reproducible_build\.yaml$|^.*/v2.*\.yaml$|^.*/openapi/_private_ui.*\.yaml$|^.*/pnpm-lock\.yaml$
types: [yaml]
files: \.ya?ml$
args:
Expand Down Expand Up @@ -1378,7 +1378,7 @@ repos:
entry: >
bash -c '
uv run -p 3.12 --no-dev --no-progress --active --group codegen --project apache-airflow-ctl --directory airflow-ctl/ datamodel-codegen &&
uv run -p 3.12 --no-dev --no-progress --active --group codegen --project apache-airflow-ctl --directory airflow-ctl/ datamodel-codegen --input="../airflow-core/src/airflow/api_fastapi/auth/managers/simple/openapi/v1-simple-auth-manager-generated.yaml" --output="src/airflowctl/api/datamodels/auth_generated.py"'
uv run -p 3.12 --no-dev --no-progress --active --group codegen --project apache-airflow-ctl --directory airflow-ctl/ datamodel-codegen --input="../airflow-core/src/airflow/api_fastapi/auth/managers/simple/openapi/v2-simple-auth-manager-generated.yaml" --output="src/airflowctl/api/datamodels/auth_generated.py"'
pass_filenames: false
files: ^airflow-core/src/airflow/api_fastapi/core_api/datamodels/.*\.py$|^airflow-core/src/airflow/api_fastapi/auth/managers/simple/datamodels/.*\.py$
require_serial: true
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*.yaml
v2*.yaml
_private_ui*.yaml

# Front end generated files
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 @@ -349,8 +349,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-rest-api-generated.yaml")
sam_openapi_path = Path(sam_openapi_file).parent.joinpath("v1-simple-auth-manager-generated.yaml")
main_openapi_path = Path(main_openapi_file).parent.joinpath("v2-rest-api-generated.yaml")
sam_openapi_path = Path(sam_openapi_file).parent.joinpath("v2-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-simple-auth-manager-generated.yaml\" -c axios --format prettier -o openapi-gen --operationId",
"codegen": "openapi-rq -i \"../openapi/v2-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/openapi-merge.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"inputs": [
{
"inputFile": "../api_fastapi/core_api/openapi/v1-rest-api-generated.yaml"
"inputFile": "../api_fastapi/core_api/openapi/v2-rest-api-generated.yaml"
},
{
"inputFile": "../api_fastapi/core_api/openapi/_private_ui.yaml"
Expand Down
2 changes: 1 addition & 1 deletion airflow-ctl/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ use-standard-collections=true # list[] not List[]
use-subclass-enum=true # enum, not union of Literals
use-union-operator=true # 3.9+annotations, not `Union[]`

input = "../airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml"
input = "../airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml"
output = "src/airflowctl/api/datamodels/generated.py"

## pytest settings ##
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: v1-simple-auth-manager-generated.yaml
# filename: v2-simple-auth-manager-generated.yaml
# version: 0.28.2

from __future__ import annotations
Expand Down
2 changes: 1 addition & 1 deletion airflow-ctl/src/airflowctl/api/datamodels/generated.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generated by datamodel-codegen:
# filename: v1-rest-api-generated.yaml
# filename: v2-rest-api-generated.yaml
# version: 0.28.2

from __future__ import annotations
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-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.
3. Persisted openapi spec is located in ``v2-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/README_RELEASE_AIRFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ Clients can be found here:
### API Clients versioning policy

Clients and Core versioning are completely decoupled. Clients also follow SemVer and are updated when core introduce changes relevant to the clients.
Most of the time, if the [openapi specification](https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml) has
Most of the time, if the [openapi specification](https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml) has
changed, clients need to be released.

To determine if you should release API clients, you can run from the airflow repository:
Expand Down
2 changes: 1 addition & 1 deletion dev/README_RELEASE_PYTHON_CLIENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ echo "${VERSION}" > clients/python/version.txt

```shell script
cd ${AIRFLOW_REPO_ROOT}
git log 2.8.0..HEAD --pretty=oneline -- airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml
git log 2.8.0..HEAD --pretty=oneline -- airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml
```

- Update CHANGELOG.md with the details.
Expand Down
2 changes: 1 addition & 1 deletion dev/airflow-github
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def api_clients_policy(previous_version, target_version):
repo,
previous_version,
target_version,
files=[f"{repo.working_dir}/airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml"],
files=[f"{repo.working_dir}/airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml"],
)

clients_need_release = False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3079,7 +3079,7 @@ def split_version_and_suffix(file_name: str, suffix: str) -> VersionedFile:

VERSION_FILE = PYTHON_CLIENT_DIR_PATH / "version.txt"
SOURCE_API_YAML_PATH = (
AIRFLOW_ROOT_PATH / "airflow-core/src/airflow/api_fastapi/core_api/openapi/v1-rest-api-generated.yaml"
AIRFLOW_ROOT_PATH / "airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml"
)
TARGET_API_YAML_PATH = PYTHON_CLIENT_DIR_PATH / "v1.yaml"
OPENAPI_GENERATOR_CLI_VER = "7.13.0"
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 @@ -2001,7 +2001,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-rest-api-generated.yaml",),
("airflow-core/src/airflow/api_fastapi/core_api/openapi/v2-rest-api-generated.yaml",),
{
"selected-providers-list-as-string": "",
"all-python-versions": f"['{DEFAULT_PYTHON_MAJOR_MINOR_VERSION}']",
Expand Down
2 changes: 1 addition & 1 deletion devel-common/src/docs/provider_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
"v1-flask-api.yaml"
)
fab_auth_manager_fastapi_api_path = Path(fab_auth_manager_fastapi_api_file).parent.joinpath(
"v1-fab-auth-manager-generated.yaml"
"v2-fab-auth-manager-generated.yaml"
)
redoc = [
{
Expand Down
6 changes: 3 additions & 3 deletions scripts/in_container/run_update_fastapi_api_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
if TYPE_CHECKING:
from fastapi import FastAPI

OPENAPI_SPEC_FILE = Path(CORE_API_PATH).parent / "openapi" / "v1-rest-api-generated.yaml"
OPENAPI_SPEC_FILE = Path(CORE_API_PATH).parent / "openapi" / "v2-rest-api-generated.yaml"
# We need a "combined" spec file to generate the UI code with, but we don't want to include this in the repo
# nor in the rendered docs, so we make this a separate file which is gitignored
OPENAPI_UI_SPEC_FILE = Path(CORE_API_PATH).parent / "openapi" / "_private_ui.yaml"
SIMPLE_AUTH_MANAGER_OPENAPI_SPEC_FILE = (
Path(SIMPLE_AUTH_MANAGER_PATH).parent / "openapi" / "v1-simple-auth-manager-generated.yaml"
Path(SIMPLE_AUTH_MANAGER_PATH).parent / "openapi" / "v2-simple-auth-manager-generated.yaml"
)
FAB_AUTH_MANAGER_OPENAPI_SPEC_FILE = (
Path(FAB_AUTH_MANAGER_API_PATH).parent / "openapi" / "v1-fab-auth-manager-generated.yaml"
Path(FAB_AUTH_MANAGER_API_PATH).parent / "openapi" / "v2-fab-auth-manager-generated.yaml"
)


Expand Down
Loading