feat: batch progress + ETA lines during --execute runs#194
Open
seonghobae wants to merge 1 commit into
Open
Conversation
Long batch conversions previously emitted only per-file result lines,
leaving no way to gauge overall completion. After each file finishes,
the CLI now prints a tab-separated progress line:
PROGRESS\t<done>/<total>\t<pct>%\tETA <mm:ss>
The ETA extrapolates from the average per-file wall time so far
(measured with time.monotonic) times the remaining file count. Output
stays consistent with the existing tab-separated CONVERTED/DRY-RUN
style; no progress bars, threads, or new dependencies. Dry runs are
unaffected.
Tests cover the PROGRESS line formatting (counts, percent, mm:ss ETA,
negative clamping), a deterministic workers=1 batch with a patched
monotonic clock, and the absence of PROGRESS output in dry-run mode.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CJRVbDrp1vGYkJgNHMGPpG
Contributor
OpenCode Review Overview
Changed-File Evidence Mapflowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Changed file: media_shrinker.py"]
S1 --> I1["repository behavior"]
I1 --> R1["Review risk: Changed file: media_shrinker.py"]
R1 --> V1["required checks"]
Evidence --> S2["Test: test_media_shrinker.py"]
S2 --> I2["regression suite"]
I2 --> R2["Review risk: Test: test_media_shrinker.py"]
R2 --> V2["targeted test run"]
|
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
During
--executeruns over many files, the CLI printed per-file result lines but gave no sense of overall batch progress. This PR adds a progress line after each completed file:time.monotonic(immune to wall-clock jumps).CONVERTED/DRY-RUNlines and is printed withflush=Trueso it streams live.--executepath.Changes
media_shrinker.py: new_format_progress()helper;_execute_conversions()tracks total/completed/start time and prints a PROGRESS line after each future completes. Docstrings on everything new/touched.tests/test_media_shrinker.py: tests for PROGRESS formatting (counts, percent, mm:ss, minutes > 1, negative-ETA clamping), a deterministicworkers=1three-file batch with a patched monotonic clock asserting exact PROGRESS lines, and a dry-run test asserting no PROGRESS output.Gates
coverage report --include=media_shrinker.py: 100% (581 stmts, 0 missed)interrogate -c pyproject.toml media_shrinker.py: PASSED (100.0%)unittest discover -s tests: 117 tests, no new failures (baseline 5 macOSos.listxattrerrors only)🤖 Generated with Claude Code