`repowise uninstall` prints a configured database URL with a backslash on Windows

Open Beginner friendly
#4,347 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #4380 by @Ei-Ayw — closed without merging

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend, cli

Research direction

Start with packages/cli/src/repowise/cli/uninstall/inventory.py at _store_item and trace how Item.path flows through Result.path into JSON and the uninstall table. Run the named test, tests/unit/cli/test_uninstall_cmd.py::test_a_configured_database_is_listed_as_kept_with_a_reason, on Windows. Done means the database locator prints with / in JSON and the table while the SQLite path and kept-row behavior remain intact.

Written by the indexing model from the issue text.

Description

bug good first issue

Summary

Under REPOWISE_DB_URL, uninstall lists the configured database as a kept row. Its locator host:port/database is a URL fragment but is stored as a Path, so on Windows db.example:5432/wiki prints as db.example:5432\wiki.

packages/cli/src/repowise/cli/uninstall/inventory.py:470

        path=Path(locator),

Mechanism

  • _store_item (inventory.py:433-477) builds locator from make_url(raw): host, :port, /database (:460-464).
  • Item.path is typed Path (:66) and as_dict renders str(self.path) (:85); WindowsPath rewrites the /.
  • The same value flows into Result.path: Path (runner.py:41) when _remove_tree reports the row as kept (runner.py:252-259), and into the table (commands/uninstall_cmd.py:118).

Repro

.venv\Scripts\python.exe -m pytest "tests/unit/cli/test_uninstall_cmd.py::test_a_configured_database_is_listed_as_kept_with_a_reason" -q
tests\unit\cli\test_uninstall_cmd.py:592: in test_a_configured_database_is_listed_as_kept_with_a_reason
    assert "db.example:5432/wiki" in rows[0]["path"]
E   AssertionError: assert 'db.example:5432/wiki' in 'db.example:5432\wiki'

Impact

Windows users see a malformed database location, and the suite has a standing red test on Windows.

Done looks like

  • The server locator stays a string on every platform: Item.path and Result.path accept Path | str (or the row carries the locator in its own field), and _store_item drops the Path(...) wrap.
  • JSON and table both print db.example:5432/wiki.
  • Unchanged: the SQLite case (a real file path), redaction of user and password, the row staying blocked and kept.

Tests

test_a_configured_database_is_listed_as_kept_with_a_reason passes on Windows; test_a_real_run_keeps_the_database_and_exits_with_leftovers still passes.

Dominant language
Python
Stars
7.1k
Forks
756
Avg merge
21h 5m
Merged PRs (30d)
797

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from repowise-dev/repowise

All issues in repowise-dev/repowise

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.