Skip to content

Add missing parameter values for GithubApiFactory create methods#1516

Open
akordowski wants to merge 1 commit intogithub:mainfrom
akordowski:fix/invalid-parameters
Open

Add missing parameter values for GithubApiFactory create methods#1516
akordowski wants to merge 1 commit intogithub:mainfrom
akordowski:fix/invalid-parameters

Conversation

@akordowski
Copy link
Contributor

  • 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)

This PR addresses the issue #1515. It adds missing values for the uploadsUrl parameter.

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 PR fixes a bug where GithubApiFactory.Create() and CreateClientNoSsl() methods were being called with only two parameters instead of the required three. Due to the optional parameters with default values in the interface definitions, the code compiled but incorrectly assigned the Personal Access Token (PAT) to the uploadsUrl parameter instead of the token parameter.

Changes:

  • Fixed parameter ordering in MigrateRepoCommand.cs to include the missing uploadsUrl parameter (passing null)
  • Fixed parameter ordering in WaitForMigrationCommandBase.cs to include the missing uploadsUrl parameter (passing null)
  • Fixed parameter ordering in AbortMigrationCommandBase.cs to include the missing uploadsUrl parameter (passing null)
  • Updated test methods in GithubApiFactoryTests.cs to use the correct three-parameter signature

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/gei/Commands/MigrateRepo/MigrateRepoCommand.cs Fixed both Create() and CreateClientNoSsl() calls to pass null for the uploadsUrl parameter
src/OctoshiftCLI.Tests/Octoshift/Factories/GithubApiFactoryTests.cs Updated three test methods to pass null for the uploadsUrl parameter
src/Octoshift/Commands/WaitForMigration/WaitForMigrationCommandBase.cs Fixed Create() call to pass null for the uploadsUrl parameter
src/Octoshift/Commands/AbortMigration/AbortMigrationCommandBase.cs Fixed Create() call to pass null for the uploadsUrl parameter

@github-actions
Copy link

Unit Test Results

    1 files      1 suites   10m 24s ⏱️
1 030 tests 1 030 ✅ 0 💤 0 ❌
1 031 runs  1 031 ✅ 0 💤 0 ❌

Results for commit 300ec1c.

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
ado2gh 71% 70% 737
bbs2gh 83% 78% 663
gei 81% 73% 608
Octoshift 84% 73% 1810
Summary 81% (7938 / 9823) 73% (1947 / 2649) 3818

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