Repository navigation
Add 7-day grace period for new Known Build Error issues - #55232
Merged
Merged
Conversation
Newly-opened KBE issues were immediately being marked stale because they had 0 hits (not yet enough time to accumulate any). This adds a grace period so the stale logic skips issues less than 7 days old. Fixes behavior seen in #55215 where the issue was marked stale on the same day it was opened. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the stale-known-build-errors workflow logic to avoid prematurely staling newly-created “Known Build Error” (KBE) issues that haven’t had time to accumulate hit-count data.
Changes:
- Introduces a 7-day grace period (
NEW_ISSUE_GRACE_DAYS) for newly created KBE issues. - Skips applying stale logic (and associated warnings) to KBE issues created within the grace window.
Comment on lines
+60
to
+66
| // Skip issues within the grace period so newly-opened KBEs | ||
| // aren't immediately marked stale before they can accumulate hits. | ||
| const issueAgeDays = (Date.now() - new Date(issue.created_at).getTime()) / MS_PER_DAY; | ||
| if (issueAgeDays < NEW_ISSUE_GRACE_DAYS) { | ||
| console.log(` #${issue.number}: skipping (created ${issueAgeDays.toFixed(1)} days ago, within ${NEW_ISSUE_GRACE_DAYS}-day grace period)`); | ||
| continue; | ||
| } |
Member
Author
There was a problem hiding this comment.
While true, I would rather keep the code simpler over supporting an edge case like this. Won't fix.
lbussell
approved these changes
Jul 10, 2026
lbussell
left a comment
Member
There was a problem hiding this comment.
Copilot's review comment seems accurate - up to you whether you want to fix that or not.
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.
Summary
Adds a grace period to the
stale-known-build-errorsjob in the stale workflow so that newly-opened Known Build Error issues aren't immediately marked stale before they've had time to accumulate any hits.Problem
When a new KBE issue is opened, it naturally has 0 hits in the 1-month count. The stale workflow runs twice daily and would immediately label the issue as stale and post the warning comment — even though the issue was just created and hasn't had a chance to be matched against any builds yet.
This was observed in #55215, where the issue was marked stale on the same day it was opened.
Fix
Skip any issue whose
created_atis less than 7 days ago (NEW_ISSUE_GRACE_DAYS). The resulting timeline for a new KBE with 0 hits:stale+ warning comment