-
Notifications
You must be signed in to change notification settings - Fork 749
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
Update Viper #1969
Update Viper #1969
Conversation
endpoint: http://test-bid.ybp.yahoo.com/bid/appnexuspbs | ||
adkerneladn: | ||
usersync_url: https://tag.adkernel.com/syncr?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&r= | ||
blacklisted_apps: ["spamAppID","sketchy-app-id"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values are not important for this test case and have been removed.
usersync_url: https://tag.adkernel.com/syncr?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&r= | ||
usersync: | ||
redirect: | ||
url: http://http://test-bh.ybp.yahoo.com/sync/appnexuspbs?gdpr={{.GDPR}}&euconsent={{.GDPRConsent}}&url=%s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to the new user sync config values.
func cmpNils(t *testing.T, key string, a interface{}) { | ||
t.Helper() | ||
assert.Nilf(t, a, "%s: %t != nil", key, a) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kept with the test pattern. I think we'll want to deprecate this approach in the future, but kept with the pattern for now.
@@ -597,9 +591,6 @@ func TestUnmarshalAdapterExtraInfo(t *testing.T) { | |||
// Assert correctly unmarshaled | |||
assert.NoError(t, err, "invalid endpoint in config should return an error") | |||
|
|||
// Unescape quotes of JSON-formatted string | |||
strings.Replace(cfg.Adapters[string(openrtb_ext.BidderAppnexus)].ExtraAdapterInfo, "\\\"", "\"", -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually performs no operation since it returns the new string which is ignored. Removed. The unescape isn't necessary.
if assert.IsType(t, errortypes.AggregateError{}, err) { | ||
aggErr := err.(errortypes.AggregateError) | ||
assert.ElementsMatch(t, []error{errors.New("The endpoint: ib.adnxs.com/some/endpoint for appnexus is not a valid URL")}, aggErr.Errors) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified the exact error to be sure it's catching the error we expect.
assert.Nil(t, cfg.Adapters["rubicon"].Syncer.SupportCORS) | ||
|
||
assert.Nil(t, cfg.Adapters["brightroll"].Syncer) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensures the proper handling of pointers with nil defaults via BindEnv.
@@ -53,7 +45,7 @@ require ( | |||
github.com/yudai/gojsondiff v0.0.0-20170107030110-7b1b7adf999d | |||
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect | |||
github.com/yudai/pp v2.0.1+incompatible // indirect | |||
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb | |||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 | |||
golang.org/x/text v0.3.6 | |||
gopkg.in/yaml.v2 v2.4.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only updated viper. The rest of the updates are transitive.
@@ -1,135 +1,316 @@ | |||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= | |||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did this trigger so many changes in go.sum? go.mod seems more reasonable since there are roughly the same number of new lines as old lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I'm not sure. They are from the Viper go.sum, but I don't understand why the hashes need to exist. go.sum is kind of a mystery to me. They don't appear in the vendor directory. I suppose it's some kind of security feature or maybe the viper go.sum just needs to be tidied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
… prebid-master * 'master' of https://github.com/prebid/prebid-server: Update Viper (prebid#1969) /cookie_sync Endpoint Rewrite (prebid#1879) New Adapter: IQZone (prebid#1964) Remove old race conidtion tests (prebid#1958) Remove time.Now() as the first parameter of NewRates() (prebid#1953) # Conflicts: # config/config.go # usersync/usersyncers/syncer_test.go
The /cookie_sync Endpoint Rewrite exposed a performance bug in the version of Viper we were using when using BindEnv. This PR updates Viper to the latest version to solve the performance bug, cleans up the config tests related to user syncing, and adds a user syncing environment variable override test.