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

Removed old 2.5 location usages #3923

Merged
merged 13 commits into from
Sep 30, 2024
Merged

Conversation

VeronikaSolovei9
Copy link
Contributor

No description provided.

@bsardo
Copy link
Collaborator

bsardo commented Sep 18, 2024

The functions getGDPR and getConsent in exchange/gdpr.go will need to be updated.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we want to modify the adapters. Adapters may not support 2.6. We're updating core to work with 2.6 but will down convert to 2.5 for adapters that don't declare 2.6 support. Even if an adapter does declare 2.6 support in their YAML file, I think we should leave it to the bidder to update their adapter since they must also support 2.5 at this point in time. Thoughts?

Any opinions on how to handle those adapters that do declare 2.6 support?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Discussed offline. For now, we will only update adapters that have declared 2.6 support in their YAML. In the future, once this feature has been rolled out, any new adapter PRs that declare 2.6 support will also require a review of their adapter to ensure they are accessing only 2.6 fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adapters reverted.

@@ -174,15 +174,11 @@ func (l *AgmaLogger) extractPublisherAndSite(requestWrapper *openrtb_ext.Request
}

func (l *AgmaLogger) shouldTrackEvent(requestWrapper *openrtb_ext.RequestWrapper) (bool, string) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is an interesting case that could require us to support both 2.5 and 2.6. Analytics modules could be called before the up convert occurs if there is an error.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The upconvert happens right after the wrapper is created in all three endpoints. So if the module is operating on the openrtb struct, we can be confident that it has the 2.6 version. If it is operating on the byte array, it is getting whatever was sent to the endpoint, which could be anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have requestWrapper *openrtb_ext.RequestWrapper as input to this function.
Do we still want to check old locations?

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, 19e3a1b

openx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/openx/openx.go:34:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:72:	makeRequest		75.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:118:	preprocess		85.3%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:187:	MakeBids		87.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:243:	getBidVideo		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:258:	getMediaTypeForImp	85.7%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:272:	Builder			100.0%
total:								(statements)		87.1%

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, 57d9a48

openx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/openx/openx.go:34:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:72:	makeRequest		75.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:118:	preprocess		85.3%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:187:	MakeBids		87.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:243:	getBidVideo		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:258:	getMediaTypeForImp	85.7%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:272:	Builder			100.0%
total:								(statements)		87.1%

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, 3e02d6b

openx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/openx/openx.go:34:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:72:	makeRequest		75.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:118:	preprocess		85.3%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:187:	MakeBids		87.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:243:	getBidVideo		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:258:	getMediaTypeForImp	85.7%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:272:	Builder			100.0%
total:								(statements)		87.1%

@bsardo
Copy link
Collaborator

bsardo commented Sep 23, 2024

We will need to update schainwriter.go to write to the 2.6 location instead of the 2.5.

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, 1826c39

openx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/openx/openx.go:34:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:72:	makeRequest		75.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:118:	preprocess		85.3%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:187:	MakeBids		87.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:243:	getBidVideo		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:258:	getMediaTypeForImp	85.7%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:272:	Builder			100.0%
total:								(statements)		87.1%

description: "User Ext Consent is not empty",
giveUser: &openrtb2.User{Ext: json.RawMessage(`{"consent": "BOS2bx5OS2bx5ABABBAAABoAAAAAFA"}`)},
description: "User Consent is not empty",
giveUser: &openrtb2.User{Consent: "BOS2bx5OS2bx5ABABBAAABoAAAAAFA"},
wantConsent: "BOS2bx5OS2bx5ABABBAAABoAAAAAFA",
},
{
description: "User Ext Consent is empty",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Change description name to "User consent is empty"

Comment on lines 63 to 65
} else {
sourceCopy := *req.Source
req.Source = &sourceCopy
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we still need this to avoid shared memory issues since Source is a pointer and we will only have made shallow copies of the request for each bidder.

Comment on lines 57 to 59
schain := openrtb_ext.ExtRequestPrebidSChain{
SChain: *selectedSChain,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you're right that we need to delete this block, however, notice that we were copying the value of the selected schain, which I believe was being done to protect against shared memory issues. Following this logic, when we make the assignment below:
req.Source.SChain = selectedSChain
I think we should instead be copying the value of selectedSChain to req.Source.SChain.

I suggest the following approach to accomplish this as I think it is clearer than the alternative:

  1. Change var selectedSChain *openrtb2.SupplyChain to var selectedSChain openrtb2.SupplyChain
  2. Update the selectedSChain assignments so values are copied to it instead of memory addresses
  3. Change req.Source.SChain = selectedSChain to req.Source.SChain = &selectedSChain

},
},
},
Ext: json.RawMessage(`{` + seller2SChain + `}`),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe change the description of this test from:
Use schain for bidder in ext.prebid.schains; ensure other ext.source field values are retained
to:
Use schain for bidder in ext.prebid.schains; ensure other source field values are retained

