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

Fix typo for CorrelatedInvocationsID #588

Merged
merged 3 commits into from
Jul 25, 2024

Conversation

ywmei-brt1
Copy link
Collaborator

This cl make correction to the identifier's CorrelatedInvocationsID field name to make it match the proto. It was CorrelatedInvocationID before.

We need to have CorrelatedInvocationsID in the ToProto method to deduplicate builds that have the same invocation id.

This cl make correction to the identifier's CorrelatedInvocationsID field name to make it match the proto. It was CorrelatedInvocationID before.

We need to have CorrelatedInvocationsID in the ToProto method to deduplicate builds that have the same invocation id.
@ywmei-brt1 ywmei-brt1 self-assigned this Jul 25, 2024
@ywmei-brt1 ywmei-brt1 requested a review from mrahs July 25, 2024 12:47
This cl make correction to the identifier's CorrelatedInvocationsID field name to make it match the proto. It was CorrelatedInvocationID before.

We need to have CorrelatedInvocationsID in the ToProto method to deduplicate builds that have the same invocation id.
@ywmei-brt1 ywmei-brt1 requested a review from mrahs July 25, 2024 16:07
@ywmei-brt1
Copy link
Collaborator Author

I have tested with a re-client chrome build, this sdk change works as expected, and can pass the RBE_correlated_invocations_id value to the rpl log.


// truncateStrings remove one char from the longest str at a time until the
// total length of all the strings is less than limit value.
func truncateStrings(limit int, inputs ...*string) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Curious why you're passing strings by reference here? Strings in Go are backed by slices, which are cheap to copy because the underlying array is shared.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I want to pass m's fields here, and modify them in place (basically modify m in place).

say, if I pass strings here, and the interface is func truncateStrings(limit int, inputs ...string) outputs []string{}

I will end up with very long code on the caller's side. I was keep thinking it over and over for about an hour this morning, didn't find out a better solution than pass in ...*string.

outputs := truncateStrings(32, m.a, m.b, m.c, m.d, m.e)
m.a = outputs[0]
m.b = outputs[1]
m.c = outputs[2]
m.d = outputs[3]
m.e = outputs[4]
return m

if total <= limit {
return
}
for total > limit {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This loop might end up being expensive considering it's executed at least once for every action. I think it's safer to limit this PR to what's needed to satisfy its title and leave this refactor to another one.

This cl make correction to the identifier's CorrelatedInvocationsID field name to make it match the proto. It was CorrelatedInvocationID before.

We need to have CorrelatedInvocationsID in the ToProto method to deduplicate builds that have the same invocation id.
@ywmei-brt1 ywmei-brt1 requested a review from mrahs July 25, 2024 18:24
@ywmei-brt1 ywmei-brt1 merged commit 719a5dd into bazelbuild:master Jul 25, 2024
7 checks passed
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.

2 participants