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

Include Domain in GRPC UpdateDomainIsolationGroupsRequest #6114

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

natemort
Copy link
Member

@natemort natemort commented Jun 5, 2024

What changed?

  • Correct two minor mapping issues with DomainIsolationGroups (missing Domain and nil being converted to an empty map).
  • Increase coverage of proto/admin.go from 70% -> 99%
  • Increase coverage of proto/shared.go from 88% -> 95%

Why?

  • Increase test coverage

How did you test it?

  • Running unit tests

Potential risks

Release notes

Documentation Changes

return &adminv1.UpdateDomainIsolationGroupsRequest{
Domain: t.Domain,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you change the title to reflect this bug fix?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -1324,7 +1319,7 @@ func ToAdminUpdateDomainIsolationGroupsRequest(t *adminv1.UpdateDomainIsolationG
}

func FromIsolationGroupConfig(in *types.IsolationGroupConfiguration) *apiv1.IsolationGroupConfiguration {
if in == nil {
if in == nil || *in == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Do we need to distinguish between initialized and uninitialized maps? If no, len(in) might be more understandable.

Copy link
Member Author

Choose a reason for hiding this comment

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

The way these tests are structured I'm trying to do an exact round trip.

Currently:

  • in == nil -> nil
  • *in == nil -> empty map
  • len(*in) == 0 -> empty map

New behavior:

  • in == nil -> nil
  • *in == nil -> nil
  • len(*in) == 0 -> empty map

For these specific mappers, since the parameter being passed in is a reference to the field on a request in is never actually nil. It'll just be pointing to a nil value. There are other invocations of this method that could actually be passing in nil though.

Copy link

codecov bot commented Jun 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.88%. Comparing base (6847c33) to head (00c36bf).
Report is 9 commits behind head on master.

Additional details and impacted files
Files Coverage Δ
common/types/mapper/proto/admin.go 99.76% <100.00%> (+30.68%) ⬆️

... and 17 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 6847c33...00c36bf. Read the comment docs.

@coveralls
Copy link

coveralls commented Jun 5, 2024

Pull Request Test Coverage Report for Build 018fea45-352e-4468-9978-57274eb4f684

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 408 unchanged lines in 12 files lost coverage.
  • Overall coverage increased (+0.2%) to 70.994%

Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 2 88.06%
service/history/execution/mutable_state_util.go 2 78.52%
common/membership/hashring.go 2 84.69%
service/matching/tasklist/matcher.go 2 89.35%
common/persistence/statsComputer.go 3 98.21%
bench/lib/client.go 4 0.0%
service/history/task/transfer_standby_task_executor.go 6 86.33%
common/domain/replication_queue.go 18 74.83%
service/history/task/task_util.go 20 70.57%
service/frontend/api/handler.go 92 66.17%
Totals Coverage Status
Change from base Build 018fea0f-14e3-4984-94e0-5d6d068277b1: 0.2%
Covered Lines: 105743
Relevant Lines: 148947

💛 - Coveralls

@natemort natemort changed the title Increase coverage for common/types/mapper/proto Include Domain in GRPC UpdateDomainIsolationGroupsRequest Jun 5, 2024
@natemort natemort merged commit 5aaa258 into cadence-workflow:master Jun 5, 2024
20 checks passed
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.

4 participants