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

Refactor/adding mutable state builder tests iv #5769

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
eb3b02d
Adds MSB tests
davidporter-id-au Mar 6, 2024
addd9da
feedback
davidporter-id-au Mar 7, 2024
fe62c70
Merge branch 'master' into refactor/adding-mutable-state-builder-tests-i
davidporter-id-au Mar 7, 2024
5eedf7d
Merge branch 'master' into refactor/adding-mutable-state-builder-tests-i
davidporter-id-au Mar 7, 2024
2e142e5
Merge branch 'master' into refactor/adding-mutable-state-builder-tests-i
davidporter-id-au Mar 7, 2024
c38a2f0
Merge branch 'refactor/adding-mutable-state-builder-tests-i' of githu…
davidporter-id-au Mar 7, 2024
559dcec
WIP
davidporter-id-au Mar 8, 2024
f1eb341
Merge branch 'master' into refactor/adding-mutable-state-builder-tests-i
davidporter-id-au Mar 9, 2024
4445b3d
Passing
davidporter-id-au Mar 9, 2024
953cac8
History assertion complete
davidporter-id-au Mar 9, 2024
1824b9a
Made a little less janky
davidporter-id-au Mar 9, 2024
8ec6e5e
imports
davidporter-id-au Mar 9, 2024
f52b479
fmt
davidporter-id-au Mar 9, 2024
dfd64ee
No need to add deps right now
davidporter-id-au Mar 9, 2024
d20bb57
Merge branch 'master' into refactor/adding-mutable-state-builder-test…
davidporter-id-au Mar 9, 2024
38c8643
fucking timezones
davidporter-id-au Mar 10, 2024
a69c3bf
WIP
davidporter-id-au Mar 10, 2024
06006bb
merge
davidporter-id-au Mar 10, 2024
d621f97
Adds tests
davidporter-id-au Mar 11, 2024
eed9520
Whoops, missed file
davidporter-id-au Mar 11, 2024
f31fd10
fmt
davidporter-id-au Mar 11, 2024
7eb07a2
Merge branch 'master' into refactor/adding-mutable-state-builder-test…
davidporter-id-au Mar 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions service/history/execution/mutable_state_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ func NewMutableStateBuilderWithVersionHistoriesWithEventV2(
return msBuilder
}

// todo (david.porter)
func (e *mutableStateBuilder) CopyToPersistence() *persistence.WorkflowMutableState {
state := &persistence.WorkflowMutableState{}

Expand Down Expand Up @@ -4811,24 +4812,30 @@ func (e *mutableStateBuilder) unixNanoToTime(
}

func (e *mutableStateBuilder) logInfo(msg string, tags ...tag.Tag) {
tags = append(tags, tag.WorkflowID(e.executionInfo.WorkflowID))
tags = append(tags, tag.WorkflowRunID(e.executionInfo.RunID))
tags = append(tags, tag.WorkflowDomainID(e.executionInfo.DomainID))
e.logger.Info(msg, tags...)
if e != nil && e.executionInfo != nil {
Copy link
Member

Choose a reason for hiding this comment

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

do we need these nil checks? If so let's check for nilness and terminate early.

if e == nil || e.executionInfo == nil {
  return
}

// log with tags

Copy link
Member

Choose a reason for hiding this comment

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

ops approved with comment but didn't notice auto merge is enabled :)

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, sorry about that, let me address in a follow up

Copy link
Member Author

Choose a reason for hiding this comment

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

tags = append(tags, tag.WorkflowID(e.executionInfo.WorkflowID))
tags = append(tags, tag.WorkflowRunID(e.executionInfo.RunID))
tags = append(tags, tag.WorkflowDomainID(e.executionInfo.DomainID))
e.logger.Info(msg, tags...)
}
}

func (e *mutableStateBuilder) logWarn(msg string, tags ...tag.Tag) {
tags = append(tags, tag.WorkflowID(e.executionInfo.WorkflowID))
tags = append(tags, tag.WorkflowRunID(e.executionInfo.RunID))
tags = append(tags, tag.WorkflowDomainID(e.executionInfo.DomainID))
e.logger.Warn(msg, tags...)
if e != nil && e.executionInfo != nil {
tags = append(tags, tag.WorkflowID(e.executionInfo.WorkflowID))
tags = append(tags, tag.WorkflowRunID(e.executionInfo.RunID))
tags = append(tags, tag.WorkflowDomainID(e.executionInfo.DomainID))
e.logger.Warn(msg, tags...)
}
}

func (e *mutableStateBuilder) logError(msg string, tags ...tag.Tag) {
tags = append(tags, tag.WorkflowID(e.executionInfo.WorkflowID))
tags = append(tags, tag.WorkflowRunID(e.executionInfo.RunID))
tags = append(tags, tag.WorkflowDomainID(e.executionInfo.DomainID))
e.logger.Error(msg, tags...)
if e != nil && e.executionInfo != nil {
tags = append(tags, tag.WorkflowID(e.executionInfo.WorkflowID))
tags = append(tags, tag.WorkflowRunID(e.executionInfo.RunID))
tags = append(tags, tag.WorkflowDomainID(e.executionInfo.DomainID))
e.logger.Error(msg, tags...)
}
}

func (e *mutableStateBuilder) logDataInconsistency() {
Expand Down
Loading
Loading