Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
New Adapter: Insticator #3806
New Adapter: Insticator #3806
Changes from 17 commits
dcdddfa
56feaa0
db6d2c3
b751ff9
92e859a
24d9b39
1f43978
c5b5e24
4dfb854
713599c
c776f19
4650191
e3b07a8
f31772e
5e78df8
ff2df10
fdcdc59
d8f3ca3
f0d12f0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 will unmarshal the
imp.ext
of the current imp and update thesite
/app
object's publisher ID to match. It will repeat this process for every imp in the request. It would be much more efficient to remove this step from the loop, and just execute this for the lastimp
in the list, as it will have the same result and only consume1/len(Imp)
as many cycles.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.
Yes, I know. I was doing the same previously but someone previously asked to update it.
#3806 (comment)
@hhhjort
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.
You're missing some test coverage here. I suggest the following:
.device.ua
,.device.ipv6
and.device.ip
are set.device
is not nil but.device.ua
,device.ipv6
and.device.ip
are of zero length.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 have added a new
adapters/insticator/insticatortest/supplemental/device-validation.json
and added device object in one or two old files too.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.
Please add a supplemental JSON test where your mock response returns a 204 status code.
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.
added adapters/insticator/insticatortest/supplemental/204.json
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.
Please add a supplemental JSON test where your mock response returns a bid response that cannot be successuflly unmarshalled. This can be accomplished by making one of the fields the wrong type.
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.
added adapters/insticator/insticatortest/supplemental/response-unmarshal-fail.json
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.
It may make sense to return the publisher ID here, since you unmarshal the
imp.ext
here. This would save you from unmarshalling it again inpopulatePublisherID()
. Or possibly move the unmarshal into theImp
loop and pass the unmarshalled structure into this function.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 see @hhhjort
what do you think of this ?
and I will remove the Unmarshal from populatePublisherId
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.
Please add a supplemental JSON test case where attempting to unmarshal
request.ext
fails. You should be able to force this by simply settingrequest.ext.insticator
in your JSON test to an invalid type which would be something other than an object (e.g. a string).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.
added
adapters/insticator/insticatortest/supplemental/request-ext-unmarhal-fail.json
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.
You're missing test coverage here. Please add the following supplemental JSON test cases:
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.
Added adapters/insticator/insticatortest/supplemental/currency-conversion.json
adapters/insticator/insticatortest/supplemental/currency-conversion-fail.json
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.
Nitpick: you should be able to delete the parentheses
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.
Please add a supplemental JSON test case where attempting to unmarshal
imp.ext
fails. You should be able to force this by simply settingimp.ext.insticator
in your JSON test to an invalid type which would be something other than an object (e.g. a string).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.
added /adapters/insticator/insticatortest/supplemental/bad-imp-ext.json
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.
Also this should never be non-empty. The
ext
definition you are using here is looking for the field name 'insticator' rather thanbidder
which is always translated tobidder
by PBS core.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 unmarshal step has been removed.
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.
Please add a supplemental JSON test case where
.site
is present but.site.publisher
is absent.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.
added adapters/insticator/insticatortest/supplemental/site-pubid-absent.json
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.
Please add a supplemental JSON test case where
.app
is present but.app.publisher
is absent.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.
added adapters/insticator/insticatortest/supplemental/app-pubid-absent.json