Skip to content

Conversation

@przemkaczmarek
Copy link
Collaborator

🔧 Type of changes

  • bid adapter update

✨ What's the context?

#4234

Comment on lines 159 to 160
NextMillenniumExtBidder.of(
nmmFlags, extImp.getAdSlots(), extImp.getAllowedAds(), null, null));
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I understand the changes in Go correctly adslots and allowedads shouldn't be added to the imp.ext

Copy link
Collaborator

Choose a reason for hiding this comment

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

and please, create a separate static constructor of with the only nmmFlags parameter

Copy link
Collaborator Author

@przemkaczmarek przemkaczmarek Oct 27, 2025

Choose a reason for hiding this comment

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

according to the json's samples:

"mockBidRequest": {
    "id": "testid",
    "imp": [
      {
        "id": "123654",
        "banner": {
          "w": 320,
          "h": 250
        },
        "ext": {
          "bidder": {
            "group_id": "7819",
            "allowedAds":["allowed_ad_1, allowed_ad_2"]
          }
        }
      }
    ],
    "app": {
      "domain": "www.example.com"
    }
  },

  "httpCalls": [
    {
      "expectedRequest": {
        "uri": "https://pbs.nextmillmedia.com/openrtb2/auction",
        "body":{
          "id": "testid",
          "app": {
            "domain": "www.example.com"
          },
          "ext": {
            "nextMillennium": {
              "allowedAds":["allowed_ad_1, allowed_ad_2"],
              "nm_version":"v1.0.1"
            },
            ```
            ----------------------------------------------------------
            ```
            type nmExtNMM struct {
	NmmFlags       []string `json:"nmmFlags,omitempty"`
	AdSlots        []string `json:"adSlots,omitempty"`
	AllowedAds     []string `json:"allowedAds,omitempty"`
	ServerVersion  string   `json:"server_version,omitempty"`
	AdapterVersion string   `json:"nm_version,omitempty"`
}

AdSlots and AllowedAds are parts of nmmExt:

Copy link
Collaborator

@AntoxaAntoxic AntoxaAntoxic Oct 28, 2025

Choose a reason for hiding this comment

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

it should be included in the ext.nextMillennium, but not in the imp[].ext.nextMillennium (compare the payload you provided and the payload of the integration tests you've added)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment on lines 183 to 184
nmmFlags, extImp.getAdSlots(), extImp.getAllowedAds(), NM_ADAPTER_VERSION,
versionProvider.getNameVersionRecord()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

please chop the whole parameter list down

Copy link
Collaborator

Choose a reason for hiding this comment

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

^^

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you mean listing them one per line or removing them?

Copy link
Collaborator

Choose a reason for hiding this comment

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

one per line, please

request -> request.app(App.builder().domain("appDomain").build()),
givenImpWithExt(identity(), ExtImpNextMillennium.of(null, "group1")),
givenImpWithExt(identity(), ExtImpNextMillennium.of(null, "group2")));
givenImpWithExt(identity(), ExtImpNextMillennium.of(null, "group1", null, null)),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer extracting ExtImpNextMillennium.of(null, "group1", null, null) and ExtImpNextMillennium.of("placement1", "group1", null, null) into separate methods in order not to pass nulls everywhere

Comment on lines 212 to 222
final ObjectNode requestExtNode = mapper.valueToTree(actualRequest.getExt());
assertThat(requestExtNode.at("/nextMillennium/adSlots/0").asText()).isEqualTo("slot1");
assertThat(requestExtNode.at("/nextMillennium/adSlots/1").asText()).isEqualTo("slot2");
assertThat(requestExtNode.at("/nextMillennium/allowedAds/0").asText()).isEqualTo("ad1");
assertThat(requestExtNode.at("/nextMillennium/allowedAds/1").asText()).isEqualTo("ad2");

final ObjectNode impExtNode = (ObjectNode) actualRequest.getImp().getFirst().getExt();
assertThat(impExtNode.at("/nextMillennium/adSlots/0").asText()).isEqualTo("slot1");
assertThat(impExtNode.at("/nextMillennium/adSlots/1").asText()).isEqualTo("slot2");
assertThat(impExtNode.at("/nextMillennium/allowedAds/0").asText()).isEqualTo("ad1");
assertThat(impExtNode.at("/nextMillennium/allowedAds/1").asText()).isEqualTo("ad2");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer using extracting approach like everywhere else in the test


String serverVersion;

public static NextMillenniumExtBidder ofNmmFlags(List<String> nmmFlags) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

just of


return bidRequest.toBuilder()
.imp(modifyFirstImp(bidRequest.getImp(), soredRequestId, extImp))
.imp(modifyFirstImp(bidRequest.getImp(), soredRequestId))
Copy link
Collaborator

Choose a reason for hiding this comment

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

a typo in soredRequestId

Comment on lines 183 to 184
nmmFlags, extImp.getAdSlots(), extImp.getAllowedAds(), NM_ADAPTER_VERSION,
versionProvider.getNameVersionRecord()));
Copy link
Collaborator

Choose a reason for hiding this comment

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

^^

@CTMBNara CTMBNara merged commit 4f64c15 into master Nov 17, 2025
7 of 8 checks passed
@CTMBNara CTMBNara deleted the Nextmillennium-New-fields-and-adapter-version-update branch November 17, 2025 19:54
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.

Port PR from PBS-Go: Nextmillennium: New fields and adapter version update

4 participants