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

bugfix: bad dynamicconfig filter/string mapping #6151

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

Groxx
Copy link
Member

@Groxx Groxx commented Jul 2, 2024

This logic desperately needs to be refactored, it's incredibly error-prone :\
We should probably just use enumer's codegen tbh. Or something similar.

Previously String() missed both workflowType and ratelimitKey.
The String() impl is now rewritten so it won't be missed with future additions, and there's a test to check it too.

Comment on lines -34 to +37
if f <= UnknownFilter || f > WorkflowID {
return filters[UnknownFilter]
if f > UnknownFilter && int(f) < len(filters) {
return filters[f]
}
return filters[f]
return filters[UnknownFilter]
Copy link
Member Author

Choose a reason for hiding this comment

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

previously missed both workflowType and ratelimitKey 😢

@coveralls
Copy link

Pull Request Test Coverage Report for Build 019070d4-f837-4f0d-bc9f-a372952d8109

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 56 unchanged lines in 17 files lost coverage.
  • Overall coverage decreased (-0.03%) to 71.494%

Files with Coverage Reduction New Missed Lines %
service/history/queue/timer_queue_processor_base.go 1 77.66%
common/task/weighted_round_robin_task_scheduler.go 2 88.56%
service/matching/tasklist/db.go 2 73.23%
common/peerprovider/ringpopprovider/config.go 2 81.58%
common/persistence/sql/sqlplugin/mysql/task.go 2 73.68%
tools/cli/admin_db_decode_thrift.go 2 70.51%
service/matching/tasklist/matcher.go 2 90.91%
common/persistence/sql/sqlplugin/mysql/db.go 2 79.49%
service/history/task/transfer_standby_task_executor.go 3 87.45%
service/history/task/task.go 3 84.81%
Totals Coverage Status
Change from base Build 0190705f-c927-4d1b-b54d-772b615f64e2: -0.03%
Covered Lines: 105277
Relevant Lines: 147252

💛 - Coveralls

@Groxx Groxx merged commit ca824a0 into cadence-workflow:master Jul 2, 2024
19 checks passed
@Groxx Groxx deleted the filter-fix branch July 2, 2024 17:01
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