Debounce dashboard refresh dispatches in the webhook function

Đang mở
#172 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

  • #176 của @trask — đã đóng, không merge

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
github-actions
Lĩnh vực
ci-cd, cloud, devops

Hướng nghiên cứu

Xác định hàm webhook của Netlify, cách hàm này sử dụng Netlify Blobs và hàm cron hoặc scheduled hiện có chạy theo giờ. Theo dõi cách các sự kiện được chấp nhận hiện dispatch các workflow, sau đó so sánh phần triển khai với trạng thái debounce repository-and-PR được đề xuất. Công việc được hoàn thành khi các sự kiện dồn dập tạo ra một dispatch cuối duy nhất sau khoảng thời gian yên lặng, các bản cập nhật không bị mất trong quá trình ghi đồng thời và hourly backstop vẫn duy trì hiệu quả.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
JavaScript
Star
7
Fork
23
Merge trung bình
15 giờ 46 phút
Pull request đã merge (30 ngày)
41

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của open-telemetry/shared-workflows

Tất cả issue của open-telemetry/shared-workflows

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.