Debounce dashboard refresh dispatches in the webhook function

オープン
#172 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

  • #176 @trask による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
github-actions
領域
ci-cd, cloud, devops

調査の方向性

Netlify webhook function、その Netlify Blobs の使用箇所、および既存の hourly cron または scheduled function を特定してください。受け付けたイベントが現在どのように workflows を dispatch しているかを追跡し、そのうえで実装を、提案されている repository-and-PR debounce state と比較してください。イベントが短時間に集中した場合に、静止期間の後に末尾の dispatch が 1 回だけ発生し、同時書き込み中に更新が失われず、hourly backstop が引き続き有効であれば完了です。

索引モデルが issue の本文から書いたものです。

説明

The Netlify webhook dispatches one workflow run per accepted event. Bursty repositories generate far more runs than the dashboard needs, and job-level concurrency then cancels most of them.

Measured on 2026-07-28 against opentelemetry-collector-contrib:

  • GitHub Actions opens a separate check suite per workflow, so one push to a PR produces ~17 check_suite.completed events, hence 17 dispatches.
  • Worst burst observed: 53 dispatches for a single PR in 77 seconds.
  • Across a sample of 1,501 dashboard-eligible events, 82% were check_suite.completed.
  • 81% of completed dashboard runs in the sampled window were cancelled by concurrency.

Every dispatch in a burst produces the same dashboard output, because each run re-reads the full statusCheckRollup. Only the last one carries new information.

Proposal: collapse events per repository + PR number before dispatching.

  • On each accepted webhook, record lastEventAt in a Netlify Blobs entry keyed by ${repository}#${pr_number} instead of dispatching.
  • A scheduled function runs every minute and dispatches once a PR has been quiet for ~45s, then records lastDispatchAt.
  • Flush on lastDispatchAt < lastEventAt rather than a boolean, so a lost update from concurrent writes costs one extra tick instead of a dropped refresh.

Simulated against the real event stream, a 60s trailing debounce on all events removes 66% of dispatches. Leading-edge and check-suite-only variants both scored worse (54% and 52%), so the simplest policy is also the best one.

Trade-off: refresh latency goes from near zero to roughly 45-105 seconds. The hourly cron remains the backstop, and duplicate dispatches stay harmless because the existing concurrency group absorbs them.

主要言語
JavaScript
スター
7
フォーク
23
平均マージ
15時間 46分
マージ済み PR(30日)
41

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

open-telemetry/shared-workflows のほかの issue

open-telemetry/shared-workflows の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。