-
Notifications
You must be signed in to change notification settings - Fork 764
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: Pixfuture #4117
base: master
Are you sure you want to change the base?
New Adapter: Pixfuture #4117
Conversation
var bidExt openrtb_ext.ExtBid | ||
err := jsonutil.Unmarshal(bid.Ext, &bidExt) | ||
if err == nil && bidExt.Prebid != nil { | ||
return openrtb_ext.ParseBidType(string(bidExt.Prebid.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.
Consider this as a suggestion. Prebid server expects the media type to be explicitly set in the adapter response. Therefore, recommends implementing a pattern where the adapter server sets the MType field in the response to accurately determine the media type for the impression.
Code coverage summaryNote:
pixfutureRefer here for heat map coverage report
|
Code coverage summaryNote:
pixfutureRefer here for heat map coverage report
|
func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { | ||
if len(request.Imp) == 0 { | ||
return nil, []error{&errortypes.BadInput{Message: "No impressions in the bid request"}} | ||
} |
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 check is not required here as this is being checked in the core codebase already. Here is the link -
prebid-server/endpoints/openrtb2/auction.go
Lines 770 to 772 in 32fdbc4
if req.LenImp() < 1 { | |
return []error{errors.New("request.imp must contain at least one element.")} | |
} |
return nil, []error{&errortypes.BadServerResponse{ | ||
Message: fmt.Sprintf("Unexpected status code: %d. Run with request.debug = 1 for more info.", responseData.StatusCode), | ||
}} | ||
} |
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 is correct but you could also use the common code as below -
if adapters.IsResponseStatusCodeNoContent(responseData) {
return nil, nil
}
if err := adapters.CheckResponseStatusCodeForErrors(responseData); err != nil {
return nil, []error{err}
}
@@ -0,0 +1,16 @@ | |||
endpoint: "https://srv-adapter.pixfuture.com/pixservices" | |||
maintainer: | |||
email: "[email protected]" |
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.
Sent an email for verification. Please reply with "received".
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 resent this email. Please reply to it with "received" for verification.
received
…On Tue, 24 Dec 2024 at 04:56, Ashish Garg ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In static/bidder-info/pixfuture.yaml
<#4117 (comment)>
:
> @@ -0,0 +1,16 @@
+endpoint: "https://srv-adapter.pixfuture.com/pixservices"
+maintainer:
+ email: ***@***.***"
Sent an email for verification. Please reply with "received".
—
Reply to this email directly, view it on GitHub
<#4117 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUDNEQT5OAVWPASNEC4GV732HEVTPAVCNFSM6AAAAABT5HIYBCVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMRRG43DAOBRGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
I would like to ask for your help with reviewing a pull request [New Adapter: Pixfuture #4117]. |
Code coverage summaryNote:
pixfutureRefer here for heat map coverage report
|
Code coverage summaryNote:
pixfutureRefer here for heat map coverage report
|
@pixfuture-media - please address the review comments above. Then the reviewer will look at this PR again. |
Code coverage summaryNote:
pixfutureRefer here for heat map coverage report
|
Code coverage summaryNote:
pixfutureRefer here for heat map coverage report
|
Please review the Pixfuture adapter and let us know if any further actions are required. |
@scr-oath can you please review? |
Please provide the next steps from our side. We've implemented all the requested changes. |
Hi, @gargcreation1992. Please let us know what is required from our end. |
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.
See my comments. For reference, we have a section in the developer docs that describe how to build and test a Go adapter. LMK if you have any questions.
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 delete this file.
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 revert changes to go.mod
and go.sum
as this PR should focus on your adapter. If you feel a library update is needed, please push up a change in a separate PR.
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.
Unit tests are considered nice to haves. The JSON test framework is required to achieve code coverage wherever possible. Please see the developer docs Test Your Adapter section on how to test your adapter.
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 delete the testdata
directory and it's contents. As described in the developer docs, you should create adapters/pixfuture/pixfuturetest/exemplary
and adapters/pixfuture/pixfuturetest/supplemental
directories where you'll define your JSON tests to be used by the JSON test framework.
v.SetDefault("gdpr.timeouts_ms.init_vendorlist_fetches", 30000) | ||
v.SetDefault("gdpr.timeouts_ms.active_vendorlist_fetch", 30000) |
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 revert these changes as they are a change to core and not your adapter.
- video | ||
userSync: | ||
redirect: | ||
url: "https://sync.pixfuture.com/sync?gdpr={{.GDPR}}&consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}" |
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'm getting an error that this does not resolve to a known resource. My test url is https://sync.pixfuture.com/sync?gdpr=0&consent=CQL_D2nQL_D2nPjAAAENCZCAAP_AAH_AAAAAGGwAQGGgYbABAYaAAA.II7Nd_X__bX9n-_7_6ft0eY1f9_r37uQzDhfNs-8F3L_W_LwX32E7NF36tq4KmR4ku1bBIQNtHMnUDUmxaolVrzHsak2cpyNKJ_JkknsZe2dYGF9Pn9lD-YKZ7_5_9_f52T_9_9_-39z3_9f___dv_-__-vjf_599n_v9fV_78_Kf9______-____________8A&us_privacy=&redirect=http%3A%2F%2Flocalhost%3A8000%2Fsetuid%3Fbidder%3Dpixfuture%26gdpr%3D0%26gdpr_consent%3DCQL_D2nQL_D2nPjAAAENCZCAAP_AAH_AAAAAGGwAQGGgYbABAYaAAA.II7Nd_X__bX9n-_7_6ft0eY1f9_r37uQzDhfNs-8F3L_W_LwX32E7NF36tq4KmR4ku1bBIQNtHMnUDUmxaolVrzHsak2cpyNKJ_JkknsZe2dYGF9Pn9lD-YKZ7_5_9_f52T_9_9_-39z3_9f___dv_-__-vjf_599n_v9fV_78_Kf9______-____________8A%26gpp%3D%26gpp_sid%3D%26f%3Di%26uid%3D
if imp.Banner == nil && imp.Video == nil { | ||
errs = append(errs, fmt.Errorf("unsupported impression type for impID: %s", imp.ID)) | ||
continue | ||
} |
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 validation check is not needed since you've only declared support for banner and video in your YAML file and PBS core will only call your adapter if it contains media types you declare support for.
if bidRequest == nil || len(bidRequest.Imp) == 0 { | ||
errs = append(errs, fmt.Errorf("no valid impressions in bid request")) | ||
return nil, errs | ||
} |
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 validation logic can be removed as your adapter will only be called if it contains at least one impression.
} | ||
|
||
request := &adapters.RequestData{ | ||
Method: "POST", |
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 suggest using http.MethodPost
instead of "POST"
.
|
||
// Set the MType explicitly in the bid | ||
//mType := openrtb2.MType(bidType) | ||
//seatBid.Bid[i].MType = mType |
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.
Delete the commented out code.
This Pixfuture Prebid Server Adapter enables seamless integration with Pixfuture's ad exchange, allowing publishers to leverage their demand through server-side header bidding. The adapter formats outgoing bid requests, processes incoming bid responses, and adheres to OpenRTB standards for efficient and privacy-compliant ad delivery.