Skip to content

Conversation

@AakashSuresh2003
Copy link
Contributor

@AakashSuresh2003 AakashSuresh2003 commented Dec 3, 2025

#1180)

  • Did you write/update appropriate tests
  • Release notes updated (if appropriate)
  • Appropriate logging output
  • Issue linked
  • Docs updated (or issue created)
  • New package licenses are added to ThirdPartyNotices.txt (if applicable)

Copilot AI review requested due to automatic review settings December 3, 2025 20:37
Copilot finished reviewing on behalf of AakashSuresh2003 December 3, 2025 20:44
Copy link
Contributor

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

This pull request adds URL validation to various CLI command arguments to prevent users from accidentally providing full URLs instead of just organization, repository, or enterprise names. The validation catches common URL patterns (http://, https://, www., domain/path) and provides clear, user-friendly error messages guiding users toward the correct format.

Key changes:

  • Implements IsUrl() extension method to detect URL patterns in strings
  • Adds URL validation to command argument classes across GEI, ADO2GH, and shared commands
  • Includes comprehensive unit tests for the validation logic
  • Provides a functional test script to verify validation across all commands

Reviewed changes

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

Show a summary per file
File Description
src/Octoshift/Extensions/StringExtensions.cs Adds IsUrl() method to detect URLs by checking for http://, https://, www., :// patterns, and domain/path combinations
src/gei/Commands/MigrateRepo/MigrateRepoCommandArgs.cs Adds URL validation for github-source-org, github-target-org, source-repo, and target-repo options
src/gei/Commands/MigrateOrg/MigrateOrgCommandArgs.cs Adds URL validation for github-source-org, github-target-org, and github-target-enterprise options
src/gei/Commands/GenerateScript/GenerateScriptCommandArgs.cs Adds URL validation for github-source-org and github-target-org options
src/gei/Commands/MigrateSecretAlerts/MigrateSecretAlertsCommandArgs.cs Adds URL validation for source-org, target-org, source-repo, and target-repo options
src/gei/Commands/MigrateCodeScanningAlerts/MigrateCodeScanningAlertsCommandArgs.cs Adds URL validation for source-org, target-org, source-repo, and target-repo options
src/ado2gh/Commands/MigrateRepo/MigrateRepoCommandArgs.cs Adds URL validation for github-org and github-repo options with new Validate method override
src/ado2gh/Commands/IntegrateBoards/IntegrateBoardsCommandArgs.cs Adds URL validation for github-org and github-repo options with new Validate method override
src/Octoshift/Commands/DownloadLogs/DownloadLogsCommandArgs.cs Adds URL validation for github-org and github-repo options (but error messages don't match GEI CLI option names)
src/Octoshift/Commands/CreateTeam/CreateTeamCommandArgs.cs Adds URL validation for github-org option with new Validate method override
src/Octoshift/Commands/GrantMigratorRole/GrantMigratorRoleCommandArgs.cs Adds URL validation for github-org option
src/Octoshift/Commands/RevokeMigratorRole/RevokeMigratorRoleCommandArgs.cs Adds URL validation for github-org option
src/Octoshift/Commands/GenerateMannequinCsv/GenerateMannequinCsvCommandArgs.cs Adds URL validation for github-org option with new Validate method override
src/Octoshift/Commands/ReclaimMannequin/ReclaimMannequinCommandArgs.cs Adds URL validation for github-org option
src/OctoshiftCLI.Tests/StringExtensionsTests.cs Adds comprehensive test cases for IsUrl() method covering various URL patterns and valid names
src/OctoshiftCLI.Tests/gei/Commands/MigrateRepo/MigrateRepoCommandArgsTests.cs Adds tests for URL validation on all org/repo parameters
src/OctoshiftCLI.Tests/gei/Commands/MigrateOrg/MigrateOrgCommandArgsTests.cs Adds tests for URL validation on org and enterprise parameters
src/OctoshiftCLI.Tests/gei/Commands/GenerateScript/GenerateScriptCommandArgsTests.cs Adds tests for URL validation on org parameters
src/OctoshiftCLI.Tests/gei/Commands/MigrateSecretAlerts/MigrateSecretAlertsCommandArgsTests.cs Adds tests for URL validation on all org/repo parameters
src/OctoshiftCLI.Tests/gei/Commands/MigrateCodeScanningAlerts/MigrateCodeScanningAlertsCommandArgsTests.cs Adds tests for URL validation on all org/repo parameters
src/OctoshiftCLI.Tests/ado2gh/Commands/MigrateRepo/MigrateRepoCommandArgsTests.cs Creates new test file with URL validation tests and valid names test
src/OctoshiftCLI.Tests/ado2gh/Commands/IntegrateBoards/IntegrateBoardsCommandArgsTests.cs Creates new test file with URL validation tests and valid names test
src/OctoshiftCLI.Tests/Octoshift/Commands/DownloadLogs/DownloadLogsCommandArgsTests.cs Creates new test file with URL validation tests and valid names test
src/OctoshiftCLI.Tests/Octoshift/Commands/CreateTeam/CreateTeamCommandArgsTests.cs Creates new test file with URL validation tests and valid names test
src/OctoshiftCLI.Tests/Octoshift/Commands/GrantMigratorRole/GrantMigratorRoleCommandArgsTests.cs Adds URL validation test
src/OctoshiftCLI.Tests/Octoshift/Commands/RevokeMigratorRole/RevokeMigratorRoleCommandArgsTests.cs Adds URL validation test
src/OctoshiftCLI.Tests/Octoshift/Commands/GenerateMannequinCsv/GenerateMannequinCsvCommandArgsTests.cs Creates new test file with URL validation tests and valid names test
src/OctoshiftCLI.Tests/Octoshift/Commands/ReclaimMannequin/ReclaimMannequinCommandArgsTests.cs Adds URL validation test
test-url-validation.sh New functional test script with 28 test cases covering all commands and edge cases (but has issues with tests 20-21)
RELEASENOTES.md Documents the new URL validation feature for end users

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Unit Test Results

    1 files      1 suites   10m 25s ⏱️
1 007 tests 1 007 ✅ 0 💤 0 ❌
1 008 runs  1 008 ✅ 0 💤 0 ❌

Results for commit 56a43b0.

♻️ This comment has been updated with latest results.

Copy link
Contributor

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

Copilot reviewed 29 out of 29 changed files in this pull request and generated 3 comments.

…tory, and enterprise name arguments and remove trailing blank lines from test files
@AakashSuresh2003
Copy link
Contributor Author

Hi @brianaj ,

Could you please review my PR and provide any suggestions?

The functional test screenshot is attached below, and the release notes have been added
Please let me know if there’s anything else needed from my side.

Screenshot 2025-12-04 at 2 48 32 AM

Screenshot 2025-12-04 at 2 49 37 AM

Screenshot 2025-12-04 at 2 50 49 AM

Screenshot 2025-12-04 at 2 51 21 AM

Screenshot 2025-12-04 at 2 51 59 AM

@brianaj
Copy link
Collaborator

brianaj commented Dec 3, 2025

@AakashSuresh2003 I'll see if I can get to this this week. Have some older PRs I need to take a look at first.

@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Code Coverage

Package Line Rate Branch Rate Complexity Health
ado2gh 72% 70% 720
Octoshift 83% 73% 1765
bbs2gh 83% 78% 663
gei 81% 75% 608
Summary 81% (7845 / 9711) 74% (1907 / 2589) 3756

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