Skip to content

🌱 chore: Add unit tests for ws channel shell helpers (shellQuote, shellJoin, currentBranch) - #56

Open
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-ws-channel-shell
Open

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-ws-channel-shell

Conversation

@hivecommons-hive

Copy link
Copy Markdown

Test Improvement

Adds internal/ws/channel_shell_test.go covering shellQuote, shellJoin, and currentBranch in internal/ws/channel.go and internal/ws/shell.go, which had 0% test coverage. shellQuote is the escaping primitive relied on for shell-injection safety when building remote commands (used by channel_data.go and shell.go), so tests assert exact quoting output for edge cases (embedded single quotes, shell metacharacters) and also round-trip escaped output through a real sh to confirm injection safety. currentBranch gets success/error-path tests against a throwaway git repo.

buildExtKubectlURL/buildExtPodmanURL in the same file are already covered by channel_git_test.go; this PR does not touch or duplicate those.

Related Issue

Closes #55


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-sonnet-5 copilot=1.0.88

Covers shellQuote, shellJoin, and currentBranch in internal/ws/channel.go
and shell.go, which previously had 0% test coverage despite being used to
build shell commands sent to local, podman, and remote workspaces.
shellQuote is the escaping primitive relied on for shell-injection safety
(see channel_data.go, shell.go), so its quoting behavior for single quotes
and shell metacharacters is round-tripped through a real shell in addition
to exact-match assertions.

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added the hold label Nov 1, 2026
@hivecommons-hive

Copy link
Copy Markdown
Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 450d31bd-35f8-42e5-8819-81c8dd7486c0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] internal/ws/channel.go shell helpers (shellQuote, shellJoin, currentBranch) have 0% test coverage

0 participants