Skip to content

fix(cli): warn once on invalid REPOWISE_FULL_RESCORE_INTERVAL_DAYS across workspace fan-out - #1844

Open
sloemo01 wants to merge 1 commit into
repowise-dev:mainfrom
sloemo01:fix/rescore-warning-once
Open

fix(cli): warn once on invalid REPOWISE_FULL_RESCORE_INTERVAL_DAYS across workspace fan-out#1844
sloemo01 wants to merge 1 commit into
repowise-dev:mainfrom
sloemo01:fix/rescore-warning-once

Conversation

@sloemo01

Copy link
Copy Markdown
Contributor

Summary

Closes #1371. An invalid REPOWISE_FULL_RESCORE_INTERVAL_DAYS used 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_SENT guard so _full_rescore_interval_days() warns once regardless of how many repos consult it.
  • tests/unit/cli/test_health_rescore_gate.pyTestFullRescoreIntervalWarningOnce: 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 passed
  • pytest tests/unit/cli/ — 2193 passed (1 pre-existing macOS-only failure in test_agent_target_baseline.py, reproduced on clean main)
  • pytest tests/unit/workspace/test_update.py tests/unit/cli/test_update_e2e.py — 28 passed
  • ruff check — clean

@repowise-bot

repowise-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown

✅ Health of changed files: 2.6 → 2.9 (+0.3)

📋 At a glance
2 hotspots touched · 1 new finding introduced · 3 co-change pairs left out · 2 files with recent fix history.

Files & modules (2)
  • packages (1 file)
    • .../update_cmd/persistence.py
  • tests (1 file)
    • .../cli/test_health_rescore_gate.py

✅ Health gate: passed

📌 Before you merge

  • Run tests/integration/test_cli.py, .../cli/test_module_attribution_repair.py, .../cli/test_update_persist_reliability.py: they import the changed files
  • .../update_cmd/command.py changed together with .../update_cmd/persistence.py in 14 past commits and isn't in this PR
  • .../pipeline/incremental.py changed together with .../update_cmd/persistence.py in 13 past commits and isn't in this PR
  • .../pipeline/persist.py changed together with .../update_cmd/persistence.py in 13 past commits and isn't in this PR
🔎 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
Loading

Solid arrows: code that imports the changed files (5 direct dependents, from the last indexed snapshot). Dashed: history/tests.

🔥 Hotspots touched (2)

  • .../update_cmd/persistence.py: 33 commits/90d, 12 dependents · primary owner: Raghav Chamadiya (88%)
  • .../cli/test_health_rescore_gate.py: 2 commits/90d, 0 dependents · primary owner: Raghav Chamadiya (100%)

🔗 Hidden coupling (1 file)

  • .../update_cmd/persistence.py co-changes with these files (not in this PR):
    • .../update_cmd/command.py (14×, 🟡 notable)
    • .../pipeline/incremental.py (13×, 🟡 notable)
    • .../pipeline/persist.py (13×, 🟡 notable)

👀 Suggested reviewers @RaghavChamadiya


📊 See the full report for this PR
Your repo map with this PR's blast radius lit up, every caller of the contracts it changes, and health before and after. No sign-in. · ⭐ Star Repowise · 📥 Install bot · Silence on a single PR with [skip repowise] in the title · Per-repo toggle on repowise.dev/settings?tab=bot · Updated 2026-08-22 14:07 UTC

@Ayush7614 Ayush7614 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: REPOWISE_FULL_RESCORE_INTERVAL_DAYS warning fires per repo in workspace/watch updates

2 participants