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

Drop pointer for forwarded from fields #3942

Conversation

vytautas-karpavicius
Copy link
Contributor

What changed?
Drop pointer for forwarded from fields within internal types.

Why?
This is one of PRs planned to drop pointers for always required fields in internal types. It will make them more idiomatic and easier to use. These pointer are legacy of Thrift types that were used previously through our codebase. This will also allow safer migration to grpc, as proto primitive types don't have nils by default.

How did you test it?
Passing build and existing tests.

Potential risks

@vytautas-karpavicius vytautas-karpavicius requested a review from a team January 28, 2021 13:37
@coveralls
Copy link

coveralls commented Jan 28, 2021

Coverage Status

Coverage decreased (-0.02%) to 61.513% when pulling a456e3f on vytautas-karpavicius:drop-ptr-forwarded-from into d5a4cbf on uber:master.

ForwardedFrom: t.ForwardedFrom,
ForwardedFrom: &t.ForwardedFrom,
Copy link
Member

Choose a reason for hiding this comment

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

I assume this is all internal, so no concerns about old things that won't send this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this is internal only.

But important thing for this and related PRs is the actual usage of these fields. Most of them are used through Get... wrappers anyway. So the logic does not change as the code using them always receive empty string (even if it was nil originally). Therefore with these changes we only move nil to empty conversion to a different place.

Only in occasions where field is explicitly checked for nil value, we should pay attention, whether some optionality semantics were intended there.

@vytautas-karpavicius vytautas-karpavicius merged commit a9e9451 into cadence-workflow:master Jan 29, 2021
github-actions bot pushed a commit to vytautas-karpavicius/cadence that referenced this pull request Feb 4, 2021
yux0 pushed a commit to yux0/cadence that referenced this pull request May 4, 2021
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.

3 participants