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 — dedupe by davidcheung · Pull Request #143 · commitdev/zero

Conversation

@davidcheung

@davidcheung davidcheung commented Jun 1, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

#134

  • Should the created projects be checked into github automatically? (Y/n): y
  • What’s the root of the github org to create repositories in? : github.com/my-org/
  • Github Personal Access Token with access to the above organization : ABCD1234

#127

  • Dedupe based on elimination(passed context and remove by key)

#135

  • creating ~/.zero/credentials.yml
  • reading ~/.zero/credentials.yml
  • writing basic project config to ~/.zero/credentials.yml

Outstanding

  • per module ask for directory name to use [backend/infrastructure/frontned]
  • tests for any the prompts

Sorry, something went wrong.

Uh oh!

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

All reactions
@davidcheung
davidcheung force-pushed the dedupe-and-more branch from e5ade86 to 7e655d1 Compare June 1, 2020 22:53
@bmonkman

bmonkman commented Jun 1, 2020

Copy link
Copy Markdown
Contributor

Based on @cjhawkins 's PR regarding github it seems like we may need to switch around what we ask for here since we need to know if it's a personal repo or organizational, but we can handle that in another PR.

davidcheung and cjhawkins reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

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

@davidcheung
davidcheung requested review from bmonkman and cjhawkins June 1, 2020 23:01
@davidcheung
davidcheung force-pushed the dedupe-and-more branch from ee3049f to fa2ad3e Compare June 1, 2020 23:06
bmonkman
bmonkman reviewed Jun 1, 2020
View reviewed changes
Comment thread internal/config/global_config.go Outdated

var GetCredentialsPath = getCredentialsPath

type Projects map[string]*Project

@bmonkman bmonkman Jun 1, 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.

Is there a reason for these to be pointers to structs instead of just structs?

Sorry, something went wrong.

Uh oh!

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

All reactions

@bmonkman bmonkman Jun 1, 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.

Also can we call this something more specific? Credentials and ProjectCredentials?

Sorry, something went wrong.

Uh oh!

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

davidcheung reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@davidcheung davidcheung Jun 2, 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.

yeah, I need to persist the changes I make to the Project, the map[string]Project doesn't get the updated value otherwise

Sorry, something went wrong.

Uh oh!

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

All reactions

@bmonkman bmonkman Jun 2, 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.

Only because Save is a pointer receiver. It could also be called like config.Save(projects) instead of projects.Save() There are a few things in this PR which look like they are structured in an OOP way which is not how things are typically done in Go.

Sorry, something went wrong.

Uh oh!

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

davidcheung reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
bmonkman
bmonkman reviewed Jun 1, 2020
View reviewed changes
Comment thread internal/context/init.go Resolved

Uh oh!

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

bmonkman
bmonkman reviewed Jun 1, 2020
View reviewed changes
Comment thread internal/context/init.go Resolved

Uh oh!

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

bmonkman
bmonkman reviewed Jun 1, 2020
View reviewed changes
Comment thread internal/config/global_config_test.go
@@ -0,0 +1,103 @@
package config_test

@bmonkman bmonkman Jun 1, 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.

Nice tests!

Sorry, something went wrong.

Uh oh!

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

All reactions
bmonkman
bmonkman reviewed Jun 2, 2020
View reviewed changes
Comment thread internal/config/global_config_test.go
log.Fatal(err)
}
}
func TestReadOrCreateUserCredentialsFile(t *testing.T) {

@bmonkman bmonkman Jun 2, 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.

These should really be testing the API of the package rather than the internals. By calling a function like ReadOrCreateUserCredentialsFile it means that function now has to be exported, and I would think the only exported functions would be LoadUserCredentials and Save

Sorry, something went wrong.

Uh oh!

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

All reactions

@davidcheung davidcheung Jun 2, 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.

Make sense, should I create another file for tests like this under the config package? so I can keep them private and still test them?

Sorry, something went wrong.

Uh oh!

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

All reactions

@bmonkman bmonkman Jun 2, 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.

Maybe, though the general practice is try to make your tests in the _test package, then test the exported stuff and not the internals so that your test is coupled to the "API" which should be stable and not the internals which could change. And if you get to the point where the "API" is masking a massive amount of code, try to split it up into smaller packages which can be easily tested in isolation.

Sorry, something went wrong.

Uh oh!

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

All reactions
@davidcheung
davidcheung force-pushed the dedupe-and-more branch from ddc7c76 to ee91d85 Compare June 2, 2020 20:45
bmonkman
bmonkman approved these changes Jun 2, 2020
View reviewed changes
@davidcheung
zero init features: dedupe/new prompts/config file
2211d53
@davidcheung
davidcheung force-pushed the dedupe-and-more branch from 43b0bbc to 2211d53 Compare June 2, 2020 21:45
@davidcheung
davidcheung merged commit a96e4c0 into master Jun 2, 2020
@davidcheung
davidcheung deleted the dedupe-and-more branch June 2, 2020 21:46
@bmonkman bmonkman mentioned this pull request Jun 2, 2020
Init Command - Prompt user to create repos and check in code #134
Closed
@davidcheung davidcheung mentioned this pull request Jun 2, 2020
Init Command - Pull in modules and load config during the init phase - deduplicate config options for prompting #127
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cjhawkins cjhawkins Awaiting requested review from cjhawkins
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

@davidcheung @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.