fix(cli): pass RichProgressCallback to workspace persistence phase - #2158
fix(cli): pass RichProgressCallback to workspace persistence phase#2158Shivang9983 wants to merge 1 commit into
Conversation
|
Thanks @Shivang9983, and thanks for copying the single-repo pattern rather than inventing a second one. The blocker is the # packages/cli/src/repowise/cli/ui/progress.py:179-185
def on_phase_start(self, phase: str, total: int | None) -> None:
label = _PHASE_LABELS.get(phase, f"{phase}…")
if phase in self._tasks:
self._progress.update(self._tasks[phase], total=total, visible=True)
else:
self._tasks[phase] = self._progress.add_task(label, total=total, visible=True, cost=0.0)
That line sits on the main per-repo path in Two ways out. Either build a real One non-blocking nit while you are in there: the new line 476 is a blank line carrying two trailing spaces. Ping me once it draws a real bar and I will take another look. |
|
One more thing while you are rebuilding this, and it is one you already named yourself. On #2063 you said you would "ensure It matters for the same reason the phase announcement does. Persistence runs on its own callback, so any warning it emits is invisible to the run record unless someone moves it across deliberately. The single-repo flow does exactly that, one line after the block you copied: # init_cmd/command.py:1632
run_warnings.extend(persist_callback.warnings)Without it, a workspace repo whose persistence degraded writes a So the persist block wants three things rather than two: a real |
Summary
RichProgressCallbackwith an indeterminate spinner (on_phase_start("persist", None)).persist_resultinworkspace.pyinside atry...finallyblock to guaranteeon_phase_donetriggers cleanly across per-repo loops even if persistence fails.repowise workspace init.Related Issues
Fixes #2063
Test Plan
pip install -e packages/core -e packages/cli.✓ Generated X pages.ruff check packages/cli/src/repowise/cli/commands/init_cmd/workspace.py).pytest).Checklist