Skip to content

Rubicon Bid Adapter: add support for primaryCatId and secondaryCatIds#14361

Merged
robertrmartinez merged 1 commit intoprebid:masterfrom
ourcraig:rubicon/catid-support
Jan 21, 2026
Merged

Rubicon Bid Adapter: add support for primaryCatId and secondaryCatIds#14361
robertrmartinez merged 1 commit intoprebid:masterfrom
ourcraig:rubicon/catid-support

Conversation

@ourcraig
Copy link
Contributor

Type of change

  • Updated bidder adapter

Description of change

Allows the rubicon bid adapter to support primaryCatId and secondaryCatIds in bid response

Other information

@robertrmartinez to review

Copilot AI review requested due to automatic review settings January 21, 2026 07:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for IAB category identifiers in the Rubicon bid adapter by extracting primary and secondary category IDs from bid responses.

Changes:

  • Added logic to extract primaryCatId and secondaryCatIds from the bid_cat array in bid responses
  • Added comprehensive test coverage for the new category ID handling functionality

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
modules/rubiconBidAdapter.js Added logic to populate bid.meta.primaryCatId and bid.meta.secondaryCatIds from the ad.bid_cat array when present
test/spec/modules/rubiconBidAdapter_spec.js Added test case validating the correct assignment of primary and secondary category IDs across multiple bid scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3947 to +3948
expect(bids[0].meta.primaryCatId).to.be.undefined;
expect(bids[0].meta.secondaryCatIds).to.be.undefined;
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The test expects bids[0] to have undefined category IDs because response.ads[2] (which maps to bids[0] after sorting by CPM) lacks a bid_cat field. However, this test doesn't verify that the adapter correctly handles the absence of bid_cat. Consider adding an explicit assertion comment or a separate test case that documents this behavior to make the test's intent clearer.

Copilot uses AI. Check for mistakes.
]
}
],
'bid_cat': ['IAB1-1']
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

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

The test includes a bid with a single category ('bid_cat': ['IAB1-1']) but doesn't verify the correct handling of this case. The assertions on lines 3951-3952 test a single-category scenario, but they reference response.ads[0].bid_cat[0], which expects the assertion to confirm that when there's only one category, secondaryCatIds should be undefined. Consider adding explicit assertions for bids[2] that directly test the single-category case to improve test clarity.

Copilot uses AI. Check for mistakes.
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 about this thumbs up. The assertions look fine to me and this AI comment appears to be semantically challenged.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 21200992289

Details

  • 13 of 13 (100.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+3.1%) to 96.213%

Files with Coverage Reduction New Missed Lines %
modules/kinessoIdSystem.js 1 83.15%
Totals Coverage Status
Change from base Build 21183031775: 3.1%
Covered Lines: 208593
Relevant Lines: 216804

💛 - Coveralls

]
}
],
'bid_cat': ['IAB1-1']
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 about this thumbs up. The assertions look fine to me and this AI comment appears to be semantically challenged.

@robertrmartinez robertrmartinez merged commit 4c620e7 into prebid:master Jan 21, 2026
102 checks passed
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.

5 participants

Comments