Add URL validation for organization, repository, and enterprise arguments
External PR from @AakashSuresh2003 (#1464) to add validation that detects when users accidentally provide URLs instead of names for org/repo/enterprise arguments.
This addresses issue #1180 by providing clear, user-friendly error messages when URL patterns are detected.
Changes:
- Added
IsUrl()extension method using .NET'sUri.TryCreate()for robust URL detection - Added validation to all command args classes that accept org/repo/enterprise names
- Validation checks for http/https URLs and provides clear error messages
- Comprehensive test coverage across gei, ado2gh, and shared commands
Key features:
✅ Uses standard .NET Uri.TryCreate() validation (not custom pattern matching)
✅ Only detects proper http/https URLs (no false positives)
✅ Clear error messages explaining expected format
✅ 47 new test cases covering all affected commands
Fixes #1180
All 1019 tests passing ✅
Unit Test Results
1 files 1 suites 10m 25s ⏱️ 1 018 tests 1 018 ✅ 0 💤 0 ❌ 1 019 runs 1 019 ✅ 0 💤 0 ❌
Results for commit 94d4c0a8.
:recycle: This comment has been updated with latest results.
| Package | Line Rate | Branch Rate | Complexity | Health |
|---|---|---|---|---|
| ado2gh | 72% | 71% | 726 | ➖ |
| Octoshift | 83% | 73% | 1766 | ✔ |
| bbs2gh | 83% | 78% | 663 | ✔ |
| gei | 81% | 73% | 608 | ✔ |
| Summary | 81% (7856 / 9735) | 74% (1908 / 2593) | 3763 | ✔ |