refactor: extract shared Live+Progress scaffold for tarball helpers (BE-2837)#503
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @mattmillerai.
Found 4 finding(s).
| Severity | Count |
|---|---|
| 🟠 High | 1 |
| 🟡 Medium | 1 |
| 🟢 Low | 2 |
Panel: 6/8 reviewers contributed findings.
Reviewers that did not contribute: kimi-k2.5:adversarial (empty), kimi-k2.5:edge-case (empty)
ELI-5
extract_tarballandcreate_tarballeach hand-built the exact same ~18-lineprogress display — a byte bar, a "current file" line, a two-row table, and a
Livewrapper — before running their own copy loop. This PR moves that sharedscaffolding into one small helper so each function only keeps the parts that are
actually different (its own
filterbody and its label). Same on-screenbehavior; just less duplication.
What changed
_tarball_progress(description, total)@contextmanagerincomfy_cli/utils.py: builds thebarProg/barTask+pathProg/pathTasktwo-row
Table.grid()inside a singleLive(..., refresh_per_second=10)andyields(barProg, barTask, pathProg, pathTask).extract_tarballandcreate_tarballnowwith _tarball_progress(...) as (barProg, barTask, pathProg, pathTask):and supply only their own_filterbody + label string. The
[cyan]styling prefix moved into the helper, so therendered task descriptions are byte-identical to before.
Why
Per BE-2837 (groom finder + adversarial verifier, DOWNGRADE verdict): both
functions duplicated the identical progress scaffold. This is the recommended
minimal shape — a yield-based helper that parametrizes only the differing bits.
Nice-to-have cleanup, not a defect fix.
Behavior
Unchanged. The differing pieces stay in each function:
'r'implicit vs'w:gz')_filtersignature ((tinfo, path)for extract vs(tinfo)for create)and how it computes the next
_sizeextracting tarball...vscreating tarball...)The
show_progress=Falsefast paths,shutil.move, and cleanup logic areuntouched (the helper wraps only the progress-rendering block).
Testing
pytest tests/comfy_cli/test_utils.py— the create→extract round-trip(
TestTarballRoundTrip, which patchescomfy_cli.utils.Live) passes; thehelper still references module-scope
Live, so the patch continues to apply.2455 passed, 36 skipped.ruff format(no changes) +ruff checkclean.Notes / judgment calls
must re-yield the four wired-up handles the differing filters need, so most of
the savings is the eliminated
Table.grid()/Liveboilerplate rather than rawline count. This matches the ticket's "modest, do it as a small helper" scope.
refactor).