Skip to content

[quality] ublue-bling shell config injection has no behavior tests #558

Description

@clubanderson

Finding

system_files/shared/usr/bin/ublue-bling manages shell configuration injection for bash, zsh, and fish. It modifies user dotfiles (.bashrc, .zshrc, config.fish) by injecting/removing source blocks.

Key untested logic:

  • Shell detection and config file path resolution ($SHELL → config path)
  • is-bling-installed detection function
  • sed-based block removal (the ### source start / ### source end marker pattern)
  • Fallback removal for single-line source entries
  • Config file creation vs append behavior

Risk: Incorrect sed patterns or edge cases (empty file, missing markers, special characters in paths) could corrupt user shell configs.

Recommendation

  1. Write bats tests for:
    • Shell detection → correct config file path mapping (bash→.bashrc, zsh→.zshrc, fish→config.fish)
    • is-bling-installed returns correct status for installed/not-installed states
    • Block injection creates correct markers
    • Block removal with markers works cleanly
    • Fallback removal (single grep-based line removal)
    • Handles missing config file gracefully
  2. Mock gum confirm by overriding in PATH with a stub
  3. Add to unit-tests.yml workflow

Priority

  • Impact: medium (user dotfile corruption possible but recoverable)
  • Effort: low (straightforward bash function testing)

Filed by quality agent (hold-gated mode)

Common · issue pipeline

  ▶  triage     needs kind/ + area/ then /approve
  ·  discussing —
  ·  queued     —
  ·  claimed    —
  ·  done       —

area: —   priority:
maintainer: set kind/ + area/ labels, then comment /approve
reporter: answer questions; add repro steps if a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    1-triageNew work awaiting human triage.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions