GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ZER0155 update repo init to detect owner type by cjhawkins · Pull Request #162 · commitdev/zero

Conversation

@cjhawkins

@cjhawkins cjhawkins commented Jun 12, 2020

Copy link
Copy Markdown
Contributor

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cjhawkins
ZER0155 update repo init to detect owner type
7375716
@cjhawkins
cjhawkins requested a review from bmonkman June 12, 2020 20:57
bmonkman
bmonkman reviewed Jun 12, 2020
View reviewed changes
Comment thread internal/vcs/create-git-repos.go Outdated
// takes a list of subdirectories containing modules to create a repository and do initial commit for
func InitializeRepositories(moduleDirs []string, remoteRepository string, organizationName string, githubApiKey string) {
ownerName, repositoryName, pErr := parseRepositoryUrl(repositoryUrl)
if pErr != nil {

@bmonkman bmonkman Jun 12, 2020

Copy link
Copy Markdown
Contributor

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.

Any reason to not just have err and reuse it?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@cjhawkins cjhawkins Jun 12, 2020

Copy link
Copy Markdown
Contributor Author

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.

I like to keep errors scoped as close to the call as possible, but its not really needed here. I can change this to reuse a single err.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cjhawkins
ZERO155 minor error handling cleanup
0eb8ef6
bmonkman
bmonkman reviewed Jun 12, 2020
View reviewed changes
Comment thread internal/vcs/create-git-repos.go Outdated
remoteOrigin := fmt.Sprintf("%s/%s.git", remoteRepository, moduleDir)
commands := []InitialCommands{
remoteOrigin := fmt.Sprintf("[email protected]:%s/%s.git", ownerName, repositoryName)
fmt.Printf("remote origin: %s\n", remoteOrigin)

@bmonkman bmonkman Jun 12, 2020

Copy link
Copy Markdown
Contributor

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.

Probably not necessary to print

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@bmonkman bmonkman Jun 12, 2020

Copy link
Copy Markdown
Contributor

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.

Actually I think all the status prints in this probably aren't very useful to the user. Just one per repo saying we are creating a repo should be enough.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bmonkman
bmonkman reviewed Jun 12, 2020
View reviewed changes
Comment thread internal/vcs/create-git-repos.go Outdated
ownerName := segments[1]
repositoryName := segments[2]

fmt.Printf("found owner %s, repository %s\n", ownerName, repositoryName)

@bmonkman bmonkman Jun 12, 2020

Copy link
Copy Markdown
Contributor

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.

not necessary to print

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bmonkman
bmonkman reviewed Jun 12, 2020
View reviewed changes
Comment thread internal/vcs/create-git-repos.go Outdated
return err
}

fmt.Printf("Repository successfully created for module: %s\n", repositoryName)

@bmonkman bmonkman Jun 12, 2020

Copy link
Copy Markdown
Contributor

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.

Just the above print should be enough

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bmonkman
bmonkman approved these changes Jun 12, 2020
View reviewed changes

@bmonkman bmonkman left a comment

Copy link
Copy Markdown
Contributor

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.

Looks good after removing some of those print statements.
Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cjhawkins reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@cjhawkins
ZERO155 clean up debug output
ec675eb
@cjhawkins
cjhawkins merged commit bec2700 into master Jun 12, 2020
@cjhawkins
cjhawkins deleted the ZERO155-detect-github-owner-type branch June 12, 2020 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@bmonkman bmonkman bmonkman approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@cjhawkins @bmonkman
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.