fix(init): --resume skips the interactive questionnaire (#2098) - #2106
Conversation
…#2098) The is_interactive gate never excluded --resume, so a resume on a TTY re-ran the whole questionnaire (banner, scan, mode menu, provider, embedder, style) — indistinguishable from a fresh run, and a user who answered differently resumed under a different provider/style than the pages on disk were written with. Extracted the gate into _interactive_gate() (pure, testable) and added 'and not resume'. The prior run's answers are already on disk (config.yaml), which the non-interactive path reads. A one-line 'Resuming ... reusing its answers' notice replaces the menu so the user can see the run was picked up, not restarted. Tests: 6 gate cases (resume/yes/provider/index-only/non-tty all skip; plain TTY prompts).
|
The gate is right. Pulling it into One line to change before it goes in, the new notice:
Drop that half-sentence and I will merge it. |
|
Still the one sentence, @sloemo01. The if resume:
console.print(
f"[bold]Resuming[/] the previous run in {repo_path} — "
"reusing its answers; pass --yes to skip this notice."
)Replace those two lines with something that only claims what the run does and this merges as it stands: f"[bold]Resuming[/] the previous run in {repo_path}, "
"reusing the answers it already saved to config.yaml."Everything else is right and I am not asking for more. Pulling the predicate out into For your awareness: #2147 arrived on the same issue after this one. Yours is first and yours is tested, so this is the one I want to land. Push the string change and I will merge on green, no further review. |
…2098) Raghav's review: 'pass --yes to skip this notice' is not true of the code — the console.print is unconditional under 'if resume:', so --yes does not skip it. Drop the clause; keep the sentence that makes the silent behaviour change legible.
|
Sorry for being late on this one — the notice string is fixed in 40 gate tests pass (test_init_noninteractive + test_resume_run_mode). Thanks for the precise catch — and for the heads-up on #2147. |
RaghavChamadiya
left a comment
There was a problem hiding this comment.
That is the change, and thanks for turning it around @sloemo01 — sorry it then sat on my side for four days rather than yours. The notice now claims only what the run does. Pulling the predicate into _interactive_gate with the six cases named is the part that will still be paying off in a year: the next flag added to that chain gets a test that says what it does to a resume, instead of an inline and that nobody reads.
What
Fixes #2098.
repowise init --resumeon a TTY re-ran the entire interactive questionnaire — banner, scan, mode menu, provider, embedder, style — indistinguishable from a fresh run, and a user who answered differently resumed under a different provider/style than the pages on disk were written with.Root cause
is_interactiveatinit_cmd/command.py:951never excluded--resume, so the flag had no effect on whether the prompts ran. The prior run's answers were already on disk (config.yaml), which the non-interactive path reads.Changes
_interactive_gate()(pure, testable) and addedand not resume.Tests
Note:
test_plugin_contentis red on main itself (v0.47.0 release bug, unrelated to this PR).