Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
eb8e93e
Add async connection testing via ExecutorCallback dispatch to workers
anishgirianish Feb 23, 2026
928699e
fix test in ci
anishgirianish Feb 23, 2026
2324221
Address review feedback: remove redundant result_status, move callbac…
anishgirianish Feb 23, 2026
63b0126
ci test fix and rebase issues
anishgirianish Feb 24, 2026
d1e9d31
refactor and cleanups
anishgirianish Feb 25, 2026
2f926f0
Add async connection testing on workers via dedicated workload
anishgirianish Feb 28, 2026
5ce672e
Add revert-on-failure for save-and-test connection endpoint
anishgirianish Feb 28, 2026
fabebef
regenrated auto generates after rebase
anishgirianish Feb 28, 2026
64a574d
fix local executer
anishgirianish Mar 1, 2026
7f9029a
refactor local executor
anishgirianish Mar 1, 2026
703ece2
Simplify local executor
anishgirianish Mar 2, 2026
ddd0253
further simplify local execter
anishgirianish Mar 2, 2026
9fe3946
add queue parmeter
anishgirianish Mar 2, 2026
e3c4421
fix ci test failiures
anishgirianish Mar 2, 2026
82576e7
changed reverted default server value
anishgirianish Mar 2, 2026
b4f702c
refactor: move connection test execution logic from local_executor to…
anishgirianish Mar 3, 2026
a015210
update migration description
anishgirianish Mar 3, 2026
f82bd1b
clean ups
anishgirianish Mar 3, 2026
d5d8126
refactor dispatch and reaper for connection test
anishgirianish Mar 3, 2026
918641a
address review feedback refactor
anishgirianish Mar 3, 2026
1352b73
clean ups
anishgirianish Mar 3, 2026
2ec3a61
remove queue executer and team name mixed up
anishgirianish Mar 4, 2026
15ebe5d
used version api
anishgirianish Mar 5, 2026
60861aa
further refined executer finder
anishgirianish Mar 5, 2026
b17f75b
Clear connection_snapshot from DB after terminal state is reached
anishgirianish Mar 5, 2026
9c708f3
Address executor routing review feedback for async connection tests
anishgirianish Mar 5, 2026
9b26a15
fix reverted flag not updating issue
anishgirianish Mar 5, 2026
9931da7
refactor namings
anishgirianish Mar 5, 2026
874b489
regenerated erd
anishgirianish Mar 10, 2026
7b73a81
regenrated erd
anishgirianish Mar 12, 2026
324cc47
Remove committed ERD files
anishgirianish Mar 12, 2026
3a11823
auto gen files
anishgirianish Mar 19, 2026
b31d1c3
Redesign async connection testing to use request-buffer pattern
anishgirianish Mar 21, 2026
fd3fbf7
fix ci faliure
anishgirianish Mar 21, 2026
42c9d07
fix failing tests
anishgirianish Mar 21, 2026
c6dd945
fix type issue
anishgirianish Mar 22, 2026
54b3dec
removed fragment
anishgirianish Mar 22, 2026
01e353c
remove unwanted file
anishgirianish Mar 22, 2026
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
5 changes: 4 additions & 1 deletion airflow-core/docs/migrations-ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ Here's the list of all the Database Migrations that are executed via when you ru
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| Revision ID | Revises ID | Airflow Version | Description |
+=========================+==================+===================+==============================================================+
| ``1d6611b6ab7c`` (head) | ``888b59e02a5b`` | ``3.2.0`` | Add bundle_name to callback table. |
| ``a7e6d4c3b2f1`` (head) | ``1d6611b6ab7c`` | ``3.2.0`` | Add connection_test_request table for async connection |
| | | | testing. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| ``1d6611b6ab7c`` | ``888b59e02a5b`` | ``3.2.0`` | Add bundle_name to callback table. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
| ``888b59e02a5b`` | ``6222ce48e289`` | ``3.2.0`` | Fix migration file ORM inconsistencies. |
+-------------------------+------------------+-------------------+--------------------------------------------------------------+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import json
from collections.abc import Iterable, Mapping
from datetime import datetime
from typing import Annotated, Any

from pydantic import Field, field_validator
Expand Down Expand Up @@ -72,12 +73,46 @@ class ConnectionCollectionResponse(BaseModel):


class ConnectionTestResponse(BaseModel):
"""Connection Test serializer for responses."""
"""Connection Test serializer for synchronous test responses."""

status: bool
message: str


class ConnectionTestRequestBody(StrictBaseModel):
"""Request body for async connection test."""

connection_id: str
conn_type: str
host: str | None = None
login: str | None = None
schema_: str | None = Field(None, alias="schema")
port: int | None = None
password: str | None = None
extra: str | None = None
commit_on_success: bool = False
executor: str | None = None
queue: str | None = None


class ConnectionTestQueuedResponse(BaseModel):
"""Response returned when an async connection test is queued."""

token: str
connection_id: str
state: str


class ConnectionTestStatusResponse(BaseModel):
"""Response returned when polling for async connection test status."""

token: str
connection_id: str
state: str
result_message: str | None = None
created_at: datetime


class ConnectionHookFieldBehavior(BaseModel):
"""A class to store the behavior of each standard field of a Hook."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,12 @@ paths:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Not Found
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Conflict
'422':
description: Validation Error
content:
Expand Down Expand Up @@ -1681,6 +1687,110 @@ paths:
security:
- OAuth2PasswordBearer: []
- HTTPBearer: []
/api/v2/connections/test-async:
post:
tags:
- Connection
summary: Test Connection Async
description: 'Queue an async connection test to be executed on a worker.


The connection data is stored in the test request table and the worker

reads from there. Returns a token to poll for the result via

GET /connections/test-async/{token}.'
operationId: test_connection_async
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectionTestRequestBody'
required: true
responses:
'202':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectionTestQueuedResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
'403':
description: Forbidden
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
'409':
description: Conflict
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- OAuth2PasswordBearer: []
- HTTPBearer: []
/api/v2/connections/test-async/{connection_test_token}:
get:
tags:
- Connection
summary: Get Connection Test
description: "Poll for the status of an async connection test.\n\nKnowledge\
\ of the token serves as authorization \u2014 only the client\nthat initiated\
\ the test knows the crypto-random token."
operationId: get_connection_test
security:
- OAuth2PasswordBearer: []
- HTTPBearer: []
parameters:
- name: connection_test_token
in: path
required: true
schema:
type: string
title: Connection Test Token
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectionTestStatusResponse'
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Not Found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v2/connections/defaults:
post:
tags:
Expand Down Expand Up @@ -10096,6 +10206,83 @@ components:
- team_name
title: ConnectionResponse
description: Connection serializer for responses.
ConnectionTestQueuedResponse:
properties:
token:
type: string
title: Token
connection_id:
type: string
title: Connection Id
state:
type: string
title: State
type: object
required:
- token
- connection_id
- state
title: ConnectionTestQueuedResponse
description: Response returned when an async connection test is queued.
ConnectionTestRequestBody:
properties:
connection_id:
type: string
title: Connection Id
conn_type:
type: string
title: Conn Type
host:
anyOf:
- type: string
- type: 'null'
title: Host
login:
anyOf:
- type: string
- type: 'null'
title: Login
schema:
anyOf:
- type: string
- type: 'null'
title: Schema
port:
anyOf:
- type: integer
- type: 'null'
title: Port
password:
anyOf:
- type: string
- type: 'null'
title: Password
extra:
anyOf:
- type: string
- type: 'null'
title: Extra
commit_on_success:
type: boolean
title: Commit On Success
default: false
executor:
anyOf:
- type: string
- type: 'null'
title: Executor
queue:
anyOf:
- type: string
- type: 'null'
title: Queue
additionalProperties: false
type: object
required:
- connection_id
- conn_type
title: ConnectionTestRequestBody
description: Request body for async connection test.
ConnectionTestResponse:
properties:
status:
Expand All @@ -10109,7 +10296,35 @@ components:
- status
- message
title: ConnectionTestResponse
description: Connection Test serializer for responses.
description: Connection Test serializer for synchronous test responses.
ConnectionTestStatusResponse:
properties:
token:
type: string
title: Token
connection_id:
type: string
title: Connection Id
state:
type: string
title: State
result_message:
anyOf:
- type: string
- type: 'null'
title: Result Message
created_at:
type: string
format: date-time
title: Created At
type: object
required:
- token
- connection_id
- state
- created_at
title: ConnectionTestStatusResponse
description: Response returned when polling for async connection test status.
CreateAssetEventsBody:
properties:
asset_id:
Expand Down
Loading
Loading