diff --git a/cmd/hiring_send.go b/cmd/hiring_send.go index 05af704..24e0aaa 100644 --- a/cmd/hiring_send.go +++ b/cmd/hiring_send.go @@ -71,8 +71,7 @@ func RunCreateTestRepo(ctx context.Context, candidate string, testRepo string, r target := fmt.Sprintf("%s-%s", candidate, testRepo) creator := repo.NewGithub(githubClient) - - logger.Info("Creating repository...") + logger.Infof("Creating repository %s/%s...", org, target) _, err = creator.CreateRepo(ctx, org, &github.Repository{ Name: github.String(target), Private: github.Bool(true), @@ -84,7 +83,7 @@ func RunCreateTestRepo(ctx context.Context, candidate string, testRepo string, r return errwrap.Wrapf("could not create github repo for candidate: {{err}}", err) } - logger.Info("Adding collaborators to repository...") + logger.Infof("Adding %s as collaborator to %s/%s", candidate, org, target) collaboratorsOpts := []*config.Collaborator{ &config.Collaborator{ Username: candidate, @@ -106,12 +105,16 @@ func RunCreateTestRepo(ctx context.Context, candidate string, testRepo string, r return errwrap.Wrapf("error cloning to repository: {{err}}", err) } + logger.Debugf("Repository %s/%s cloned", org, testRepo) + logger.Info("Changing remote...") remote, err := r.Remote(git.DefaultRemoteName) if err != nil { return errwrap.Wrapf("error changing remote for repository: {{err}}", err) } + logger.Debugf("Remote on %s/%s changed to %s", org, testRepo, git.DefaultRemoteName) + logger.Info("Pushing changes...") remote.Config().URLs = []string{fmt.Sprintf("https://%s@github.com/%s/%s", cfg.GithubTestOrg.Token, org, target)} err = remote.Push(&git.PushOptions{ diff --git a/cmd/repo_create.go b/cmd/repo_create.go index 7590c8f..037bffe 100644 --- a/cmd/repo_create.go +++ b/cmd/repo_create.go @@ -3,6 +3,7 @@ package cmd import ( "context" "errors" + "strconv" "github.com/hellofresh/github-cli/pkg/zappr" @@ -86,6 +87,15 @@ func RunCreateRepo(ctx context.Context, repoName string, opts *CreateRepoOptions return errors.New("please provide an organization") } + logger.Debug("Create options:") + logger.Debugf("\tConfigure PullApprove? %s", strconv.FormatBool(opts.HasPullApprove)) + logger.Debugf("\tConfigure Zappr? %s", strconv.FormatBool(opts.HasZappr)) + logger.Debugf("\tConfigure GitHub teams? %s", strconv.FormatBool(opts.HasTeams)) + logger.Debugf("\tConfigure collaborators? %s", strconv.FormatBool(opts.HasCollaborators)) + logger.Debugf("\tAdd labels to repository? %s", strconv.FormatBool(opts.HasLabels)) + logger.Debugf("\tAdd webhooks to repository? %s", strconv.FormatBool(opts.HasWebhooks)) + logger.Debugf("\tConfigure branch protection? %s", strconv.FormatBool(opts.HasBranchProtections)) + description := opts.Description githubOpts := &repo.GithubRepoOpts{ PullApprove: &repo.PullApproveOpts{ @@ -104,7 +114,7 @@ func RunCreateRepo(ctx context.Context, repoName string, opts *CreateRepoOptions creator := repo.NewGithub(githubClient) - logger.Info("Creating repository...") + logger.Infof("Creating repository %s/%s...", org, repoName) ghRepo, err := creator.CreateRepo(ctx, org, &github.Repository{ Name: github.String(repoName), Description: github.String(description),