fix(workspace): reconcile listed repos with the configured (postgres) DB

Analysed against b4677f122 files changedby sloemo01
Open PR on GitHub

Change-risk score

8.8out of 10Typical
Repository health
3.9to3.8base 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 52% 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
2
in this diff
Contracts changed
0
removed or signature
Outside callers
0
not in this diff
Findings added
16
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_serverroutersc4graphworkspacecomponen…mcp
changed, health fellchanged, health rosechanged, health heldimports a changed fileuntouchedchanged by this PR

Drawing 3,333 of 3,744 files at a readable size, grouped by directory and sized by lines of code. 2 changed here reach 7 more by import. 411 are too small to see at this width, which is what the frame below is for.

Inside packages/server/src/repowise/server/routers

code_healthgraphbl…c4…chat.pyclaude_md.pycosts.pycoupling.pydead_code.pydecisions…episodes.…external_…feedback.…files.pygit.pyhealth.pyjobs.pyknowledge…mcp.pymeta.pymodules.pyoverview.…owners.pypages.pyproviders.pyrefactoring.…repos.pysearch.pysecurity.pystats.pysymbols.pywebhooks.pyworkspace.pyagg…badge.pybreakdo…coverage_…files_rou…fi…load…overv…perform…refacto…serial…trends…commun…full_graph.pyintelligence.pymodule_graph.pyneighborhoods.py

56 files, 1 changed by this PR and 0 that import one. This PR changes 2 files in total, spread across more than one top-level directory. 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 (16)
  • highlarge method
    packages/server/src/repowise/server/routers/workspace.py:891

    sync_workspace is 145 lines long

  • highcomplex method
    packages/server/src/repowise/server/routers/workspace.py:891

    sync_workspace has cyclomatic complexity 18

  • highcomplex method
    packages/server/src/repowise/server/routers/workspace.py:536

    get_workspace_graph has cyclomatic complexity 17

  • mediumcomplex method
    packages/server/src/repowise/server/routers/workspace.py:391

    get_contracts has cyclomatic complexity 12

  • mediumcomplex method
    packages/server/src/repowise/server/routers/workspace.py:240

    _query_repo_stats_from_db has cyclomatic complexity 12

  • mediumcomplex method
    packages/server/src/repowise/server/routers/workspace.py:195

    _query_repo_stats_from_sqlite has cyclomatic complexity 9

  • mediumcomplex method
    packages/server/src/repowise/server/routers/workspace.py:136

    _query_repo_stats has cyclomatic complexity 13

  • mediumcomplex method
    packages/server/src/repowise/server/routers/workspace.py:65

    _query_top_language has cyclomatic complexity 10

  • lowlarge method
    packages/server/src/repowise/server/routers/workspace.py:536

    get_workspace_graph is 82 lines long

  • lowlarge method
    packages/server/src/repowise/server/routers/workspace.py:391

    get_contracts is 60 lines long

  • lowlarge method
    packages/server/src/repowise/server/routers/workspace.py:240

    _query_repo_stats_from_db is 62 lines long

  • lowerror handling
    packages/server/src/repowise/server/routers/workspace.py:82

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

  • lowerror handling
    packages/server/src/repowise/server/routers/workspace.py:298

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

  • lowerror handling
    packages/server/src/repowise/server/routers/workspace.py:300

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

  • lowerror handling
    packages/server/src/repowise/server/routers/workspace.py:319

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

  • lowerror handling
    packages/server/src/repowise/server/routers/workspace.py:964

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

Resolved (5)
  • function hotspot
    packages/server/src/repowise/server/routers/workspace.py
  • bumpy road
    packages/server/src/repowise/server/routers/workspace.py
  • primitive obsession
    packages/server/src/repowise/server/routers/workspace.py
  • low cohesion
    tests/unit/server/test_workspace_router.py
  • duplicated assertion block
    tests/unit/server/test_workspace_router.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/server/src/repowise/server/routers/workspace.pyRaghav Chamadiya 85% of 16 commits
  • tests/unit/server/test_workspace_router.pyRaghav Chamadiya 88% 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/server/test_workspace_sidebar.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.