3535import release as release_mod
3636import sbom
3737import update_version_next
38- from buildbotapi import BuildBotAPI , Builder
38+ from buildbotapi import STALE_BUILDER_DAYS , BuildBotAPI , Builder
3939from release import ReleaseShelf , Tag , Task , ask_question
4040
4141API_KEY_REGEXP = re .compile (r"(?P<user>\w+):(?P<key>\w+)" )
@@ -352,10 +352,10 @@ def check_sigstore_version(version: str) -> None:
352352
353353
354354def check_buildbots (db : ReleaseShelf ) -> None :
355- async def _check () -> set [Builder ]:
355+ async def _check () -> tuple [ set [Builder ], int ]:
356356 async def _get_builder_status (
357357 buildbot_api : BuildBotAPI , the_builder : Builder
358- ) -> tuple [Builder , bool ]:
358+ ) -> tuple [Builder , bool | None ]:
359359 return the_builder , await buildbot_api .is_builder_failing_currently (
360360 the_builder
361361 )
@@ -378,11 +378,21 @@ async def _get_builder_status(
378378 for the_builder in stable_builders .values ()
379379 ]
380380 )
381- return {the_builder for (the_builder , is_failing ) in builders if is_failing }
381+ stale_count = sum (is_failing is None for _ , is_failing in builders )
382+ return {
383+ the_builder for (the_builder , is_failing ) in builders if is_failing
384+ }, stale_count
385+
386+ failing_builders , stale_count = asyncio .run (_check ())
387+ if stale_count :
388+ print (
389+ f"Ignoring { stale_count } stale builder{ '' if stale_count == 1 else 's' } "
390+ f" (no builds in the last { STALE_BUILDER_DAYS } days)"
391+ )
382392
383- failing_builders = asyncio .run (_check ())
384393 if not failing_builders :
385394 return
395+
386396 print ()
387397 print ("The following buildbots are failing:" )
388398 for builder in failing_builders :
0 commit comments