Generic webhooks: broken, unused, and not org-scoped. Fix or remove?
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
Start by tracing webhook dispatch in src/app/services/validation.py:175, then inspect the webhook model, CRUD, schemas, /webhooks endpoint, and migrations mentioned in the issue. The issue presents two unresolved options: remove the mechanism or make it org-scoped with a public payload schema; confirm the project’s decision before changing anything. Done means implementing the selected option consistently, including the database migration.
索引モデルが issue の本文から書いたものです。
説明
Context
The generic webhook mechanism (introduced in #367) sends every validated detection to every URL in the webhooks table (src/app/services/validation.py:175). Nothing uses it today:
- Slack notifications go through
organization.slack_hook/slack_client(#478), not this table. - The only row we knew of in prod was a leftover Slack URL from before #478. It never worked and only produced
400 invalid_payloadlog noise. It has been deleted. - Rows can only be added through the admin
/webhooksendpoint. The Python client does not expose it.
Problems if we keep it
- Double-encoded payload.
dispatch_webhookpassesmodel_dump_json()(astr) to httpxjson=, so consumers receive a quoted JSON string instead of an object. #623 fixes this. - No org scoping.
Webhookhas noorganization_idandWebhookCRUD.fetch_all()is global, so every webhook receives every organization's detections. A partner registered here would see other orgs' data. - Raw DB row as payload. We send the
Detectionrow as-is (bucket_key,crop_bucket_key,pose_id, etc.). There is no public schema, so any change to the model silently breaks consumers.
Options
- A. Remove it. Drop the model, endpoint, CRUD, schemas and the dispatch loop, and add a migration to drop
webhooks. Close #623. - B. Make it usable. Merge #623, add
organization_idtoWebhookand filter dispatch by the sequence's org, and send a dedicated public payload schema (alert id, camera, location, azimuth, timestamps, platform URL) instead of the raw row.
- 主要言語
- Python
- スター
- 30
- フォーク
- 15
- 平均マージ
- 4日 15時間
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pyronear/pyro-api のほかの issue
-
Replacing a camera or pose image can delete an image that is still in use対応中かも @Adelagric が 3 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 3 日以内に返信
-
Share an alert with a temporary public link対応中かも @Acruve15 が 3 日前に担当しました。 オープンtype: feat
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
メンテナーはふだん 3 日以内に返信
-
Return the number of alerts per day over a period対応中かも @Majyles が 11 日前に担当しました。 オープンtype: feat
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
pyronear/pyro-api#719 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 3 日以内に返信
-
type: feat
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 3 日以内に返信
-
type: feat
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 3 日以内に返信
pyronear/pyro-api の issue をすべて見る
似ている issue
-
ci-rerun: collect.py fails a whole pr-babysit cycle on one transient GitHub 5xx and never retriesオープンfollow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Built-in QUBO fallback applies bitwise xor to floating binary states対応中かも @iloveeyjafjalla が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
qboson/kaiwu-pytorch-plugin#1702 ·
メンテナーはふだん 3 日以内に返信
-
bug v2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
modelcontextprotocol/python-sdk#3811 ·
メンテナーはふだん 1 日以内に返信
-
cost:cheap practicality:seen-in-the-wild severity:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
メンテナーはふだん 1 日以内に返信