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

FF-1939 Update to UFC #41

Merged
merged 14 commits into from
Jun 10, 2024
Merged

FF-1939 Update to UFC #41

merged 14 commits into from
Jun 10, 2024

Conversation

rasendubi
Copy link
Collaborator

No description provided.

Instead of copying just selected files/directories, have the full
repository available to tests.
eppoclient/config.go Show resolved Hide resolved
eppoclient/eppoclient_e2e_test.go Show resolved Hide resolved
eppoclient/initclient.go Show resolved Hide resolved
eppoclient/client.go Outdated Show resolved Hide resolved

// Find matching rule
rule, err := findMatchingRule(subjectAttributes, config.Rules)
err = flag.verifyType(variationType)
Copy link
Member

Choose a reason for hiding this comment

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

In swift (and android and python) we had to also handle when the variation type did not match the desired kind. specifically the invalid-value-flag test where an INTEGER variation type is desired but a double is received. does that get handled for you in a way i'm not seeing? maybe valueToAssignmentValue is handling that

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. That's handled in valueToAssignmentValue: https://github.com/Eppo-exp/golang-sdk/pull/41/files/80ac9ea3cf91ce0e12a64b97526135d674f4b16d#diff-05660c7f68f1998db7bb1977133831b136836ad85000bedcf3bd0917aee448f6R89

We can't handle this verification here yet as it depends on which variant is selected

eppoclient/eval.go Outdated Show resolved Hide resolved
eppoclient/ufc.go Outdated Show resolved Hide resolved
return defaultValue, err
}
result, _ := variation.(bool)
return result, err
Copy link
Contributor

Choose a reason for hiding this comment

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

I (vaguely) know that this is a common Go pattern, but given that we return the default value when an error occurs, do we need to return the error here? Is the user ever going to care about what err is?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mostly for debugging. The error might be helpful to understand why default value is returned

Copy link
Member

Choose a reason for hiding this comment

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

Yes in theory we can:

return result, nil

That would show "us" that everything is fine at this point. In practice err should be nil since we handled both causes of non-nil on line 29 and 33

eppoclient/client_test.go Outdated Show resolved Hide resolved
Copy link
Member

@leoromanovsky leoromanovsky left a comment

Choose a reason for hiding this comment

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

changes look great; thank you for making improvements to the code like the change to Duration type and others.

Please consider removing the default TotalShards of 10k before merging if doing so keeps the tests passing.

if !ok {
return expConfig, errors.New("configuration not found in configuration store")
return flag, errors.New("configuration not found in configuration store")
Copy link
Member

Choose a reason for hiding this comment

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

Is flag nil in this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, it's "empty"—all fields are set to default values. (Can't return nil from here as the return type is flagConfiguration not *flagConfiguration.)

eppoclient/eval.go Outdated Show resolved Hide resolved
@rasendubi
Copy link
Collaborator Author

Test case is failing because 123456789.0 is getting serialized as "1.2345679e+08" as discussed in slack.

return defaultValue, err
}
result, _ := variation.(bool)
return result, err
Copy link
Member

Choose a reason for hiding this comment

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

Yes in theory we can:

return result, nil

That would show "us" that everything is fine at this point. In practice err should be nil since we handled both causes of non-nil on line 29 and 33

@leoromanovsky leoromanovsky merged commit e9cfbe4 into main Jun 10, 2024
3 checks passed
@leoromanovsky leoromanovsky deleted the ufc branch June 10, 2024 22:45
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