Skip to content

fix: remove hardcoded home paths#4161

Merged
jonpspri merged 2 commits intomainfrom
fix/remove-hardcoded-home-paths
Apr 15, 2026
Merged

fix: remove hardcoded home paths#4161
jonpspri merged 2 commits intomainfrom
fix/remove-hardcoded-home-paths

Conversation

@lucarlig
Copy link
Copy Markdown
Collaborator

🐛 Bug-fix PR

Before opening this PR please:

  1. make lint - passes ruff, mypy, pylint
  2. make test - all unit + integration tests green
  3. make coverage - ≥ 80 %
  4. make docker docker-run-ssl or make podman podman-run-ssl
  5. Update relevant documentation.
  6. Tested with sqlite and postgres + redis.
  7. Manual regression no longer fails. Ensure the UI and /version work correctly.

📌 Summary

Removes machine-specific /home/cmihai paths from checked-in scripts, Makefiles, and docs so the repo works across developer environments. Adds a regression test to prevent reintroducing user-specific home paths.

🔁 Reproduction Steps

No linked issue.

  1. Inspect the repo for /home/cmihai.
  2. Observe hardcoded virtualenv and absolute repo paths in helper scripts and documentation.
  3. Try to reuse those commands on another machine and see them fail or point at the wrong checkout.

🐞 Root Cause

Several checked-in files captured one developer's local home directory and checkout path instead of using portable path discovery, $HOME, VIRTUAL_ENV, or repo-relative links.

💡 Fix Description

  • Replaced hardcoded virtualenv activation in shell scripts with portable lookup order: active VIRTUAL_ENV, repo .venv, then $HOME/.venv/mcpgateway.
  • Changed the RSS search Makefile default venv path to the repo's .venv.
  • Replaced machine-local absolute filesystem links in docs with repo-relative links or neutral placeholders.
  • Added a unit test that fails if the machine-specific home path appears in tracked text files.

🧪 Verification

Check Command Status
Lint suite make lint Not run
Unit tests make test Not run
Coverage ≥ 80 % make coverage Not run
Manual regression no longer fails uv run pytest -q tests/unit/test_no_machine_specific_paths.py; rg -n '/home/cmihai' .; bash -n tests/performance/utils/setup-auth.sh; bash -n mcp-servers/python/mcp-rss-search/test_live.sh Passed

📐 MCP Compliance (if relevant)

  • Matches current MCP spec
  • No breaking change to MCP clients

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • No secrets/credentials committed

📓 Notes

This is intentionally small and surgical. The remaining generic /home/user strings are test fixtures or neutral examples, not machine-specific runtime paths.

The standard detailed-code-review workflow has not been run yet and should happen before marking this draft ready.

Signed-off-by: lucarlig <luca.carlig@ibm.com>
@lucarlig lucarlig force-pushed the fix/remove-hardcoded-home-paths branch from 0b92f84 to b25a03b Compare April 15, 2026 12:55
@lucarlig lucarlig marked this pull request as ready for review April 15, 2026 13:12
@jonpspri jonpspri merged commit 0fc878c into main Apr 15, 2026
43 checks passed
@jonpspri jonpspri deleted the fix/remove-hardcoded-home-paths branch April 15, 2026 14:20
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.

2 participants