And to reduce confusion, perhaps change:
Ext: json.RawMessage(`{` + seller2SChain + `}`),
to:
Ext: json.RawMessage(`{"some":"data"}`),

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you update the test case:
description: "Use source schain -- no bidder schain or wildcard schain in nil ext.prebid.schains",
so source.schain is set and unmodified instead of source.ext.schain?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update description or test case?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oops sorry if this wasn't clear. I wasn't asking for you to update the description but rather was pointing out that I think we should update this particular test case so source.schain is set in givenRequest instead of source.ext.schain and that we confirm it is not modified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right! Sorry I confused myself :) Added.

@@ -19,21 +19,18 @@ func (c ConsentWriter) Write(req *openrtb2.BidRequest) error {
reqWrap := &openrtb_ext.RequestWrapper{BidRequest: req}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't need to wrap the request if we aren't using exts.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This writer appears to only be used on the AMP endpoint and it is being instantiated prior to the upconvert. I assume we want to make these changes anyway so that we set the consent string in the 2.6 location rather than relying on the upconvert logic so that we can get rid of this 2.5 logic.

}
}

// do we need to rebuild req here?
Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't need to wrap the request if we aren't using exts.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We shouldn't need to wrap the request on line 19 if we aren't using exts.

Comment on lines -107 to +109
userExt, err := reqWrapper.GetUserExt()
if err == nil && userExt != nil && userExt.GetConsent() != nil {
b.macros[MacroKeyConsent] = *userExt.GetConsent()
//is this happening after upconvert?
if reqWrapper.User != nil && len(reqWrapper.User.Consent) > 0 {
b.macros[MacroKeyConsent] = reqWrapper.User.Consent
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 not sure. I can reach out to the event framework author to see what their intent is. Depending on their answer we will either need to look at both the 2.5 and 2.6 locations or just the 2.6 location.

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, 17411df

openx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/openx/openx.go:34:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:72:	makeRequest		75.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:118:	preprocess		85.3%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:187:	MakeBids		87.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:243:	getBidVideo		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:258:	getMediaTypeForImp	85.7%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:272:	Builder			100.0%
total:								(statements)		87.1%

@VeronikaSolovei9 VeronikaSolovei9 marked this pull request as ready for review September 24, 2024 23:44
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, a566161

openx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/openx/openx.go:34:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:72:	makeRequest		75.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:118:	preprocess		85.3%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:187:	MakeBids		87.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:243:	getBidVideo		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:258:	getMediaTypeForImp	85.7%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:272:	Builder			100.0%
total:								(statements)		87.1%

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, de24c4d

openx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/openx/openx.go:34:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:72:	makeRequest		75.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:118:	preprocess		85.3%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:187:	MakeBids		87.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:243:	getBidVideo		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:258:	getMediaTypeForImp	85.7%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:272:	Builder			100.0%
total:								(statements)		87.1%

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, c386b20

openx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/openx/openx.go:34:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:72:	makeRequest		75.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:118:	preprocess		85.3%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:187:	MakeBids		87.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:243:	getBidVideo		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:258:	getMediaTypeForImp	85.7%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:272:	Builder			100.0%
total:								(statements)		87.1%

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, 79f94ef

openx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/openx/openx.go:34:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:72:	makeRequest		75.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:118:	preprocess		85.3%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:187:	MakeBids		87.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:243:	getBidVideo		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:258:	getMediaTypeForImp	85.7%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:272:	Builder			100.0%
total:								(statements)		87.1%

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, 10a3cd5

openx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/openx/openx.go:34:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:72:	makeRequest		75.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:118:	preprocess		85.3%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:187:	MakeBids		87.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:243:	getBidVideo		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:258:	getMediaTypeForImp	85.7%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:272:	Builder			100.0%
total:								(statements)		87.1%

# Conflicts:
#	endpoints/openrtb2/amp_auction_test.go
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, 8401e16

openx

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/openx/openx.go:34:	MakeRequests		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:72:	makeRequest		75.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:118:	preprocess		85.3%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:187:	MakeBids		87.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:243:	getBidVideo		100.0%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:258:	getMediaTypeForImp	85.7%
github.com/prebid/prebid-server/v2/adapters/openx/openx.go:272:	Builder			100.0%
total:								(statements)		87.1%

@VeronikaSolovei9 VeronikaSolovei9 merged commit fe57c0d into ortb26 Sep 30, 2024
2 checks passed
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