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

   Part of [AIP-125 (Inbound 
Webhooks)](https://lists.apache.org/thread/p3dpnor4zwko8tldpncj6ftj1bpp18q7), 
which lets external services such as GitHub trigger Dags by sending webhooks to 
Airflow.
   
   The deliveries feed (#75159) shows what a webhook received, but a listed 
webhook that never received anything is not in it, and neither is the usual 
reason: a connection that is missing, has the wrong type or no password, or 
names a source type that no installed provider serves or that two providers 
declare. Its sender gets a 404 or a 503 and Airflow records nothing. This adds 
`GET /api/v2/webhooks` (experimental) and a Webhooks tab next to the feed under 
Browse > Webhook Deliveries, listing each webhook the user may read with 
whether `[webhooks] names` lists it, the status of its connection and of its 
source type, and its last delivery.
   
   - `airflow webhooks check` (#75160) and the overview call one function in 
`airflow/webhooks/status.py`, so they never disagree; the command's output and 
exit codes are unchanged. The connection lookup now tells a connection of the 
wrong type from other misconfigurations, and reports the source type a broken 
connection names, so the overview can show both; the webhooks app still logs 
and answers both as a misconfigured connection. A connection that belongs to a 
team shows as `misconfigured`, because webhooks are served only by connections 
without a team.
   - The API returns statuses and the source type's name only, never the rest 
of a connection's extra, its secret or a secrets backend's error, which can 
name hosts and credentials: `airflow webhooks check`, run where the connections 
can be read, gives the reasons. The statuses come from the Core API Server's 
own `[webhooks]` options, providers and secrets backends, and an invalid 
`[webhooks]` configuration is a 500 with a fixed message.
   - It lists the same webhooks as the `~` deliveries feed (#75158), filtered 
with one `filter_authorized_connections` call, so a user who may read none gets 
an empty list rather than a 403. `requires_access_webhook(lists_webhooks=True)` 
leaves the check to the route, as `~` does; the flag is explicit, so a route 
that names no webhook in its path and does not pass it is still checked. Each 
status reads a connection from the secrets backends without a cache, so the 
list is paginated and reads only the page's webhooks.
   - The tab lives at `/webhook_overview`, because any other segment under 
`/webhook_deliveries` names a webhook, and a proxy forwards paths starting with 
`/webhooks` to the webhooks process. The feed's webhook filter becomes a 
multiselect fed by this route, queried only while its pill is shown; a name can 
still be typed into it, for when the list cannot be loaded.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   
   * Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information. Note: commit author/co-author name and email in commits 
become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: 
`{pr_number}.significant.rst`, in 
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
 You can add this file in a follow-up commit after the PR is created so you 
know the PR number.
   


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