Skip to content

Showheroes Bid Adapter: enable gzip compression and remove callbacks#14643

Open
FilipStamenkovic wants to merge 1 commit intoprebid:masterfrom
showheroes:showheroes_update
Open

Showheroes Bid Adapter: enable gzip compression and remove callbacks#14643
FilipStamenkovic wants to merge 1 commit intoprebid:masterfrom
showheroes:showheroes_update

Conversation

@FilipStamenkovic
Copy link
Copy Markdown
Contributor

@FilipStamenkovic FilipStamenkovic commented Mar 25, 2026

Type of change

  • Feature

Description of change

This PR has 2 changes:

  • enables gzip compression
  • removes callbacks on bidWon event

Other information

Copilot AI review requested due to automatic review settings March 25, 2026 16:34
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I opened a PR to rename the bid adapter to just showheroes in this PR: #14644.

Copy link
Copy Markdown
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 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.endpointCompression to adapter requests, controlled by bidder config (gzipEnabled) with a default of true.
  • Remove propagation of ext.callbacks into bid responses and remove the adapter’s onBidWon callback 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.

Comment on lines +163 to +174
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;
}
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +372 to +413
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'
}
});

Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +166 to +170
if (gzipSetting === true || gzipSetting === "true") {
return true;
}
if (gzipSetting === false || gzipSetting === "false") {
return false;
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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;
}

Copilot uses AI. Check for mistakes.
@coveralls
Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 23552390425

Details

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

Files with Coverage Reduction New Missed Lines %
test/spec/modules/id5AnalyticsAdapter_spec.js 1 96.13%
Totals Coverage Status
Change from base Build 23392478268: 0.001%
Covered Lines: 216416
Relevant Lines: 224618

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants