-
Notifications
You must be signed in to change notification settings - Fork 224
NextMillennium: Adapter and server version #3814
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
NextMillennium: Adapter and server version #3814
Conversation
| final ExtRequestPrebid updatedExt = extRequestPrebid.toBuilder() | ||
| .nextMillennium(ExtRequestNextMillennium.of( | ||
| nmmFlags, | ||
| NM_ADAPTER_VERSION, | ||
| versionProvider.getNameVersionRecord())) | ||
| .build(); |
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.
In Go they don't update ext or ext.prebid, they create new objects
| return bidRequest.toBuilder() | ||
| .imp(bidRequest.getImp()) | ||
| .ext(ExtRequest.of(updatedExt)) | ||
| .build(); |
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.
imp[0].ext update is missing
| /** | ||
| * Defines the contract for bidrequest.ext.prebid.nextMillennium | ||
| */ | ||
| ExtRequestNextMillennium nextMillennium; |
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.
deserialization is incorrect here
...ava/org/prebid/server/proto/openrtb/ext/request/nextmillennium/ExtRequestNextMillennium.java
Outdated
Show resolved
Hide resolved
...ava/org/prebid/server/proto/openrtb/ext/request/nextmillennium/ExtRequestNextMillennium.java
Outdated
Show resolved
Hide resolved
| @JsonProperty("nmm_flags") | ||
| List<String> nmmFlags; | ||
|
|
||
| @JsonProperty("nm_version") |
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.
redundant
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.
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.
the annotation is redundant
i have got n m m F l a g s . where is a problem? Sorry, I didn't get. According to the Go the field should be serialized into the nnmFlags instead of nnm_flags
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.
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.
the point was about the case, it should be nmmFlags instead of the nmm_flags in the bidder request
| @JsonProperty("nm_version") | ||
| String nmVersion; | ||
|
|
||
| @JsonProperty("server_version") |
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.
redundant
| final ObjectNode nextMillenniumNode = mapper.mapper().valueToTree( | ||
| ExtRequestNextMillennium.of(nmmFlags, NM_ADAPTER_VERSION, versionProvider.getNameVersionRecord())); | ||
|
|
||
| extRequest.addProperty("next_millennium", nextMillenniumNode); |
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.
incorrect property name, should be nextMillennium
| final ObjectNode updatedImpExt = mapper.mapper().createObjectNode(); | ||
| updatedImpExt.set("bidder", mapper.mapper().valueToTree(ext)); |
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.
what is this? I don't see any bidder field in the bidder 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.
in L11-15 there is bidder field:
"ext": {
"bidder": {
"placement_id": "placement_id"
}
}
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.
the Go doesn't have it
| return bidRequest.toBuilder() | ||
| .imp(bidRequest.getImp()) | ||
| .ext(ExtRequest.of(updatedExt)) | ||
| .imp(List.of(updatedImp)) |
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 should update only a first imp, but not replace the whole list of imps with a single one
src/main/java/org/prebid/server/bidder/nextmillennium/NextMillenniumBidder.java
Outdated
Show resolved
Hide resolved
| @JsonProperty("nmmFlags") | ||
| List<String> nmmFlags; | ||
|
|
||
| @JsonProperty("nmVersion") |
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.
remove annotation
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.
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 means the test is incorrect
this is the mapping the Go uses
type nmExtNMM struct {
NmmFlags []string `json:"nmmFlags,omitempty"`
ServerVersion string `json:"server_version,omitempty"`
AdapterVersion string `json:"nm_version,omitempty"`
}
| @JsonProperty("nmVersion") | ||
| String nmVersion; | ||
|
|
||
| @JsonProperty("serverVersion") |
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.
remove annotation
| final Imp firstImp = bidRequest.getImp().getFirst(); | ||
| final ObjectNode updatedImpExt = mapper.mapper().createObjectNode(); | ||
| updatedImpExt.set("bidder", mapper.mapper().valueToTree(ext)); | ||
| updatedImpExt.set("nextMillennium", nextMillenniumNode); |
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.
the nextMillenniumNode should have only nmmFlags if it's an imp.ext
| final Imp firstImp = bidRequest.getImp().getFirst(); | ||
| final ObjectNode updatedImpExt = mapper.mapper().createObjectNode(); | ||
| updatedImpExt.set("nextMillennium", nextMillenniumNode); | ||
| updatedImpExt.set("nextMillennium", nextMillenniumNode.get("nmmFlags")); |
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 incorrect, please observe the Go code one more time
src/main/java/org/prebid/server/bidder/nextmillennium/NextMillenniumBidder.java
Show resolved
Hide resolved
src/main/java/org/prebid/server/bidder/nextmillennium/NextMillenniumBidder.java
Show resolved
Hide resolved
...ava/org/prebid/server/proto/openrtb/ext/request/nextmillennium/ExtRequestNextMillennium.java
Show resolved
Hide resolved
src/main/java/org/prebid/server/bidder/nextmillennium/NextMillenniumBidder.java
Outdated
Show resolved
Hide resolved
src/test/java/org/prebid/server/bidder/nextmillennium/NextMillenniumBidderTest.java
Show resolved
Hide resolved
| } | ||
|
|
||
| private BidRequest updateBidRequest(BidRequest bidRequest, ExtImpNextMillennium ext) { | ||
| private BidRequest updateBidRequest1(BidRequest bidRequest, ExtImpNextMillennium ext) { |
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.
remove
src/main/java/org/prebid/server/bidder/nextmillennium/NextMillenniumBidder.java
Show resolved
Hide resolved
src/main/java/org/prebid/server/spring/config/bidder/NextMillenniumConfiguration.java
Show resolved
Hide resolved
src/test/java/org/prebid/server/bidder/nextmillennium/NextMillenniumBidderTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/prebid/server/bidder/nextmillennium/NextMillenniumBidderTest.java
Outdated
Show resolved
Hide resolved
…3744 # Conflicts: # src/main/java/org/prebid/server/bidder/nextmillennium/NextMillenniumBidder.java



🔧 Type of changes
✨ What's the context?
#3744