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

   ### Description
   
   Currently, there is no direct mechanism to pause an individual asset watcher 
without either pausing every Dag scheduled on that asset or removing the asset 
reference from the Dag code. Pausing all dependent Dags halts regular schedules 
and manual triggers, while removing the asset clears trigger references and 
erases failure/execution history.
   
   This change allows pausing and unpausing individual asset watchers via the 
API and UI:
   - **Database**: Added an `is_paused` flag to `asset_watcher` via Alembic 
migration `c0d0fcb49ef0`.
   - **API**: Added `PATCH /public/assets/{asset_id}/watchers/{watcher_name}` 
accepting `{ "is_paused": boolean }`.
   - **Trigger Lifecycle**:
     - Triggers are skipped from triggerer scheduling 
(`Trigger.get_sorted_triggers`) when all associated watchers are paused.
     - When watchers share a trigger, the trigger continues running for 
unpaused watchers while skipping event generation for paused watchers.
     - Failure and execution history (`consecutive_failures`, 
`first_failed_at`, etc.) are preserved across pauses.
     - Added `TriggerStatus.PAUSED` status for fully paused triggers.
   - **UI**:
     - Added pause/resume toggle switch (`TogglePauseWatcher`) to the Triggers 
page, Trigger detail Watched Assets table, and Asset detail Watchers popover.
     - Added a `Paused` status badge and tooltip hint in `TriggerStatusBadge`.
   
   closes: #77060
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Antigravity
   
   Generated-by: Antigravity following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


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