Skip to content
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

CLOUDP-75269: Simplify PreRunE and PreRunEOrg #505

Merged
merged 7 commits into from
Oct 20, 2020
Merged

Conversation

andreaangiolillo
Copy link
Collaborator

Proposed changes

Jira ticket: CLOUDP-75269

Checklist

  • I have signed the MongoDB CLA
  • I have added tests that prove my fix is effective or that my feature works
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

Further comments

@andreaangiolillo
Copy link
Collaborator Author

andreaangiolillo commented Oct 19, 2020

@gssbzn I would like to know what you think about this solution 🤔 ❓

internal/cli/global_opts.go Outdated Show resolved Hide resolved
@andreaangiolillo andreaangiolillo marked this pull request as ready for review October 20, 2020 10:40
gssbzn
gssbzn previously approved these changes Oct 20, 2020
Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 massive effort here, just a couple of small nits with the tests for ValidateProjectID and ValidateOrgID

internal/cli/global_opts_test.go Outdated Show resolved Hide resolved
internal/cli/global_opts_test.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one of my previous comments is still not addressed here

gssbzn
gssbzn previously approved these changes Oct 20, 2020
Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for doing this, this was a tech debt item I've long wanted to address

t.Fatalf("PreRunE() unexpected error %v\n", err)
}
})
}

func TestGlobalOpts_PreRunE(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 perfect

Comment on lines 69 to 75
noErrorFunc := func() error {
return nil
}

errorFunc := func() error {
return errors.New("error")
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[non-blocking] you could define each inside the test that uses it but this is not a blocking change

Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@andreaangiolillo andreaangiolillo merged commit 284c9ed into master Oct 20, 2020
@andreaangiolillo andreaangiolillo deleted the CLOUDP-75269 branch October 20, 2020 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants