Skip to content

Commit

Permalink
fix initial PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rwerikson committed May 2, 2024
1 parent 6286ec4 commit d82b912
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
6 changes: 3 additions & 3 deletions cmd/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ import (
func configurePlatform(cmd *cobra.Command) {
flags := cmd.Flags()

flags.StringP("base-url", "g", "", "Base URL of the target platform, needs to be changed for GitHub enterprise, a self-hosted GitLab instance, Gitea or Azure DevOps.")
flags.StringP("base-url", "g", "", "Base URL of the target platform, needs to be changed for GitHub enterprise, a self-hosted GitLab instance, Gitea, BitBucket or Azure DevOps.")
flags.BoolP("insecure", "", false, "Insecure controls whether a client verifies the server certificate chain and host name. Used only for Bitbucket server.")
flags.StringP("username", "u", "", "The Bitbucket server username.")
flags.StringP("token", "T", "", "The personal access token for the targeting platform. Can also be set using the GITHUB_TOKEN/GITLAB_TOKEN/GITEA_TOKEN/BITBUCKET_SERVER_TOKEN/AZURE_DEVOPS_TOKEN environment variable.")

flags.StringSliceP("org", "O", nil, "The name of a GitHub organization. All repositories in that organization will be used.")
flags.StringSliceP("group", "G", nil, "The name of a GitLab organization. All repositories in that group will be used.")
flags.StringSliceP("user", "U", nil, "The name of a user. All repositories owned by that user will be used.")
flags.StringSliceP("repo", "R", nil, "The name, including owner of a GitHub repository in the format \"ownerName/repoName\". If using Azure Devops, this should be the name of the projects and repositories containing the repos to modify in the format \"my-project/my-repo\".")
flags.StringSliceP("repo", "R", nil, "The repository name, including owner/group/project of the repository in the format \"ownerName/repoName\".")
flags.StringP("repo-search", "", "", "Use a repository search to find repositories to target (GitHub only). Forks are NOT included by default, use `fork:true` to include them. See the GitHub documentation for full syntax: https://docs.github.com/en/search-github/searching-on-github/searching-for-repositories.")
flags.StringP("code-search", "", "", "Use a code search to find a set of repositories to target (GitHub only). Repeated results from a given repository will be ignored, forks are NOT included by default (use `fork:true` to include them). See the GitHub documentation for full syntax: https://docs.github.com/en/search-github/searching-on-github/searching-code.")
flags.StringSliceP("topic", "", nil, "The topic of a GitHub/GitLab/Gitea repository. All repositories having at least one matching topic are targeted.")
Expand Down Expand Up @@ -86,7 +86,7 @@ func configureRunPlatform(cmd *cobra.Command, prCreating bool) {
}
flags.BoolP("fork", "", false, forkDesc)

forkOwnerDesc := "If set, make the fork to the defined value. Default behavior is for the fork to be on the logged in user. In Azure DevOps, this is the name of the project you want to fork into."
forkOwnerDesc := "If set, make the fork to the defined value (owner/project/group). Default behavior is for the fork to be on the logged in user."
if !prCreating {
forkOwnerDesc = "If set, use forks from the defined value instead of the logged in user. In Azure DevOps, this is the name of the project you want to fork into."
}
Expand Down
9 changes: 0 additions & 9 deletions internal/scm/azuredevops/azuredevops.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/microsoft/azure-devops-go-api/azuredevops/v7/git"
"github.com/microsoft/azure-devops-go-api/azuredevops/v7/identity"
"github.com/microsoft/azure-devops-go-api/azuredevops/v7/location"
"github.com/pkg/errors"
)

type AzureDevOps struct {
Expand Down Expand Up @@ -40,14 +39,6 @@ type RepositoryReference struct {

// New creates a new AzureDevOps client
func New(pat, baseURL string, sshAuth bool, fork bool, repoListing RepositoryListing) (*AzureDevOps, error) {
if strings.TrimSpace(pat) == "" {
return nil, errors.New("Personal Access Token is empty")
}

if strings.TrimSpace(baseURL) == "" {
return nil, errors.New("base url is empty")
}

// Declare the connection variable
connection := azuredevops.NewPatConnection(baseURL, pat)
gitClient, err := git.NewClient(context.Background(), connection)
Expand Down

0 comments on commit d82b912

Please sign in to comment.