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

security: move logic in security/password.go to security/password #80332

Merged
merged 1 commit into from
Apr 27, 2022

Conversation

ZhouXing19
Copy link
Collaborator

@ZhouXing19 ZhouXing19 commented Apr 21, 2022

This commit is to host the password logic in a separate package,
security/password/.

Release note: None

@ZhouXing19 ZhouXing19 requested a review from knz April 21, 2022 20:40
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

Thanks for the hard work 💯

you also need to move password_test.go. see my comment below.

No release note needed here.

Reviewed 20 of 20 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ZhouXing19)


pkg/security/password_test.go, line 1 at r1 (raw file):

// Copyright 2022 The Cockroach Authors.

This test file should be moved to the new package.

Use package password_test at the top to ensure the dependencies are separate.

@ZhouXing19 ZhouXing19 force-pushed the move-password branch 3 times, most recently from 40619cf to 259ef73 Compare April 21, 2022 21:22
Copy link
Collaborator Author

@ZhouXing19 ZhouXing19 left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @knz)


pkg/security/password_test.go, line 1 at r1 (raw file):

Previously, knz (kena) wrote…

This test file should be moved to the new package.

Use package password_test at the top to ensure the dependencies are separate.

Done.

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ZhouXing19)


-- commits, line 4 at r2:
?


pkg/security/password/password_test.go, line 11 at r2 (raw file):

// licenses/APL.txt.

package password

Are you sure package password_test is not needed? By placing the test file inside the same package, you bring in the settings/cluster dependency to package password.

@ZhouXing19 ZhouXing19 changed the title [WIP]security: move logic in security/password.go to security/password security: move logic in security/password.go to security/password Apr 22, 2022
@ZhouXing19 ZhouXing19 marked this pull request as ready for review April 25, 2022 14:19
@ZhouXing19 ZhouXing19 requested review from a team as code owners April 25, 2022 14:19
@ZhouXing19 ZhouXing19 requested review from a team and knz April 25, 2022 14:19
Copy link
Collaborator Author

@ZhouXing19 ZhouXing19 left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @knz)


-- commits line 4 at r2:

Previously, knz (kena) wrote…

?

Removed.


pkg/security/password/password_test.go line 11 at r2 (raw file):

Previously, knz (kena) wrote…

Are you sure package password_test is not needed? By placing the test file inside the same package, you bring in the settings/cluster dependency to package password.

Added the password_test package.

Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

lgtm!

the failure is from linting:

        pkg/security/password/password.go:94:6: type name will be used as password.PasswordHash by other packages, and that stutters; consider calling this Hash
    --- FAIL: TestLint/TestGolint (58.64s)

I'm not sure I agree with the litner's suggestion. we could add an exception here, which it looks like others have done too:

stream.GrepNot("type name will be used as tracing.TracingMode by other packages, and that stutters; consider calling this Mode"),

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @knz)

Copy link
Collaborator Author

@ZhouXing19 ZhouXing19 left a comment

Choose a reason for hiding this comment

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

Thanks! Added this case in lint_test.go.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @knz)

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewed 8 of 8 files at r3, 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ZhouXing19)

@ZhouXing19
Copy link
Collaborator Author

Thanks!

bors r+

@ZhouXing19
Copy link
Collaborator Author

bors r-

@craig
Copy link
Contributor

craig bot commented Apr 27, 2022

Canceled.

This commit is to host the password logic in a separate package,
`security/password/`.

Release note: None
@ZhouXing19
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Apr 27, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Apr 27, 2022

Build failed:

@ZhouXing19
Copy link
Collaborator Author

I reran the acceptance test and it passed. Looks like it failed a flaky test.

bors r+

@craig craig bot merged commit 0782bef into cockroachdb:master Apr 27, 2022
@craig
Copy link
Contributor

craig bot commented Apr 27, 2022

Build succeeded:

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.

4 participants