Align dataset refresh window with the ISO week it is labelled with - #751
Closed
Groenbech96 wants to merge 1 commit into
Closed
Align dataset refresh window with the ISO week it is labelled with#751Groenbech96 wants to merge 1 commit into
Groenbech96 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns dataset collection windows, branch names, and PR metadata with the ISO week candidates were merged.
Changes:
- Adds reusable ISO-week window calculation.
- Uses bounded merge timestamps during candidate collection.
- Includes year/week labels and merge windows in generated PRs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
scripts/BCBenchUtils.psm1 |
Adds ISO-week window calculation. |
scripts/Collect-And-Screen.ps1 |
Collects PRs within bounded merge dates. |
scripts/New-DatasetPrBody.ps1 |
Adds the merge window to PR bodies. |
.github/workflows/collect-and-screen.yml |
Derives collection metadata from one week window. |
The weekly refresh named its branch/PR after the ISO week the job ran in, but collected a trailing 7-day window ending at the job start time. Those two never describe the same period: the Monday week-30 run opened "week 30" while its contents were week 29 merges (#743 shipped BCApps#9316 / #9313, merged 2026-07-13). The 7-day lookback was correct - those PRs were genuinely inside it - the label was not, so in-window candidates read as stale on review. The trailing window also has fuzzy edges: the bound is date-only and open-ended, so PRs merged between midnight and the job start land in this batch and in the next one. Resolve the window as a full ISO week (Mon 00:00:00Z - Sun 23:59:59Z) via a new Get-IsoWeekWindow helper, default to the last completed week, and derive the branch, PR title and search range from that one window, so "week N" always means "merged during week N". The merge window is also written into the PR body so a candidate's age is explainable at review time. Note: this replaces the since-days dispatch input with weeks-ago. since-days was not wrong, but a trailing N-day window cannot carry an exact week label; Collect-And-Screen.ps1 still accepts -MergedSince/-MergedUntil for arbitrary ranges. Fixes AB#644112 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Groenbech96
force-pushed
the
fix/dataset-refresh-iso-week-window
branch
from
July 27, 2026 07:49
b3b55b9 to
1a331eb
Compare
Groenbech96
marked this pull request as draft
July 27, 2026 07:51
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.
Fixes AB#644112.
What actually went wrong
The week-30 run started
2026-07-20T05:10:48Zwithsince-days: 7, i.e.merged:>=2026-07-13. The candidates it collected were merged07-13T09:25Z(BCApps#9313),07-13T15:52Z(#9316) and07-15T19:22Z(#9404) — all genuinely inside that window. The 7-day lookback was not wrong.What was wrong is the label:
collect-and-screen.ymlnamed the branch and PR after the ISO week the job ran in (week 30), while the window it collected is week 29 (Jul 13–19). So #743 presented week-29 work as week-30 candidates, and by review time an in-window PR read as two weeks stale.Secondary, and real: the trailing window has fuzzy edges. The bound is date-only and open-ended (
>=with no upper bound), measured from a variable job start time — so PRs merged between Monday 00:00 and the job start (05:10) fall into this batch and into next week's.Fix
Make the window and the label the same object instead of two independent notions of "week".
Get-IsoWeekWindowinBCBenchUtils.psm1resolves a full ISO week (Mon00:00:00Z→ Sun23:59:59Z) plus itsYYYY-WWlabel;WeeksAgo = 1is the last completed week.Collect-And-Screen.ps1searches the bounded rangemerged:<since>..<until>instead ofmerged:>=<date>, closing the boundary overlap. Invalid ranges throw.dataset/week-2026-29), PR title and search window from that same window, so "week N" always means "merged during week N".On the removed
since-daysinputsince-dayswas a valid input and behaved as documented; it is replaced byweeks-agoonly because a trailing N-day window cannot carry an exact week label.weeks-ago: 2re-collects an older week, andCollect-And-Screen.ps1 -MergedSince/-MergedUntilstill takes arbitrary ranges. Happy to re-expose an ad-hoc range as a dispatch input if that flexibility is wanted in CI — it would need a window-based branch name rather than a week label.Verification
Get-IsoWeekWindowchecked across year boundaries (2026-01-05 →2025-12-29..2026-01-04; 2027-01-04 → ISO week2026-53).Collect-And-Screen.ps1againstmicrosoft/BCAppswith default, explicit-full-week, partial and invalid windows; search string, summary and week label are correct in each case, and the range query verifiably clips both ends.2026-07-20T00:00:00Z..2026-07-26T23:59:59Z= ISO week 2026-30, disjoint from the week-29 batch.pre-commitclean.