Showheroes Bid Adapter: enable gzip compression and remove callbacks#14643
Showheroes Bid Adapter: enable gzip compression and remove callbacks#14643FilipStamenkovic wants to merge 1 commit intoprebid:masterfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5964e9dea
ℹ️ 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".
| } | ||
|
|
||
| function getGzipSetting() { | ||
| const gzipSetting = deepAccess(config.getBidderConfig(), 'showheroes.gzipEnabled'); |
There was a problem hiding this comment.
Read gzip setting from the showheroes-bs bidder key
The new getGzipSetting() lookup uses showheroes.gzipEnabled, but this adapter is registered as showheroes-bs (alias showheroesBs), so a publisher calling setBidderConfig({ bidders: ['showheroes-bs'], config: { gzipEnabled: false } }) will never be honored. In that case endpointCompression stays at the default true, which defeats the advertised override and can break integrations that need gzip disabled.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I opened a PR to rename the bid adapter to just showheroes in this PR: #14644.
There was a problem hiding this comment.
Pull request overview
This PR updates the Showheroes (showheroes-bs) bid adapter to enable request gzip compression and to remove the legacy callbacks handling on bidWon, aligning adapter behavior with newer Prebid request options.
Changes:
- Add
options.endpointCompressionto adapter requests, controlled by bidder config (gzipEnabled) with a default oftrue. - Remove propagation of
ext.callbacksinto bid responses and remove the adapter’sonBidWoncallback pixel triggering. - Update adapter unit tests: remove callback assertions and add gzip configuration coverage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| modules/showheroes-bsBidAdapter.js | Adds gzip request option + removes bidWon callback handling |
| test/spec/modules/showheroes-bsBidAdapter_spec.js | Removes callback assertions and adds gzip configuration tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| function getGzipSetting() { | ||
| const gzipSetting = deepAccess(config.getBidderConfig(), 'showheroes.gzipEnabled'); | ||
|
|
||
| if (gzipSetting === true || gzipSetting === "true") { | ||
| return true; | ||
| } | ||
| if (gzipSetting === false || gzipSetting === "false") { | ||
| return false; | ||
| } | ||
|
|
||
| return DEFAULT_GZIP_ENABLED; | ||
| } |
There was a problem hiding this comment.
getGzipSetting() reads bidder config from config.getBidderConfig() using the path showheroes.gzipEnabled, but setBidderConfig() stores settings under the actual bidder code key (here showheroes-bs). Because the key contains a hyphen, deepAccess(..., 'showheroes-bs.gzipEnabled') also won’t work with dot-path access. As a result, bidder-specific gzip configuration will never be applied. Use bracket access keyed by BIDDER_CODE (and optionally check the alias if you intend to support it) when reading gzipEnabled.
| it('should respect bidder-specific boolean configuration set via setBidderConfig', () => { | ||
| // Mock bidder-specific config to return false | ||
| bidderConfigStub.returns({ | ||
| showheroes: { | ||
| gzipEnabled: false | ||
| } | ||
| }); | ||
|
|
||
| const request = spec.buildRequests([bidRequestVideoV2], bidderRequest); | ||
| expect(request.options.endpointCompression).to.be.false; | ||
| }); | ||
|
|
||
| it('should handle bidder-specific string configuration ("true")', () => { | ||
| bidderConfigStub.returns({ | ||
| showheroes: { | ||
| gzipEnabled: 'true' | ||
| } | ||
| }); | ||
|
|
||
| const request = spec.buildRequests([bidRequestVideoV2], bidderRequest); | ||
| expect(request.options.endpointCompression).to.be.true; | ||
| }); | ||
|
|
||
| it('should handle bidder-specific string configuration ("false")', () => { | ||
| bidderConfigStub.returns({ | ||
| showheroes: { | ||
| gzipEnabled: 'false' | ||
| } | ||
| }); | ||
|
|
||
| const request = spec.buildRequests([bidRequestVideoV2], bidderRequest); | ||
| expect(request.options.endpointCompression).to.be.false; | ||
| }); | ||
|
|
||
| it('should fall back to default when bidder-specific value is invalid', () => { | ||
| // Mock bidder-specific config to return invalid value | ||
| bidderConfigStub.returns({ | ||
| showheroes: { | ||
| gzipEnabled: 'invalid' | ||
| } | ||
| }); | ||
|
|
There was a problem hiding this comment.
The gzip configuration tests stub config.getBidderConfig() to return { showheroes: { gzipEnabled: ... } }, but bidder config is keyed by bidder code (here showheroes-bs). These tests currently match the adapter’s incorrect lookup and will need to be updated to use the real bidder key so they validate the intended behavior.
| if (gzipSetting === true || gzipSetting === "true") { | ||
| return true; | ||
| } | ||
| if (gzipSetting === false || gzipSetting === "false") { | ||
| return false; |
There was a problem hiding this comment.
getGzipSetting() only accepts booleans or the exact strings "true"/"false". Other adapters’ gzip helpers normalize string values via String(...).toLowerCase().trim() (so values like " True " work) and treat anything else as invalid. Consider normalizing the input similarly to avoid surprising fallbacks to the default when config is provided as a string with different casing/whitespace.
| if (gzipSetting === true || gzipSetting === "true") { | |
| return true; | |
| } | |
| if (gzipSetting === false || gzipSetting === "false") { | |
| return false; | |
| if (typeof gzipSetting === 'boolean') { | |
| return gzipSetting; | |
| } | |
| if (gzipSetting != null) { | |
| const normalized = String(gzipSetting).toLowerCase().trim(); | |
| if (normalized === 'true') { | |
| return true; | |
| } | |
| if (normalized === 'false') { | |
| return false; | |
| } |
Pull Request Test Coverage Report for Build 23552390425Details
💛 - Coveralls |
Type of change
Description of change
This PR has 2 changes:
gzipcompressioncallbacksonbidWoneventOther information