TestRunValidateURL_SuccessPath: test a URL that resolves to a public IP (e.g. https://example.com) or mock DNS; confirms OK output and exit 0
TestValidateURL_EmptyHost: confirms error for URL like https:// (no host)
TestMainSubprocess_InvalidDocMapPath: subprocess test — --doc-map ../../../etc/passwd fails with path traversal error
TestMainSubprocess_InvalidDocMapFile: subprocess test — --doc-map nonexistent.yml fails with workspace resolve error (nonexistent file)
Coverage for cmd/review-bot improves from 44.6% to ≥50%
All existing tests still pass
No new production code changes — tests only
## Why
The `cmd/review-bot` package has 44.6% coverage. Three specific gaps are straightforward to close:
1. `isValidateError(nil, ...)` — the nil-input early-return is untested
2. `runValidateURL` success path — the "OK: ... is safe" output is never exercised in tests
3. `--doc-map` validation in `main()` — subprocess tests for invalid doc-map path (path traversal, nonexistent file)
4. `validateURL` with empty-host URL — the `host == ""` branch
None of these require network access or a real LLM — they exercise local validation logic.
## Acceptance Criteria
- [ ] `TestIsValidateError_Nil`: confirms `isValidateError(nil, &ve)` returns false
- [ ] `TestRunValidateURL_SuccessPath`: test a URL that resolves to a public IP (e.g. `https://example.com`) or mock DNS; confirms OK output and exit 0
- [ ] `TestValidateURL_EmptyHost`: confirms error for URL like `https://` (no host)
- [ ] `TestMainSubprocess_InvalidDocMapPath`: subprocess test — `--doc-map ../../../etc/passwd` fails with path traversal error
- [ ] `TestMainSubprocess_InvalidDocMapFile`: subprocess test — `--doc-map nonexistent.yml` fails with workspace resolve error (nonexistent file)
- [ ] Coverage for `cmd/review-bot` improves from 44.6% to ≥50%
- [ ] All existing tests still pass
- [ ] No new production code changes — tests only
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
The
cmd/review-botpackage has 44.6% coverage. Three specific gaps are straightforward to close:isValidateError(nil, ...)— the nil-input early-return is untestedrunValidateURLsuccess path — the "OK: ... is safe" output is never exercised in tests--doc-mapvalidation inmain()— subprocess tests for invalid doc-map path (path traversal, nonexistent file)validateURLwith empty-host URL — thehost == ""branchNone of these require network access or a real LLM — they exercise local validation logic.
Acceptance Criteria
TestIsValidateError_Nil: confirmsisValidateError(nil, &ve)returns falseTestRunValidateURL_SuccessPath: test a URL that resolves to a public IP (e.g.https://example.com) or mock DNS; confirms OK output and exit 0TestValidateURL_EmptyHost: confirms error for URL likehttps://(no host)TestMainSubprocess_InvalidDocMapPath: subprocess test —--doc-map ../../../etc/passwdfails with path traversal errorTestMainSubprocess_InvalidDocMapFile: subprocess test —--doc-map nonexistent.ymlfails with workspace resolve error (nonexistent file)cmd/review-botimproves from 44.6% to ≥50%