-
Notifications
You must be signed in to change notification settings - Fork 119
Add support for --ghes-api-url
into add-team-to-repo action to support migration to GHE.com
#1400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 adds support for the --target-api-url
parameter to the add-team-to-repo
command to enable migration to GitHub Enterprise Server (GHES) instances rather than just GitHub.com. The change allows users to specify a custom API URL when adding teams to repositories during migrations.
Key changes:
- Added
--target-api-url
parameter to theadd-team-to-repo
command - Updated script generation to include the target API URL parameter when creating team-to-repo assignments
- Modified the underlying GitHub API service method to accept an optional target API URL parameter
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
src/ado2gh/Commands/AddTeamToRepo/AddTeamToRepoCommand.cs | Added --target-api-url option and updated factory call to use the new parameter |
src/ado2gh/Commands/AddTeamToRepo/AddTeamToRepoCommandArgs.cs | Added TargetApiUrl property to command arguments |
src/ado2gh/Commands/AddTeamToRepo/AddTeamToRepoCommandHandler.cs | Updated to pass target API URL to the GitHub API service |
src/ado2gh/Commands/GenerateScript/GenerateScriptCommandHandler.cs | Modified script generation methods to include target API URL in generated commands |
src/Octoshift/Services/GithubApi.cs | Added optional targetApiUrl parameter to AddTeamToRepo method |
src/OctoshiftCLI.Tests/ado2gh/Commands/AddTeamToRepo/AddTeamToRepoCommandTests.cs | Updated test to verify the new option count |
src/OctoshiftCLI.Tests/ado2gh/Commands/AddTeamToRepo/AddTeamToRepoCommandHandlerTests.cs | Updated test to include null parameter in verification |
RELEASENOTES.md | Added release note about the new feature |
Comments suppressed due to low confidence (1)
RELEASENOTES.md:1
- The release note mentions
--ghes-api-url
but the actual parameter name implemented is--target-api-url
. This inconsistency could confuse users.
- Added `--ghes-api-url` as an optional arg to the `add-team-to-repo`
src/OctoshiftCLI.Tests/ado2gh/Commands/AddTeamToRepo/AddTeamToRepoCommandTests.cs
Outdated
Show resolved
Hide resolved
src/OctoshiftCLI.Tests/ado2gh/Commands/AddTeamToRepo/AddTeamToRepoCommandHandlerTests.cs
Outdated
Show resolved
Hide resolved
public virtual async Task AddTeamToRepo(string org, string repo, string teamSlug, string role) | ||
public virtual async Task AddTeamToRepo(string org, string repo, string teamSlug, string role, string targetApiUrl = null) | ||
{ | ||
var url = $"{_apiUrl}/orgs/{org.EscapeDataString()}/teams/{teamSlug.EscapeDataString()}/repos/{org.EscapeDataString()}/{repo.EscapeDataString()}"; |
Copilot
AI
Jul 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The targetApiUrl
parameter is added but never used in the method implementation. The method still uses the instance field _apiUrl
instead of the provided targetApiUrl
parameter.
var url = $"{_apiUrl}/orgs/{org.EscapeDataString()}/teams/{teamSlug.EscapeDataString()}/repos/{org.EscapeDataString()}/{repo.EscapeDataString()}"; | |
var apiUrl = string.IsNullOrEmpty(targetApiUrl) ? _apiUrl : targetApiUrl; | |
var url = $"{apiUrl}/orgs/{org.EscapeDataString()}/teams/{teamSlug.EscapeDataString()}/repos/{org.EscapeDataString()}/{repo.EscapeDataString()}"; |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter removed
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…RepoCommandTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…RepoCommandHandlerTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Unit Test Results 1 files 1 suites 21s ⏱️ Results for commit 21f0264. ♻️ This comment has been updated with latest results. |
@dylan-smith Are the failing tests problem of my code changes or it is technical problem in the integration tests? |
Implements #1398
ThirdPartyNotices.txt
(if applicable)