feat: migrate teams based on repo list #22
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new command to migrate teams by repository. The primary changes involve adding a new sub command, improving error messages, and adding functions to handle repository and team data.
New Command and Features:
byRepos
Command: Added a new commandbyRepos
to migrate teams based on a repository list. This command sets environment variables, binds them using Viper, and calls theSyncTeamsByRepo
function. (cmd/byRepos.go
)Enhancements and New Functions:
ParseRepositoryFile
function to read and parse a file containing repository URLs and format them toowner/repo
format. (internal/repository/repository.go
)GetRepositoryTeams
function to fetch teams associated with a repository. (internal/api/api.go
,internal/team/team.go
) [1] [2]Error Handling Improvements:
CreateTeam
function to provide more context when a team is not found or already exists. (internal/api/api.go
) [1] [2]Import Adjustments:
internal/repository/repository.go
,pkg/sync/sync.go
) [1] [2]These changes collectively enhance the functionality of the migration tool by enabling team migrations based on repository lists, improving error handling, and adding necessary support functions.