Skip to content

refactor: extract shared Live+Progress scaffold for tarball helpers (BE-2837)#503

Merged
bigcat88 merged 1 commit into
mainfrom
matt/be-2837-tarball-progress-scaffold
Jul 10, 2026
Merged

refactor: extract shared Live+Progress scaffold for tarball helpers (BE-2837)#503
bigcat88 merged 1 commit into
mainfrom
matt/be-2837-tarball-progress-scaffold

Conversation

@mattmillerai

Copy link
Copy Markdown
Collaborator

ELI-5

extract_tarball and create_tarball each hand-built the exact same ~18-line
progress display — a byte bar, a "current file" line, a two-row table, and a
Live wrapper — before running their own copy loop. This PR moves that shared
scaffolding into one small helper so each function only keeps the parts that are
actually different (its own filter body and its label). Same on-screen
behavior; just less duplication.

What changed

  • New _tarball_progress(description, total) @contextmanager in
    comfy_cli/utils.py: builds the barProg/barTask + pathProg/pathTask
    two-row Table.grid() inside a single Live(..., refresh_per_second=10) and
    yields (barProg, barTask, pathProg, pathTask).
  • extract_tarball and create_tarball now with _tarball_progress(...) as (barProg, barTask, pathProg, pathTask): and supply only their own _filter
    body + label string. The [cyan] styling prefix moved into the helper, so the
    rendered 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:

  • tar open mode ('r' implicit vs 'w:gz')
  • the _filter signature ((tinfo, path) for extract vs (tinfo) for create)
    and how it computes the next _size
  • the label (extracting tarball... vs creating tarball...)
    The show_progress=False fast paths, shutil.move, and cleanup logic are
    untouched (the helper wraps only the progress-rendering block).

Testing

  • pytest tests/comfy_cli/test_utils.py — the create→extract round-trip
    (TestTarballRoundTrip, which patches comfy_cli.utils.Live) passes; the
    helper still references module-scope Live, so the patch continues to apply.
  • Full suite: 2455 passed, 36 skipped.
  • ruff format (no changes) + ruff check clean.

Notes / judgment calls

  • Net line delta is small (+42/-34) — expected for this ticket: a shared helper
    must re-yield the four wired-up handles the differing filters need, so most of
    the savings is the eliminated Table.grid()/Live boilerplate rather than raw
    line count. This matches the ticket's "modest, do it as a small helper" scope.
  • No capability-denial / dead-end paths added (falsification clause N/A — pure
    refactor).

@mattmillerai mattmillerai added the agent-coded PR authored by the agent-work loop label Jul 10, 2026
@mattmillerai mattmillerai marked this pull request as ready for review July 10, 2026 04:50
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c8220156-04cb-4eb6-b12b-dcd41b5babe3

📥 Commits

Reviewing files that changed from the base of the PR and between 91fbfd9 and 4b1c1fa.

📒 Files selected for processing (1)
  • comfy_cli/utils.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch matt/be-2837-tarball-progress-scaffold
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch matt/be-2837-tarball-progress-scaffold

Comment @coderabbitai help to get the list of available commands.

@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jul 10, 2026
@mattmillerai mattmillerai added the cursor-review Request Cursor bot review label Jul 10, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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)

Comment thread comfy_cli/utils.py
Comment thread comfy_cli/utils.py
Comment thread comfy_cli/utils.py
Comment thread comfy_cli/utils.py
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 10, 2026
@bigcat88 bigcat88 merged commit d274ae5 into main Jul 10, 2026
32 checks passed
@bigcat88 bigcat88 deleted the matt/be-2837-tarball-progress-scaffold branch July 10, 2026 10:03
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

agent-coded PR authored by the agent-work loop cursor-review Request Cursor bot review lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants