jsweep: use git commit timestamp for deterministic file selection ordering#31335
Closed
jsweep: use git commit timestamp for deterministic file selection ordering#31335
Conversation
Replace filesystem modification timestamp ordering in Priority 2 with git log-based ordering. Files are now selected by their earliest git commit timestamp (via `git log --format="%at" --follow -- <file>`), making the selection order reproducible across CI machines and fresh checkouts. Files never touched by git get timestamp 0 and bubble to the top automatically. Also add a test (GitBasedDeterministicOrdering) to verify the workflow uses git log ordering and no longer references modification timestamps. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update jsweep file selection to use git-based deterministic ordering
jsweep: use git commit timestamp for deterministic file selection ordering
May 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Updates jsweep’s Priority 2 file selection guidance to use Git commit timestamps (instead of filesystem mtime) so selection ordering is deterministic across CI runners and fresh clones, and adds a regression test to enforce the new wording.
Changes:
- Update Priority 2 selection in
jsweep.mdto derive per-file ordering fromgit log --format="%at" ...timestamps (with empty output treated as0). - Add a workflow test asserting the documentation contains the
git log --formatapproach and no longer mentions filesystem modification timestamps.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/jsweep_workflow_test.go |
Adds a test that enforces the new git-based deterministic ordering language in jsweep.md. |
.github/workflows/jsweep.md |
Replaces filesystem mtime ordering with a git-log-based timestamp ordering description for Priority 2 selection. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 1
| - Exclude files already listed in `cleaned_files` in the loaded state | ||
| - **Priority 1**: Pick files with `@ts-nocheck` or `// @ts-nocheck` comments (these need type checking enabled) | ||
| - **Priority 2**: If no uncleaned files with `@ts-nocheck` remain, pick the **one file** with the earliest modification timestamp that hasn't been cleaned | ||
| - **Priority 2**: If no uncleaned files with `@ts-nocheck` remain, determine the last-committed timestamp for each uncleaned file by running `git log --format="%at" --follow -- <file> | head -1` (empty output means the file has never been committed; treat it as timestamp `0`). Sort ascending by that timestamp and pick the **one file** with the earliest git commit timestamp. This ordering is deterministic across CI machines and fresh checkouts, and files never touched by git automatically bubble to the top. |
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.
✨ Enhancement
What does this improve?
jsweep's Priority 2 file selection previously used filesystem
mtime, which is not preserved acrossgit cloneor CI runners — making the pick non-deterministic between machines.Why is this valuable?
0) automatically sort to the frontImplementation approach:
jsweep.md— Replace "earliest modification timestamp" with agit log-based lookup:Sort uncleaned candidate files ascending by this value; pick the lowest.
jsweep_workflow_test.go— AddGitBasedDeterministicOrderingtest (Test 16) assertinggit log --formatis present andearliest modification timestampis absent from the workflow source.