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

New Adapter: Pixfuture #4117

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open

Conversation

pixfuture-media
Copy link

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.

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))

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.

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 3f33089

pixfuture

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:20:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:28:	MakeRequests		85.7%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:49:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:64:	MakeBids		90.0%
total:									(statements)		91.4%

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 993f157

pixfuture

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:20:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:27:	MakeRequests		85.7%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:48:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:63:	MakeBids		90.0%
total:									(statements)		91.2%

@gargcreation1992 gargcreation1992 self-assigned this Dec 24, 2024
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"}}
}
Copy link
Contributor

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 -

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),
}}
}
Copy link
Contributor

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]"
Copy link
Contributor

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".

Copy link
Collaborator

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.

@pixfuture-media
Copy link
Author

pixfuture-media commented Dec 27, 2024 via email

@bsardo bsardo changed the title New Pixfuture adapter New Adapter: Pixfuture Jan 6, 2025
@bsardo bsardo added the adapter label Jan 6, 2025
@pixfuture-media
Copy link
Author

I would like to ask for your help with reviewing a pull request [New Adapter: Pixfuture #4117].
Your feedback would be greatly appreciated.
When do you think you might be able to review this?
Thank you in advance for your time and effort.

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 284c847

pixfuture

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:20:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:27:	MakeRequests		85.7%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:48:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:63:	MakeBids		90.0%
total:									(statements)		91.2%

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 1df8f71

pixfuture

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:21:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:28:	MakeRequests		70.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:73:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:88:	MakeBids		88.9%
total:									(statements)		82.2%

@bretg
Copy link
Contributor

bretg commented Jan 17, 2025

@pixfuture-media - please address the review comments above. Then the reviewer will look at this PR again.

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 6a59158

pixfuture

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:21:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:28:	MakeRequests		70.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:73:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:88:	MakeBids		88.9%
total:									(statements)		82.2%

Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 2ba1a64

pixfuture

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:21:	Builder			100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:28:	MakeRequests		70.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:73:	getMediaTypeForBid	100.0%
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:88:	MakeBids		88.9%
total:									(statements)		82.2%

@pixfuture-media
Copy link
Author

pixfuture-media commented Jan 17, 2025

Please review the Pixfuture adapter and let us know if any further actions are required.
Previous requests to changes have been completed.

@bsardo bsardo self-assigned this Jan 22, 2025
@bsardo
Copy link
Collaborator

bsardo commented Jan 22, 2025

@scr-oath can you please review?

@pixfuture-media
Copy link
Author

@scr-oath can you please review?

Please provide the next steps from our side. We've implemented all the requested changes.

@pixfuture-media
Copy link
Author

Hi, @gargcreation1992. Please let us know what is required from our end.

Copy link
Collaborator

@bsardo bsardo left a 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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please delete this file.

Copy link
Collaborator

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.

Copy link
Collaborator

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.

Copy link
Collaborator

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.

Comment on lines +1114 to +1115
v.SetDefault("gdpr.timeouts_ms.init_vendorlist_fetches", 30000)
v.SetDefault("gdpr.timeouts_ms.active_vendorlist_fetch", 30000)
Copy link
Collaborator

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}}"
Copy link
Collaborator

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

Comment on lines +40 to +43
if imp.Banner == nil && imp.Video == nil {
errs = append(errs, fmt.Errorf("unsupported impression type for impID: %s", imp.ID))
continue
}
Copy link
Collaborator

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.

Comment on lines +32 to +35
if bidRequest == nil || len(bidRequest.Imp) == 0 {
errs = append(errs, fmt.Errorf("no valid impressions in bid request"))
return nil, errs
}
Copy link
Collaborator

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",
Copy link
Collaborator

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".

Comment on lines +116 to +119

// Set the MType explicitly in the bid
//mType := openrtb2.MType(bidType)
//seatBid.Bid[i].MType = mType
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants