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

storage: make key/value printing explicitly redactable #81495

Merged
merged 1 commit into from
May 24, 2022
Merged

storage: make key/value printing explicitly redactable #81495

merged 1 commit into from
May 24, 2022

Conversation

nerdroychan
Copy link

This commit makes the formatting functions in storage/enginepb
return explicitly redactable strings.

Resolve #70288.

Release note: None

@nerdroychan nerdroychan requested review from a team as code owners May 19, 2022 00:41
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@nerdroychan nerdroychan requested a review from knz May 19, 2022 01:48
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. Where are the unit tests?

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

Copy link
Contributor

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

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

Looks great, would be easy to add a test in mvcc_test.go that basically does

func TestFormatKeyAndValues(t *testing.T) {
// ..usual test setup..
// Test that values and keys are printed with redaction markets.
require.Equal(t, FormatBytesAsKey([]byte("foo")), "‹foo›")
require.Equal(t, FormatBytesAsValue([]byte("foo")), "‹foo›")
}

Reviewed all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @nerdroychan)

Copy link
Author

@nerdroychan nerdroychan left a comment

Choose a reason for hiding this comment

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

Thanks. The unit tests are added to mvcc_test.go.

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

@nerdroychan nerdroychan requested review from itsbilal and knz May 20, 2022 00:19
This commit makes the formatting functions in storage/enginepb
return explicitly redactable strings.

Resolve #70288.

Release note: None
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 r3, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @itsbilal)

Copy link
Contributor

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @nerdroychan)

@nerdroychan
Copy link
Author

bors r=itsbilal,knz

@craig
Copy link
Contributor

craig bot commented May 24, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented May 24, 2022

Build succeeded:

@craig craig bot merged commit 2138d80 into cockroachdb:master May 24, 2022
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.

storage: make key/value printing explicitly redactable
4 participants