New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure git user + email is setup #2444

Merged
merged 4 commits into from Dec 7, 2018

Conversation

@jstrachan
Copy link
Member

jstrachan commented Dec 7, 2018

lets refactor and add a reusable function too

jstrachan added some commits Dec 6, 2018

fix: ensure git user + email is setup
lets refactor and add a reusable function too

@jenkins-x-bot jenkins-x-bot requested review from agentgonzo and amuniz Dec 7, 2018

@jenkins-x-bot jenkins-x-bot added the size/M label Dec 7, 2018

@jstrachan

This comment has been minimized.

Copy link
Member

jstrachan commented Dec 7, 2018

/test bdd

// lets validate we have git configured
_, _, err = gits.EnsureUserAndEmailSetup(o.Git())
if err != nil {
return err

This comment has been minimized.

@ccojocar

ccojocar Dec 7, 2018

Member

I think would be nice to wrap this error with a message.

This comment has been minimized.

@jstrachan

jstrachan Dec 7, 2018

Member

all the error conditions are already wrapped inside the EnsureUserAndEmailSetup() function so didn't see any need to wrap again

}
_, _, err = gits.EnsureUserAndEmailSetup(co.Git())
if err != nil {
return err

This comment has been minimized.

@ccojocar

ccojocar Dec 7, 2018

Member

also here

This comment has been minimized.

@jstrachan

jstrachan Dec 7, 2018

Member

ditto to reply in above conversation

// EnsureUserAndEmailSetup returns the user name and email for the gitter
// lazily setting them if they are blank either from the environment variables
// `GIT_AUTHOR_NAME` and `GIT_AUTHOR_EMAIL` or using default values
func EnsureUserAndEmailSetup(gitter Gitter) (string, string, error) {

This comment has been minimized.

@agentgonzo

agentgonzo Dec 7, 2018

Member

would it make more sense to make this a receiver function on Gitter?

This comment has been minimized.

@jstrachan

jstrachan Dec 7, 2018

Member

I don't really have a preference either way really

@agentgonzo

This comment has been minimized.

Copy link
Member

agentgonzo commented Dec 7, 2018

/lgtm

@jstrachan

This comment has been minimized.

Copy link
Member

jstrachan commented Dec 7, 2018

/test bdd

@jenkins-x-bot jenkins-x-bot removed the lgtm label Dec 7, 2018

@jstrachan

This comment has been minimized.

Copy link
Member

jstrachan commented Dec 7, 2018

/test bdd

@agentgonzo

This comment has been minimized.

Copy link
Member

agentgonzo commented Dec 7, 2018

/lgtm

@jenkins-x-bot jenkins-x-bot added the lgtm label Dec 7, 2018

@jenkins-x-bot jenkins-x-bot removed the lgtm label Dec 7, 2018

@jstrachan

This comment has been minimized.

Copy link
Member

jstrachan commented Dec 7, 2018

/test bdd

2 similar comments
@rawlingsj

This comment has been minimized.

Copy link
Member

rawlingsj commented Dec 7, 2018

/test bdd

@jstrachan

This comment has been minimized.

Copy link
Member

jstrachan commented Dec 7, 2018

/test bdd

@rawlingsj

This comment has been minimized.

Copy link
Member

rawlingsj commented Dec 7, 2018

/gtm

@rawlingsj

This comment has been minimized.

Copy link
Member

rawlingsj commented Dec 7, 2018

/lgtm

@pmuir

This comment has been minimized.

Copy link
Member

pmuir commented Dec 7, 2018

/lgtm

@jenkins-x-bot

This comment has been minimized.

Copy link
Contributor

jenkins-x-bot commented Dec 7, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: agentgonzo, ccojocar, pmuir, rawlingsj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [agentgonzo,ccojocar,pmuir,rawlingsj]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

1 similar comment
@jenkins-x-bot

This comment has been minimized.

Copy link
Contributor

jenkins-x-bot commented Dec 7, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: agentgonzo, ccojocar, pmuir, rawlingsj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [agentgonzo,ccojocar,pmuir,rawlingsj]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jenkins-x-bot jenkins-x-bot merged commit 088d0d3 into jenkins-x:master Dec 7, 2018

3 checks passed

Hound No violations found. Woof!
serverless-jenkins succeeded
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment