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

[persistence/tasks] Simplify task implementations #5812

Merged
merged 6 commits into from
Mar 24, 2024

Conversation

3vilhamster
Copy link
Contributor

@3vilhamster 3vilhamster commented Mar 22, 2024

What changed?
I've refactored common task fields into a struct and embedded it in all task implementations. This allows me to remove a lot of code.

Why?
Remove copypasted code and simplify task implementations.
-567 lines of code

How did you test it?
Unit tests/integration tests

Potential risks

Release notes

Documentation Changes

Copy link

codecov bot commented Mar 22, 2024

Codecov Report

Merging #5812 (db17a06) into master (2f67371) will decrease coverage by 0.11%.
The diff coverage is 85.43%.

Additional details and impacted files
Files Coverage Δ
common/persistence/data_manager_interfaces.go 95.50% <ø> (-2.89%) ⬇️
common/persistence/tasks.go 100.00% <100.00%> (ø)
service/history/execution/timer_sequence.go 88.26% <100.00%> (+0.22%) ⬆️
service/history/execution/mutable_state_builder.go 40.17% <0.00%> (-0.04%) ⬇️
service/history/execution/mutable_state_util.go 71.51% <0.00%> (-0.46%) ⬇️
service/history/engine/engineimpl/historyEngine.go 37.88% <0.00%> (-0.04%) ⬇️
.../history/execution/mutable_state_task_generator.go 67.31% <82.75%> (+1.35%) ⬆️

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f67371...db17a06. Read the comment docs.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 018e6732-3c0d-4572-8c52-d5b388399636

Details

  • 116 of 498 (23.29%) changed or added relevant lines in 8 files are covered.
  • 67 unchanged lines in 11 files lost coverage.
  • Overall coverage decreased (-0.2%) to 65.204%

Changes Missing Coverage Covered Lines Changed/Added Lines %
service/history/execution/mutable_state_builder.go 0 3 0.0%
service/history/execution/mutable_state_util.go 0 3 0.0%
service/history/engine/engineimpl/historyEngine.go 0 4 0.0%
common/persistence/persistence-tests/executionManagerTestForEventsV2.go 0 17 0.0%
common/persistence/persistence-tests/persistenceTestBase.go 0 20 0.0%
common/persistence/persistence-tests/executionManagerTest.go 0 335 0.0%
Files with Coverage Reduction New Missed Lines %
service/history/task/transfer_standby_task_executor.go 2 87.42%
common/persistence/sql/sqlplugin/postgres/task.go 2 73.4%
common/persistence/sql/sqlplugin/postgres/db.go 2 80.0%
common/util.go 2 91.78%
common/task/fifo_task_scheduler.go 3 84.54%
service/history/queue/timer_queue_processor_base.go 3 77.82%
service/history/queue/timer_gate.go 3 95.83%
common/persistence/statsComputer.go 3 95.36%
service/history/task/fetcher.go 4 85.05%
common/persistence/nosql/nosqlplugin/cassandra/workflow_parsing_utils.go 12 86.78%
Totals Coverage Status
Change from base Build 018e65bd-b15a-441a-b795-bc7578fc4a8f: -0.2%
Covered Lines: 95262
Relevant Lines: 146099

💛 - Coveralls

@3vilhamster 3vilhamster merged commit 3498c59 into cadence-workflow:master Mar 24, 2024
20 checks passed
@3vilhamster 3vilhamster deleted the task-refactor branch March 24, 2024 15:55
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