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#14323gregneuwo wants to merge 25 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".
| } else if (enableCache && pendingRequest) { | ||
| // Another caller started a request - wait for it instead of making a duplicate | ||
| logInfo( | ||
| MODULE_NAME, | ||
| "getBidRequestData():", |
There was a problem hiding this comment.
Key pending requests by URL before reusing
When enableCache is true, any concurrent call will attach to the single pendingRequest without checking whether it targets the same neuwoApiUrlFull (which depends on websiteToAnalyseUrl and stripping options). If those params differ between overlapping auctions or a config update mid-flight, the later request will reuse the first response and inject categories for the wrong URL. This can skew targeting data; consider keying pendingRequest by the request URL or comparing params before sharing.
Useful? React with 👍 / 👎.
- 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 22197432082Details
💛 - Coveralls |
|
All checks are passing. The assigned reviewer @lksharma appears to be inactive. Could this be reassigned to another reviewer? |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2882bb299
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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