Skip to content

feat: add vortix report bug report command#37

Merged
Harry-kp merged 3 commits into
mainfrom
feat/report-command
Feb 16, 2026
Merged

feat: add vortix report bug report command#37
Harry-kp merged 3 commits into
mainfrom
feat/report-command

Conversation

@Harry-kp
Copy link
Copy Markdown
Owner

Summary

  • Adds a new vortix report CLI command that collects safe system diagnostics and helps users file GitHub issues with pre-filled environment info
  • Auto-detects: version, install method (brew/cargo/source/binary), OS, terminal, shell, runtime dependencies (curl, wg, openvpn, etc.) with paths and versions, config state, kill switch state
  • Privacy-by-design: never touches IPs, server endpoints, profile names, credentials, DNS servers, or log contents
  • Three submission options: open browser with pre-filled issue URL, copy to clipboard, or print Markdown to stdout
  • SSH-aware: hides browser option when running over SSH
  • Redesigns the bug report issue template to match the auto-generated report sections
  • 10 unit tests covering version parsing, URL construction, and body formatting

UX Flow

$ vortix report

Collecting system information...

Bug Report Preview
==================

  Vortix:       0.1.4 (cargo install)
  OS:           macOS 15.6 (Darwin 24.6.0) (aarch64)
  Terminal:     xterm-256color (120x40)
  Shell:        /bin/zsh
  Running as:   user

  Dependencies:
    curl         /usr/bin/curl (8.7.1)
    wg-quick     /opt/homebrew/bin/wg-quick
    wg           /opt/homebrew/bin/wg (1.0.20250521)
    openvpn      /opt/homebrew/sbin/openvpn (2.6.19)
    pfctl        /sbin/pfctl

  Config:
    Directory:   ~/.config/vortix (default)
    config.toml: not found (using defaults)
    Profiles:    6 (2 WireGuard, 4 OpenVPN)
    Kill switch: off

Describe the issue (press Enter on an empty line to finish):
> ...

  [o] Open in browser (pre-filled GitHub issue)
  [c] Copy to clipboard
  [p] Print report
  [q] Cancel

New Dependencies

  • open = "5" -- cross-platform browser opening (used by starship, bat)
  • urlencoding = "2" -- URL percent-encoding for GitHub issue body

Test plan

  • cargo build -- clean
  • cargo clippy -- no warnings
  • cargo test cli::report -- 10/10 pass
  • Smoke test: echo "q" | cargo run -- report -- preview renders correctly
  • Smoke test: echo "p" | cargo run -- report -- Markdown output is well-formed
  • Manual test: press o to verify browser opens with pre-filled issue
  • Manual test: press c to verify clipboard works
  • Test on Linux (iptables/nft detection, xclip fallback)

Copilot AI review requested due to automatic review settings February 12, 2026 21:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new vortix report CLI subcommand to generate a privacy-oriented bug report, preview it interactively, and help users submit it via browser/clipboard/stdout, alongside updating the GitHub bug issue template to match the generated sections.

Changes:

  • Introduces vortix report command flow (data collection, preview, issue body formatting, submit options).
  • Adds constants + dependencies for GitHub URL construction (open, urlencoding) and URL length limiting.
  • Updates .github/ISSUE_TEMPLATE/bug_report.md to align with the auto-generated report sections.

Reviewed changes

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

Show a summary per file
File Description
src/constants.rs Adds GitHub repo URL + issue URL length limit constants used by the report command.
src/cli/report.rs Implements diagnostics collection, report formatting, URL construction, clipboard/browser submission, and unit tests.
src/cli/mod.rs Exposes the new report module.
src/cli/commands.rs Wires the Report subcommand into CLI dispatch.
src/cli/args.rs Adds the Report subcommand to the CLI enum.
Cargo.toml Adds open and urlencoding dependencies for report submission.
Cargo.lock Locks new transitive dependencies from open/urlencoding.
.github/ISSUE_TEMPLATE/bug_report.md Restructures the bug report template to match the generated Markdown sections.

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

Comment thread src/cli/report.rs Outdated
Comment thread src/cli/report.rs Outdated
Comment thread src/cli/report.rs
Comment thread src/constants.rs Outdated
Comment thread src/cli/report.rs Outdated
Comment thread src/cli/report.rs
Add a CLI command that collects safe system diagnostics (version, OS,
terminal, shell, runtime dependencies, config state, kill switch) and
lets users file a pre-filled GitHub issue via browser, clipboard, or
printed Markdown output.

Privacy-by-design: never collects IPs, server endpoints, profile names,
credentials, DNS servers, or log contents. Users review everything
before any action is taken.

- New `src/cli/report.rs` module with collection, formatting, and
  submission logic (~420 lines, 10 unit tests)
- Adds `open` and `urlencoding` dependencies for browser/URL handling
- Redesigns `.github/ISSUE_TEMPLATE/bug_report.md` to align with the
  auto-generated report sections
- Extract count_profiles into shared pub(crate) helper in commands.rs
  to eliminate duplication with report.rs
- Fix read_user_description prompt ordering: print indent before each
  read, not after
- Refactor detect_install_method: extract install_method_from_path()
  for meaningful unit testing
- Use env!("CARGO_PKG_REPOSITORY") for GITHUB_REPO_URL to stay in sync
  with Cargo.toml metadata
- Fix build_github_url truncation: binary search on raw body length to
  avoid splitting percent-encoding sequences
- Redact home directory prefix with ~ in config_dir for privacy
- Fix clippy warnings (match_same_arms, uninlined_format_args)
@Harry-kp Harry-kp force-pushed the feat/report-command branch from 58e2058 to e30af78 Compare February 16, 2026 20:07
- Add `vortix report` to Usage section
- Add Nix flakes installation instructions (run + install)
- Add Nix to sudo PATH "not affected" list
- Add `nix develop` to Development section
@Harry-kp Harry-kp merged commit ff36afe into main Feb 16, 2026
18 checks passed
@Harry-kp Harry-kp deleted the feat/report-command branch February 16, 2026 20:11
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