fix(cli): prevent stale file_page rows from surviving repowise update (#1744)

Analysed against b3fa5b844 files changedby kunnalsinngh14
Open PR on GitHub

Change-risk score

8.6out of 10Typical
Repository health
1.8to2.1base against this head

This change sits in the middle third of this repository's own risk distribution, so it is about as risky as the work around it. It is riskier than 47% of this repository's own commits.

No changed file lost health in this diff. Nothing outside this PR depends on a contract it changed.

Files changed
4
in this diff
Contracts changed
0
removed or signature
Outside callers
0
not in this diff
Findings added
7
5 resolved

Blast radius on the repo map

Every file in the repository, grouped into its own directories and sized by lines. The ones this PR changes are lit, and everything that imports them is marked.

packagestestsapi-clientclicoreserveruivscodewebunitsrcsrc/repowis…src/repowise/coresrc/repowise/server__tests__srcsrcwebviewsrccligenerationhealthingestionpersiste…servertest_pro…workspaceagent_targe…commandsanalysisgenerationingestionworkspacemcp_serverroutersc4graphworkspacecompone…mcp
changed, health fellchanged, health rosechanged, health heldimports a changed fileuntouchedchanged by this PR

Drawing 3,329 of 3,734 files at a readable size, grouped by directory and sized by lines of code. 4 changed here reach 9 more by import. 405 are too small to see at this width, which is what the frame below is for.

Inside packages

api-clientclicoreserveruivscodewebsrcsrc/repowise/clisrc/repowise/coresrc/repowise/server__tests__srcsrcagent_targetscommandsanalysisgenerationingestionpersistencepipelineprovidersworkspacemcp_serverroutershealthappcomponentsaugment_…dead_codehealthlanguagesresolverscrudtool_an…kg_cu…pars…pa…pe…_an…tool_hea…to…rep…do…do…gra…comm…ext…vo…CHAN…

2,463 files, 3 changed by this PR and 9 that import one. Click any directory above to frame it instead.

Changed

What this PR added, and what it took away

Introduced findings are the ones inside the lines this PR added, not the file's existing ones. The resolved column is the only place in the product that lists them.

Introduced (7)
  • highnested complexity
    packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py:443

    _load_stale_structural_file_paths nests 5 levels deep

  • mediumcomplex method
    packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py:443

    _load_stale_structural_file_paths has cyclomatic complexity 11

  • mediumnested complexity
    packages/core/src/repowise/core/workspace/update.py:253

    check_repo_staleness nests 4 levels deep

  • lowlarge method
    tests/unit/cli/test_update_stale_reconciliation.py:15

    _setup_repo_with_pages is 61 lines long

  • lowerror handling
    packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py:476

    broad `except Exception` catches unrelated errors and can hide bugs

  • lowerror handling
    packages/core/src/repowise/core/workspace/update.py:280

    caught exception is swallowed without any handling

  • lowerror handling
    packages/core/src/repowise/core/workspace/update.py:280

    broad `except Exception` catches unrelated errors and can hide bugs

Resolved (5)
  • function hotspot
    packages/cli/src/repowise/cli/commands/update_cmd/command.py
  • function hotspot
    packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py
  • io in loop
    packages/cli/src/repowise/cli/commands/update_cmd/deterministic.py
  • function hotspot
    packages/core/src/repowise/core/workspace/update.py
  • io in loop
    packages/core/src/repowise/core/workspace/update.py

Who else knows this code

The primary author of each changed file by share of its recent commits, mined from git history. Advisory: it says who has context, not who must review.

  • packages/core/src/repowise/core/workspace/update.pyRaghav Chamadiya 94% of 26 commits
  • packages/cli/src/repowise/cli/commands/update_cmd/command.pyRaghav Chamadiya 88% of 54 commits
  • packages/cli/src/repowise/cli/commands/update_cmd/deterministic.pyRaghav Chamadiya 84% of 10 commits

Tests that cover this change

Test files that import a file this PR changes. Not a coverage measurement: it is the import graph, so it says which tests are worth running, not which lines they reach.

  • tests/unit/cli/test_update_lock.py
  • tests/unit/cli/test_update_pending_cleanup.py
  • tests/unit/workspace/test_extraction_walk_budget.py
  • tests/integration/test_cli.py
  • tests/unit/cli/test_docs_pointer.py
  • tests/unit/cli/test_editor_setup.py
  • tests/unit/cli/test_deterministic_update.py
  • tests/unit/persistence/test_page_tree_wiring.py

1 changed file has no test importing it.

Get this on your own pull requests

This page came from an index of repowise-dev/repowise. No model calls, no configuration, and it refreshes on every push. Install the bot and every pull request gets one of these.