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 activity id fields #3949

Conversation

vytautas-karpavicius
Copy link
Contributor

@vytautas-karpavicius vytautas-karpavicius commented Feb 1, 2021

What changed?
Drop pointer for activity id 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

@coveralls
Copy link

Coverage Status

Coverage remained the same at 61.545% when pulling ee6a04d on vytautas-karpavicius:drop-ptr-activity-id into b22be7c on uber:master.

@vytautas-karpavicius vytautas-karpavicius requested a review from a team February 1, 2021 14:19
@@ -2431,7 +2431,7 @@ func (s *integrationSuite) TestDecisionTaskFailed() {
return nil, []*types.Decision{{
DecisionType: types.DecisionTypeScheduleActivityTask.Ptr(),
ScheduleActivityTaskDecisionAttributes: &types.ScheduleActivityTaskDecisionAttributes{
ActivityID: common.StringPtr(strconv.Itoa(int(1))),
ActivityID: strconv.Itoa(int(1)),
Copy link
Member

Choose a reason for hiding this comment

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

"1" though obviously minor (same with line 2610)

@@ -86,7 +86,7 @@ func (s *integrationSuite) TestQueryWorkflow_Sticky() {
return nil, []*types.Decision{{
DecisionType: types.DecisionTypeScheduleActivityTask.Ptr(),
ScheduleActivityTaskDecisionAttributes: &types.ScheduleActivityTaskDecisionAttributes{
ActivityID: common.StringPtr(strconv.Itoa(int(1))),
ActivityID: strconv.Itoa(int(1)),
Copy link
Member

Choose a reason for hiding this comment

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

"1" a few times

@@ -82,7 +82,7 @@ func (s *integrationSuite) TestResetWorkflow() {
scheduleActivityCommands = append(scheduleActivityCommands, &types.Decision{
DecisionType: types.DecisionTypeScheduleActivityTask.Ptr(),
ScheduleActivityTaskDecisionAttributes: &types.ScheduleActivityTaskDecisionAttributes{
ActivityID: common.StringPtr(strconv.Itoa(i)),
ActivityID: strconv.Itoa(i),
Copy link
Member

@Groxx Groxx Feb 4, 2021

Choose a reason for hiding this comment

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

"1"... and other files. meh. you get the idea.

truly, I think this is fine to leave unless you're excited about changing them. there are far larger issues with these tests than a sub-optimal string creation, and it's not actually related to this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, fixed all of those.

@vytautas-karpavicius vytautas-karpavicius merged commit 048d40e into cadence-workflow:master Feb 4, 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