Neuwo Rtd Module: Version v2.0.0 and Quality of Life Improvements#14323
Neuwo Rtd Module: Version v2.0.0 and Quality of Life Improvements#14323patmmccann merged 33 commits intoprebid:masterfrom
Conversation
- Convert single quotes to double quotes for consistency - Format code with Prettier
- Add `// prettier-ignore` comment to preserve quoted keys in `IAB_CONTENT_TAXONOMY_MAP` - Apply Prettier formatting to *modules/neuwoRtdProvider.js*
Add optional filtering configuration for IAB Content and Audience taxonomies, allowing publishers to control the quantity and quality of categories injected into bid requests. - Add `iabTaxonomyFilters` parameter to module configuration for per-tier filtering - Implement `filterIabTaxonomyTier()` function to filter taxonomies by relevance threshold and limit count - Implement `filterIabTaxonomies()` function to apply filters across all tiers using tier key mapping - Add integration example checkbox to enable/disable filtering with hardcoded filter values
- Add test for API URL construction when `neuwoApiUrl` contains existing query parameters - Add tests for error response handling: 404 errors, pending request cleanup, and retry behaviour - Add tests for concurrent requests with errors ensuring all callbacks are invoked - Add tests for JSON parsing errors in success callback - Add test for retry after JSON parsing error - Add test for missing `marketing_categories` field in API response - Add test for sorting items with undefined/null relevance values - Reorganise test structure: nest caching, URL stripping, and filtering describes under main `getBidRequestData` block - Add documentation for generating test coverage reports with viewing instructions
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9dbdc600e0
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
- Update `buildIabData()` to only include `id` in segment objects - Remove `label` requirement; segments now only need valid `ID` - Update documentation examples to reflect simplified segment structure - Update unit tests to match new segment format
…aintain backward compatibility - Add version 2.0.0 with multi-version IAB Content Taxonomy support - Implement automatic API capability detection from endpoint URL format - Maintain backward compatibility with legacy GET endpoints - Consolidate default IAB Content Taxonomy version to "2.2" constant - Transform legacy API responses to unified segtax-based format - Add `buildIabFilterConfig()` for filter configuration conversion - Add `transformV1ResponseToV2()` and `transformSegmentsV1ToV2()` helpers - Refactor `buildIabData()` to dynamically process all tiers - Update `injectIabCategories()` to work with unified response format - Enhance JSDoc documentation with format examples and API details - Add conditional logging for POST request bodies - Optimise filtering: apply once before caching for legacy endpoints
- Update all test mocks to use new segtax-based response format - Add tests for `buildIabFilterConfig()` function - Add tests for `injectIabCategories()` function - Add tests for `transformV1ResponseToV2()` function - Add tests for `transformSegmentsV1ToV2()` function - Update `buildIabData()` tests to use new tierData parameter structure - Add V1 API backward compatibility test suite with client-side filtering tests - Verify POST method and iabVersions query parameters for new API - Verify GET method and no iabVersions parameter for legacy V1 API - Update edge case tests for empty responses and error handling - Update integration tests for URL parameter handling with query strings - Remove hardcoded tier array constants (CONTENT_TIERS, AUDIENCE_TIERS)
- Change default IAB Content Taxonomy version from "3.0" to "2.2" - Add IAB Content Taxonomy version "1.0" to supported values list - Add server-side filtering explanation to IAB Taxonomy Filtering section - Update Available Tiers table to focus on taxonomy types instead of API internals - Add recommended configuration comments for `auctionDelay` and `waitForIt` - Update all configuration examples to use "2.2" as default taxonomy version - Remove "How it works" section
Add support for populating OpenRTB 2.5 category fields (`site.cat`, `site.sectioncat`, `site.pagecat`, `site.content.cat`) with IAB Content Taxonomy 1.0 segments. Changes: - Add `enableOrtb25Fields` configuration parameter (default: true) - Add `extractCategoryIds()` helper function to extract segment IDs from tier data - Refactor `buildIabData()` to use `extractCategoryIds()` for code reuse - Extend `buildIabFilterConfig()` to apply filters to IAB 1.0 when feature enabled - Modify `getBidRequestData()` to request IAB 1.0 data (segtax 1) when feature enabled - Add warning when feature enabled with legacy API endpoint - Extend `injectIabCategories()` to populate four OpenRTB 2.5 category fields - Update version to 2.1.0
Changes: - Add checkbox UI control for `enableOrtb25Fields` option (default: checked) - Add display section for OpenRTB 2.5 category fields data - Extract and display `site.cat`, `site.sectioncat`, `site.pagecat`, and `site.content.cat` fields - Update `bidRequested` event handler to capture category fields - Add localStorage persistence for `enableOrtb25Fields` setting - Pass `enableOrtb25Fields` parameter to module configuration
Changes: - Add 11 new `buildIabFilterConfig()` tests for OpenRTB 2.5 feature (enabled/disabled scenarios) - Add 11 new `extractCategoryIds()` tests covering all edge cases - Add 11 new `injectIabCategories()` tests for category field injection - Update 5 existing `buildIabFilterConfig()` tests - Add 6 new `getBidRequestData()` integration tests for V2 API with feature enabled/disabled - Move legacy API compatibility tests from V2 section to V1 section
…RTD Module Changes: - Add OpenRTB 2.5 feature description to module overview - Add `enableOrtb25Fields` parameter to parameters table - Add dedicated "OpenRTB 2.5 Category Fields" section with examples - Update ORTB2 data structure examples to show category fields - Add filtering section explaining IAB 1.0 filter application - Update "Accessing Neuwo Data" section with category field extraction example - Add "Building for Production" section with build command - Update segtax value in example (7 → 6) - Update version to 2.1.0
…ry params Replace POST request with GET and send IAB taxonomy filters as flattened URL query parameters instead of JSON body to avoid CORS preflight requests. Changes: - Replace `buildIabFilterConfig()` with `buildFilterQueryParams()` function - Change output from nested object to array of query parameter strings (e.g., `["filter_6_1_limit=3"]`) - Remove POST method and request body from ajax call - Add filter parameters directly to URL for /v1/iab endpoint - Maintain OpenRTB 2.5 filter application (ContentTier1/2 → segtax 1) - Update all unit tests to test `buildFilterQueryParams()` instead of `buildIabFilterConfig()` - Update tests expecting POST requests to expect GET requests - Update tests checking request body to check URL parameters - Update version to 2.2.0
Pull Request Test Coverage Report for Build 22322939348Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
@gregneuwo they don't seem invalid to me |
…tions - Replace global `cachedResponses` and `pendingRequests` singletons with objects keyed by `neuwoApiUrlFull` - Concurrent or sequential calls with different parameters (URL, taxonomy version, filters) maintain separate cache entries - Add LRU-style eviction capped at 10 entries to prevent unbounded cache growth - Log module version during `init()` - Add unit tests for cache isolation
|
Keyed the cache by the full API URL (covers changed config params) to cover the case you mentioned. Is it good to go? |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10f9221da6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…limit: 0` to suppress tiers - Separate JSON parsing from response processing into distinct try/catch blocks - Add `Array.isArray` guard to `extractCategoryIds` - Only cache valid object responses so failed requests can be retried - Rename `isV2Api` to `isIabEndpoint` for clarity - Fix typo in log message and JSDoc (POST -> GET) - Bump to 2.2.1
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f843e81b05
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 266a56a22c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af53f6df21
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00c5c32205
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 546357dbe6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@patmmccann All Codex feedback addressed across six review rounds, final review came back clean. The default IAB Content Taxonomy change from 3.0 to 2.2 (flagged P1 by Codex) is intentional: our clients consistently prefer 2.2 for their integrations, and any publisher needing 3.0 can still set it explicitly via |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 636a8c5ee9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| tiers.forEach((tier) => { | ||
| const tierData = marketingCategories?.[tier]; | ||
| const { threshold, limit } = filter; |
There was a problem hiding this comment.
Guard null tier filters before destructuring
When a legacy endpoint response is processed with iabTaxonomyFilters containing a tier explicitly set to null (for example ContentTier1: null from merged config), filterIabTaxonomyTier() receives null and throws at destructuring (const { threshold, limit } = filter). That exception is caught in getBidRequestData() and causes the entire Neuwo payload to be discarded for the auction instead of just skipping that tier, so valid categories are lost. Treat non-object tier filters as {} before destructuring to avoid dropping all enrichment on this input shape.
Useful? React with 👍 / 👎.
Type of change
Bugfix
Feature
New bidder adapter
Updated bidder adapter
Code style update (formatting, local variables)
Refactoring (no functional changes, no api changes)
Build related changes
CI related changes
Does this change affect user-facing APIs or examples documented on http://prebid.org?
Other
Description of change
Quality of Life Improvements
_neuwo_prod=PrebidModuleproduct identifier to API requestsv2.0.0 – New API architecture
buildIabFilterConfig()and shared filtering logicv2.1.0 – OpenRTB 2.5 category fields
site.cat,site.sectioncat,site.pagecat,site.content.cat)Other information