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

Upconvert to rtb 2.6 (Some tests not working, need validation to support 2.6) #3914

Merged
merged 3 commits into from
Sep 23, 2024

Conversation

hhhjort
Copy link
Collaborator

@hhhjort hhhjort commented Sep 11, 2024

No description provided.

endpoints/openrtb2/amp_auction_test.go Outdated Show resolved Hide resolved
Comment on lines 753 to 754
assert.Equal(t, test.expectedRegExt.USPrivacy, *&result.Regs.USPrivacy, test.description+":USPrivacy")
assert.Equal(t, test.expectedRegExt.GDPR, *&result.Regs.GDPR, test.description+":GDPR")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the *& necessary? I thought Equal will only compare values not that they are the same memory location.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did not really consider that. The old code was the same, except looking to the unmarshalled ext from the result. I can try it without.

@@ -533,6 +533,9 @@ func (deps *endpointDeps) parseRequest(httpRequest *http.Request, labels *metric
return
}

// upgrade to 2.6 here
openrtb_ext.ConvertUpTo26(req)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just noting that processStoredRequests does the following:

  1. generate request UUID
  2. merge in stored request
  3. merge in default request
  4. extract additional info from imp.ext.prebid (echo video attrs, passthrough)
  5. merge stored imps with incoming request imps

I think it is ok to perform these operations prior to the upconvert. All other request mutations are done after the upconvert.

Comment on lines 181 to 182
// upgrade to 2.6 here
openrtb_ext.ConvertUpTo26(reqWrapper)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be moved into parseAmpRequest and be called right after the stored request is fetched but before we populate other fields like req.test, req.imp[x].secure, etc and perform validations?

Copy link
Collaborator

@bsardo bsardo Sep 17, 2024

Choose a reason for hiding this comment

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

Discussed offline. At a minimum we will move the call to ConvertUpTo26 before ortb.SetDefaults but it could also be moved somewhere in loadRequestJSONForAmp. The question is how do we view the AMP params? Are they considered the incoming request similar to how they are treated on the auction endpoint? Perhaps it should be moved before the call to overrideWithParams?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will move it up to just after we create the request wrapper. Seems to be a good place for it. The functions afterwards only seem to hit non-upconverted fields.

@@ -260,6 +260,8 @@ func (deps *endpointDeps) VideoAuctionEndpoint(w http.ResponseWriter, r *http.Re
// all code after this line should use the bidReqWrapper instead of bidReq directly
bidReqWrapper := &openrtb_ext.RequestWrapper{BidRequest: bidReq}

openrtb_ext.ConvertUpTo26(bidReqWrapper)
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are a few fields being set on the request like id and test prior to the upconvert but that should be ok.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moving the conversion to the wrapper up would be a lot of work to make everything wrapper compatible. So as you said, it should work well here.

@bsardo bsardo merged commit c6cc9d2 into ortb26 Sep 23, 2024
bsardo pushed a commit to bsardo/prebid-server that referenced this pull request Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants