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

   **Description**
   
   Migrate `AirbyteSyncTrigger` to use the shared `PollingTrigger` lifecycle 
framework introduced by [AIP-121: Introduce a PollingTrigger Lifecycle 
Framework](https://cwiki.apache.org/confluence/spaces/AIRFLOW/pages/451974742/AIP-121+Introduce+a+PollingTrigger+Lifecycle+Framework)
   
   The trigger now implements `poll()` instead of managing its own polling 
loop, returning `None` for non-terminal job states and a `TriggerEvent` when 
the Airbyte job reaches a terminal state.
   
   Polling intervals, deadline enforcement, and terminal event emission are 
delegated to `PollingTrigger`.
   
   The migration also introduces `build_error_event()` and 
`build_timeout_event()` to preserve the existing event payloads, while 
retaining the Unix timestamp serialization format for deadlines.
   
   **Rationale**
   
   `AirbyteSyncTrigger` previously implemented its own polling lifecycle, 
including polling intervals, deadline checks, and exception handling.
   
   Migrating to `PollingTrigger` removes this duplicated lifecycle logic and 
demonstrates how an existing provider trigger can adopt the framework while 
retaining Airbyte-specific status handling.
   
   This migration also serves as a proof of concept for validating the proposed 
AIP-121 framework against an existing provider implementation.
   
   **Tests**
   
   Updated the Airbyte trigger tests to cover:
   
   - Serialization and reconstruction of trigger arguments.
   - Running, pending, and incomplete job states.
   - Successful, cancelled, and failed job events.
   - Continued polling until a terminal status is reached.
   - Unexpected polling exceptions and error event generation.
   - Deadline expiration and timeout event generation.
   - Deadline precedence over polling exceptions.
   - Terminal event precedence when a deadline expires during a successful poll.
   - Cancellation propagation.
   - Existing `is_still_running()` behaviour.
   
   **Notes**
   
   - This PR is intended as a proof of concept for AIP-121, which is still in 
the DISCUSSION phase. It is not currently intended for merging, and the 
implementation may change based on community feedback.
   
   - The migration depends on `PollingTrigger` being available through 
`apache-airflow-providers-common-compat`.
   
   - The existing `execution_deadline` workaround has been removed from the 
trigger. Task-level `execution_timeout` handling is separate from the polling 
deadline managed by `PollingTrigger` and will require appropriate Core 
lifecycle support.
   
   **Documentation**
   
   No documentation changes are included. The `PollingTrigger` API and 
lifecycle are documented as part of the Core AIP-121 implementation.


-- 
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]

  • [PR] [AIP 121] Migrate Airbyt... SameerMesiah97 (via GitHub) via commits

Reply via email to