fix(cli): warn once on invalid REPOWISE_FULL_RESCORE_INTERVAL_DAYS across workspace fan-out - #1844
fix(cli): warn once on invalid REPOWISE_FULL_RESCORE_INTERVAL_DAYS across workspace fan-out#1844sloemo01 wants to merge 1 commit into
Conversation
…ross workspace fan-out
|
✅ Health of changed files: 2.6 → 2.9 (+0.3) 📋 At a glance Files & modules (2)
✅ Health gate: passed 📌 Before you merge
🔎 More signals (3)🗺️ Change map flowchart LR
subgraph PR ["Changed in this PR (1 with dependents)"]
f_packages_cli_src_repowise_cli_commands_update_cmd_persistence_py[".../update_cmd/persistence.py 🔥"]:::changed
end
f_packages_cli_src_repowise_cli_commands_init_cmd_command_py[".../init_cmd/command.py"]
f_packages_cli_src_repowise_cli_commands_update_cmd_persistence_py --> f_packages_cli_src_repowise_cli_commands_init_cmd_command_py
f_packages_cli_src_repowise_cli_commands_init_cmd_persistence_py[".../init_cmd/persistence.py"]
f_packages_cli_src_repowise_cli_commands_update_cmd_persistence_py --> f_packages_cli_src_repowise_cli_commands_init_cmd_persistence_py
f_packages_cli_src_repowise_cli_commands_update_cmd___init___py[".../update_cmd/__init__.py"]
f_packages_cli_src_repowise_cli_commands_update_cmd_persistence_py --> f_packages_cli_src_repowise_cli_commands_update_cmd___init___py
f_packages_cli_src_repowise_cli_commands_update_cmd_command_py[".../update_cmd/command.py"]
f_packages_cli_src_repowise_cli_commands_update_cmd_persistence_py --> f_packages_cli_src_repowise_cli_commands_update_cmd_command_py
more(["+1 more dependent"])
PR --> more
w_packages_cli_src_repowise_cli_commands_update_cmd_command_py(["⚠️ .../update_cmd/command.py changed together 14×, not in PR"]):::warn
f_packages_cli_src_repowise_cli_commands_update_cmd_persistence_py -.- w_packages_cli_src_repowise_cli_commands_update_cmd_command_py
w_packages_core_src_repowise_core_pipeline_incremental_py(["⚠️ .../pipeline/incremental.py changed together 13×, not in PR"]):::warn
f_packages_cli_src_repowise_cli_commands_update_cmd_persistence_py -.- w_packages_core_src_repowise_core_pipeline_incremental_py
t_tests_integration_test_cli_py(["✅ tests/integration/test_cli.py"]):::guard
t_tests_integration_test_cli_py -.-> f_packages_cli_src_repowise_cli_commands_update_cmd_persistence_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 (5 direct dependents, from the last indexed snapshot). Dashed: history/tests. 🔥 Hotspots touched (2)
🔗 Hidden coupling (1 file)
👀 Suggested reviewers @RaghavChamadiya 📊 See the full report for this PR |
Ayush7614
left a comment
There was a problem hiding this comment.
Verified: packages/cli/src/repowise/cli/commands/update_cmd/persistence.py:1 adds module guard _FULL_RESCORE_WARNING_SENT so malformed REPOWISE_FULL_RESCORE_INTERVAL_DAYS warns once per invocation via err_console, not once per repo in workspace fan-out (#1371). Tests in test_health_rescore_gate.py verify once-across-many, silence on valid, default unchanged. Clean fix — LGTM.
Summary
Closes #1371. An invalid
REPOWISE_FULL_RESCORE_INTERVAL_DAYSused to be swallowed silently in_full_rescore_interval_days(); the #852 fix (PR #1373, closed unmerged) surfaced it as a warning per repo per trigger, which spams the terminal across a workspace fan-out,repowise watch, and post-commit hook updates.This PR emits the warning at most once per invocation using a module-level guard, then returns the 7-day default. The warning names the variable and the offending value, using the canonical
[yellow]Warning:[/yellow]spelling on stderr.Changes
packages/cli/src/repowise/cli/commands/update_cmd/persistence.py— hoist the once-per-invocation guarantee into a_FULL_RESCORE_WARNING_SENTguard so_full_rescore_interval_days()warns once regardless of how many repos consult it.tests/unit/cli/test_health_rescore_gate.py—TestFullRescoreIntervalWarningOnce: asserts a single warning across a many-repo fan-out, a valid value stays silent, the default is unchanged, and a valid read after an invalid one does not re-arm the guard.Test Plan
pytest tests/unit/cli/test_health_rescore_gate.py— 20 passedpytest tests/unit/cli/— 2193 passed (1 pre-existing macOS-only failure intest_agent_target_baseline.py, reproduced on cleanmain)pytest tests/unit/workspace/test_update.py tests/unit/cli/test_update_e2e.py— 28 passedruff check— clean