Skip to content

chore: implement phase 4 - #2782

Open
Tofel wants to merge 3 commits into
dx-5122-alerts-assertion-p3from
dx-5122-alerts-assertion-p4
Open

chore: implement phase 4#2782
Tofel wants to merge 3 commits into
dx-5122-alerts-assertion-p3from
dx-5122-alerts-assertion-p4

Conversation

@Tofel

@Tofel Tofel commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Adds per-rule poll timings, the scheduler, and the budget check.

Review focus: schedule.goDeriveTimings, Scheduler, CheckBudget.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

📊 API Diff Results

No changes detected for module github.com/smartcontractkit/chainlink-testing-framework/grafana-alertcheck

View full report

@Tofel
Tofel force-pushed the dx-5122-alerts-assertion-p4 branch 2 times, most recently from 28b0170 to 8e00518 Compare September 1, 2026 14:18
@Tofel
Tofel force-pushed the dx-5122-alerts-assertion-p4 branch 2 times, most recently from e38c815 to 904571c Compare September 2, 2026 09:45
@Tofel
Tofel force-pushed the dx-5122-alerts-assertion-p4 branch from 904571c to 034847e Compare September 4, 2026 15:03
@Tofel
Tofel force-pushed the dx-5122-alerts-assertion-p4 branch from 034847e to ee1286d Compare September 7, 2026 09:35
@Tofel
Tofel marked this pull request as ready for review September 7, 2026 09:36
@Tofel
Tofel requested a review from a team as a code owner September 7, 2026 09:36
Copilot AI lite review requested due to automatic review settings September 7, 2026 09:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

There are correctness and API-surface issues in the new scheduling code/tests (including misleading test expectation output and missing validation/guards) that should be addressed before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Implements “phase 4” scheduling primitives for grafana-alertcheck by deriving per-rule and global timing thresholds, introducing a per-rule scheduler, and adding a schedule feasibility (“budget”) check, with accompanying tests.

Changes:

  • Added schedule.go with DeriveTimings, Scheduler, CheckBudget, and StartupSummary.
  • Moved skewHardLimit from source.go into the new schedule constants block.
  • Added comprehensive unit tests for timing derivation, scheduling behavior, budget checks, and a new resolve form test.
File summaries
File Description
grafana-alertcheck/internal/gate/source.go Moves skewHardLimit out of source.go now that scheduling code exists.
grafana-alertcheck/internal/gate/schedule.go Adds timing derivation, per-rule scheduler, budget check, and startup summary formatting.
grafana-alertcheck/internal/gate/schedule_test.go Adds tests covering timing derivation, scheduler ordering/cadence, budget failure modes, and startup summary warnings.
grafana-alertcheck/internal/gate/resolve_test.go Adds test coverage for resolving the Folder/Title alert name form.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread grafana-alertcheck/internal/gate/schedule.go Outdated
Comment on lines +228 to +240
for _, uid := range uids {
rt, m := t[uid], measured[uid]
utilization += float64(m) / float64(rt.pollEvery)
if t[tightestUID].pollEvery > rt.pollEvery {
tightestUID = uid
}
if m > maxMeasured {
maxMeasured, maxMeasuredUID = m, uid
}
if m > rt.pollEvery {
overCadence = append(overCadence, uid)
}
}
Comment thread grafana-alertcheck/internal/gate/schedule.go
Comment thread grafana-alertcheck/internal/gate/schedule_test.go
@Tofel
Tofel force-pushed the dx-5122-alerts-assertion-p4 branch from ee1286d to c36b86f Compare September 7, 2026 09:46
Add per-rule poll timings, scheduler, and budget check (P4).

- schedule.go: DeriveTimings, Scheduler, CheckBudget (§5)
- Address review: add Folder/Title resolve test, rename
  CheckBudget's minPollEvery to tightestUID
@Tofel
Tofel force-pushed the dx-5122-alerts-assertion-p4 branch from c36b86f to cc2dd22 Compare September 7, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants