Add -v/--verbose flag to repowise export#934
Conversation
repowise-dev#929 made init/update quiet by default via configure_cli_logging(), scoped to just those two commands. This wires the same -v flag into `export`, one command off the remaining-commands list in repowise-dev#930 (picking a single command is called out there as a reasonable scope for one PR; `reindex` was already claimed by another contributor when I picked this up). Adds tests/unit/cli/test_export_cmd.py asserting the flag reaches configure_cli_logging with the right value, both with and without -v. Part of repowise-dev#930 (export command only; other commands on that list are left for follow-up PRs, as the issue suggests).
|
✅ Health: 7.5 (unchanged) 📋 At a glance 🗺️ Change map flowchart LR
subgraph PR ["Changed in this PR (1 with dependents)"]
f_packages_cli_src_repowise_cli_commands_export_cmd_py[".../commands/export_cmd.py 🔥"]:::changed
end
f_packages_cli_src_repowise_cli_main_py[".../cli/main.py"]
f_packages_cli_src_repowise_cli_commands_export_cmd_py --> f_packages_cli_src_repowise_cli_main_py
classDef changed fill:#dbeafe,stroke:#1d4ed8,color:#1e3a5f
classDef warn fill:#fef3c7,stroke:#b45309,color:#78350f
classDef guard fill:#dcfce7,stroke:#15803d,color:#14532d
Solid arrows: code that imports the changed files (1 direct dependent, from the last indexed snapshot). Dashed: history/tests. 🔎 More signals (1)🔥 Hotspot touched (1)
📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-19 16:17 UTC |
There was a problem hiding this comment.
Pull request overview
This PR extends the quiet-by-default CLI logging work from #929 to repowise export by adding a --verbose/-v flag and wiring it into configure_cli_logging(verbose=...), with a unit test ensuring the flag value is passed through.
Changes:
- Add
--verbose/-voption torepowise exportand callconfigure_cli_logging(verbose=verbose)at the start of the command. - Add unit tests asserting
configure_cli_loggingreceivesTruewith-vandFalseby default.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/cli/src/repowise/cli/commands/export_cmd.py | Adds --verbose/-v and configures CLI logging at the start of export. |
| tests/unit/cli/test_export_cmd.py | Adds unit coverage ensuring the verbose flag is forwarded to configure_cli_logging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| def _init_empty_db(repo_path): | ||
| """Create the wiki DB schema, mirroring what `repowise init` would do.""" | ||
| ensure_repowise_dir(repo_path) | ||
| engine = create_engine(get_db_url_for_repo(repo_path)) | ||
| asyncio.run(init_db(engine)) |
|
Closing as a duplicate: @Solaris-star claimed Sorry for the collision. |
Route the verbose-flag test through CliRunner().invoke() instead of .callback() so it actually exercises the Click decorator (repowise-dev#932). Add --verbose/-v to the reindex options table in CLI_REFERENCE.md. Co-authored-by: Narasimha2211 (test shape from repowise-dev#934)
Route the verbose-flag test through CliRunner().invoke() instead of .callback() so it actually exercises the Click decorator (repowise-dev#933). Add --verbose/-v to the export options table in CLI_REFERENCE.md. Co-authored-by: Narasimha2211 (test shape from repowise-dev#934)
Summary
#929 made
init/updatequiet by default viaconfigure_cli_logging(), scoped to just those two commands. This wires the same-vflag intoexport, one command off the remaining-commands list in #930.reindexwas already claimed by another contributor when I picked this up — the issue explicitly calls out that picking a single command is a reasonable scope for one PR ("This is splittable... Picking a single command off this list is a reasonable first contribution").Changes
export_cmd.py: adds--verbose/-v, callsconfigure_cli_logging(verbose=verbose)as the first statement in the command body (matching theupdate_cmdreference call site), following the exact pattern from the issue.tests/unit/cli/test_export_cmd.py: asserts the flag reachesconfigure_cli_loggingwith the right value, both with and without-v.How I tested this
pytest tests/unit/cli/test_export_cmd.py -v— 2 passedpytest tests/unit/cli/— 804 passed (no regressions)ruff check/ruff format --diffon changed files — cleanRelated issue
Part of #930 (export command only; other commands on that list are left for follow-up PRs, per the issue's own suggestion).