-
Notifications
You must be signed in to change notification settings - Fork 6
UOE-12502: Disable country level filtering for adUnits onboarded in MBMF Phase 1 #1090
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
base: master
Are you sure you want to change the base?
Conversation
@@ -613,8 +613,10 @@ func (m OpenWrap) getMultiFloors(rctx models.RequestCtx, reward *int8, imp openr | |||
return nil | |||
} | |||
|
|||
if !m.pubFeatures.IsMBMFCountry(rctx.DeviceCtx.DerivedCountryCode) { | |||
return nil | |||
if !m.pubFeatures.IsPubIdMBMFPhase1Enabled(rctx.PubID) { |
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.
can we add UT for this ?
glog.Warning("MBMF is not enabled for pubid: %s, country: %s IID = %s", rctx.PubID, rctx.DeviceCtx.DerivedCountryCode, rctx.LoggerImpressionID) | ||
m.metricEngine.RecordMBMFRequests(rctx.PubIDStr, 1) | ||
return nil | ||
} | ||
} | ||
|
||
//if pub entry present with is_enabled=1 AND no pub in mbmf_enabled wrapper_feature-> apply mbmf | ||
//if pub entry present as is_enabled=0 -> don't apply mbmf | ||
if !m.pubFeatures.IsMBMFPublisherEnabled(rctx.PubID) { |
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.
@Pubmatic-Supriya-Patil : Here when pub is not enabled for mbmf, how are we logging it as mbmfrequest?
modules/pubmatic/openwrap/util.go
Outdated
@@ -628,6 +633,7 @@ func (m OpenWrap) getMultiFloors(rctx models.RequestCtx, reward *int8, imp openr | |||
adunitFormat := getAdunitFormat(reward, imp) | |||
//don't apply mbmf if pub is not enabled for adunitFormat | |||
if adunitFormat != "" && !m.pubFeatures.IsMBMFEnabledForAdUnitFormat(rctx.PubID, adunitFormat) { | |||
m.metricEngine.RecordMBMFRequests(rctx.PubIDStr, 3) |
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.
@Pubmatic-Supriya-Patil : move constant numbers to variables. This will make code more readable
return nil | ||
} | ||
m.metricEngine.RecordMBMFRequests(rctx.PubIDStr, 0) | ||
return multifloors | ||
} | ||
//fallback to adunitformat multifloors if adunitlevel floors not present in DB | ||
} | ||
|
||
if adunitFormat != "" { |
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.
@Pubmatic-Supriya-Patil : add comment mentioning, ad unit level MBMF not found. Hence, looking up at adformat level
mockFeature.EXPECT().IsMBMFCountry("IN").Return(false) | ||
mockFeature.EXPECT().IsPubIdMBMFPhase1Enabled(5890).Return(false) |
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.
@Pubmatic-Supriya-Patil : checks are not arranged in logical order. It's not making code readable.
- publevel
- countrylevel
Description
Please add change description or link to ticket, docs, etc.
Checklist:
header-bidding
repo with appropiate commit id.For Prebid upgrade, refer: https://inside.pubmatic.com:8443/confluence/display/Products/Prebid-server+upgrade