Rubicon Bid Adapter: add support for primaryCatId and secondaryCatIds#14361
Rubicon Bid Adapter: add support for primaryCatId and secondaryCatIds#14361robertrmartinez merged 1 commit intoprebid:masterfrom
Conversation
There was a problem hiding this comment.
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
primaryCatIdandsecondaryCatIdsfrom thebid_catarray 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.
| expect(bids[0].meta.primaryCatId).to.be.undefined; | ||
| expect(bids[0].meta.secondaryCatIds).to.be.undefined; |
There was a problem hiding this comment.
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.
| ] | ||
| } | ||
| ], | ||
| 'bid_cat': ['IAB1-1'] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I'm not sure about this thumbs up. The assertions look fine to me and this AI comment appears to be semantically challenged.
Pull Request Test Coverage Report for Build 21200992289Details
💛 - Coveralls |
| ] | ||
| } | ||
| ], | ||
| 'bid_cat': ['IAB1-1'] |
There was a problem hiding this comment.
I'm not sure about this thumbs up. The assertions look fine to me and this AI comment appears to be semantically challenged.
Type of change
Description of change
Allows the
rubiconbid adapter to supportprimaryCatIdandsecondaryCatIdsin bid responseOther information
@robertrmartinez to review