Skip to content

feat(catalog): add wslu/wslview, installed only under WSL#99

Merged
CybotTM merged 3 commits into
mainfrom
feat/wslu-wsl-browser
Jul 1, 2026
Merged

feat(catalog): add wslu/wslview, installed only under WSL#99
CybotTM merged 3 commits into
mainfrom
feat/wslu-wsl-browser

Conversation

@CybotTM

@CybotTM CybotTM commented Jul 1, 2026

Copy link
Copy Markdown
Member

What & why

Adds wslu (binary wslview) as a managed tool, so links opened from a WSL box (e.g. xdg-open, Python's webbrowser, MCP servers) go to the Windows default browser instead of a WSLg Linux browser.

wslu is only meaningful under WSL, so it is gated: a new requires_wsl catalog flag hides it from audit/install on non-WSL machines — they are never prompted to install a tool that does nothing there.

Changes

  • catalog/wslu.jsoninstall_method: dedicated_script, binary_name: wslview, requires_wsl: true, skip_upstream: true (apt-managed, no upstream version tracking).
  • scripts/install_wslu.sh — WSL-guarded installer (apt/dnf/pacman/zypper), mirrors the install_docker.sh pattern. It also points the xdg default browser at wslview so links open in Windows — opt out with WSLU_SET_DEFAULT_BROWSER=0 (idempotent, non-fatal, clearly logged).
  • cli_audit/catalog.pyall_tool_definitions() filters out requires_wsl tools when not is_wsl(). Single chokepoint; tools_snapshot.json is gitignored (regenerated per machine), so no second gate is needed.
  • tests/test_wsl_gating.py — gate present-on-WSL / hidden-off-WSL, ordinary tools unaffected, and the wslu entry shape.
  • docs — catalog count 97→98, script count 33→34, CHANGELOG entry.

Reviewer note

The installer changing the xdg default browser is a deliberate convenience (that's wslu's whole purpose) but it is a system-config side effect — happy to drop it or make it opt-in instead of opt-out if you'd prefer.

Verification

  • New tests + full unit suite: 624 passed, 1 skipped.
  • Blocking flake8 (--select=E9,F63,F7,F82): clean.
  • On a real WSL box: wslview detected (3.2.3, method apt); installer runs idempotently; ./scripts/test_smoke.sh passes.

Add a wslu catalog entry (binary wslview) plus a dedicated installer,
gated by a new requires_wsl catalog flag so it is only surfaced, audited,
and installed on WSL. Non-WSL machines are never prompted to install a
tool that has no meaning there.

- catalog/wslu.json: dedicated_script + skip_upstream + requires_wsl
- scripts/install_wslu.sh: apt/dnf/pacman/zypper install, WSL-guarded;
  optionally sets wslview as the xdg default browser so links open in the
  Windows browser (opt out via WSLU_SET_DEFAULT_BROWSER=0)
- cli_audit/catalog.py: filter requires_wsl tools out of
  all_tool_definitions() when not running under WSL
- tests/test_wsl_gating.py: present-on-WSL / hidden-off-WSL + entry shape
- docs: catalog/script counts, CHANGELOG

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Copilot AI review requested due to automatic review settings July 1, 2026 06:46
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.82%. Comparing base (6e65680) to head (9f9a791).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #99      +/-   ##
==========================================
+ Coverage   69.74%   69.82%   +0.07%     
==========================================
  Files          22       22              
  Lines        3345     3347       +2     
==========================================
+ Hits         2333     2337       +4     
+ Misses       1012     1010       -2     
Flag Coverage Δ
unittests 69.82% <100.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds wslu (binary wslview) as a managed catalog tool to ensure URLs opened from within WSL resolve to the Windows default browser, and introduces a requires_wsl catalog gate so the tool is only surfaced on WSL machines.

Changes:

  • Add a new catalog/wslu.json entry plus scripts/install_wslu.sh (package-manager install + optional xdg-settings default-browser wiring, opt-out via WSLU_SET_DEFAULT_BROWSER=0).
  • Implement a requires_wsl filter in ToolCatalog.all_tool_definitions() so WSL-only tools are hidden on non-WSL systems.
  • Add unit tests for WSL gating and update docs/counts (catalog/scripts totals + changelog).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_wsl_gating.py Adds tests verifying WSL-only tools are included/excluded based on is_wsl().
scripts/install_wslu.sh New dedicated installer for wslu/wslview with optional default-browser configuration.
scripts/AGENTS.md Updates script inventory and documents the new wslu installer.
cli_audit/catalog.py Adds the requires_wsl gating logic in the tool-definition load path.
CHANGELOG.md Documents the addition of wslu and the new gating flag + env opt-out.
catalog/wslu.json Introduces the new wslu catalog entry (dedicated script, WSL-gated, skip upstream).
catalog/README.md Updates catalog tool count references (97 → 98).
AGENTS.md Updates repo-level counts (catalog/tools and scripts).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/install_wslu.sh
Comment thread scripts/AGENTS.md
CybotTM added 2 commits July 1, 2026 09:07
uninstall_wslu now mirrors the install guard and no-ops off WSL, so the
script header's 'graceful no-op elsewhere' claim holds for every action.
Points manual non-WSL users at their package manager instead.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
The pattern-target Make section still read '97 cataloged tools'; align it
with the catalog bump in this branch.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@CybotTM CybotTM merged commit 4a15c28 into main Jul 1, 2026
21 checks passed
@CybotTM CybotTM deleted the feat/wslu-wsl-browser branch July 1, 2026 07:09
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