Repository navigation
fix(alerting): resolve Main CI alerts when the job passes on latest main - #122
Merged
Merged
Conversation
The hourly backstop's targeted re-check only refetched the build where an alert last failed. When a fix lands in a later commit, the passing execution exists only on newer builds — which were never refetched — so alerts stayed open even though the job had been green on main for days. The backstop now also fetches the newest finished main build (tracked via a new latest_finished_main_ci_build() store method, derived from alerting_main_ci_job_states) and reconciles every open alert's job key against it. A newer pass there resolves the alert through the existing order-guarded path, so an older failure still cannot overwrite it. Jobs that no longer run on main (removed or renamed) produce no pass observation, so those alerts deliberately stay open for manual close rather than silently auto-resolving. Co-authored-by: Kimi Code <noreply@moonshot.cn> Signed-off-by: khluu <khluu000@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Main CI alerts were going stale: a job fails, a fix lands on main, the job goes green again — but the alert stays open.
Root cause: the hourly backstop's targeted re-check (
MainCIBackstopHandler) only refetched the build where the alert last failed (open_main_ci_alert_builds). When the fix lands in a later commit, the passing execution exists only on newer builds, which were never refetched. The 2-minute poller can also miss a pass if it finished while the worker was down and the scan window moved past. Either way, no newer pass ever reaches reconciliation, so the alert sits open indefinitely.Change
The backstop now also fetches the newest finished main build and reconciles every open alert's job key against it:
alerting/main_ci.py— newMainCILatestBuildRef+MainCIBackstopStore.latest_finished_main_ci_build(); the handler adds the latest build to its targeted re-check set.alerting/postgres.py/alerting/memory.py— implementlatest_finished_main_ci_build()fromalerting_main_ci_job_states(maxlatest_build_number).Resolution flows through the existing order-guarded path in
commit_main_ci_scan, so an older failure finishing late still cannot overwrite a newer pass, and the sweep still never advances the poller's scan cursor.Deliberate boundary: if a job no longer runs on main at all (removed/renamed — e.g. a deleted model's test job), no pass observation exists, so the alert stays open for manual close rather than silently auto-resolving.
Tests
Three new tests in
alerting/tests/test_main_ci.py:uv run --extra dev pytest: 197 passed.ruff checkclean on touched files; the two mypy errors inanalyzer.py(boto3 stubs) are pre-existing.AI assistance: this change was made with AI assistance (Kimi Code CLI).