Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dummy PR to review approver acces #551

Open
wants to merge 28 commits into
base: nightly
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5a2f0ec
GPP config set to prebid
pm-nitin-shirsat Apr 4, 2023
af4a99b
Set GPP related config to prebid via OW
pm-nitin-shirsat Apr 5, 2023
97438ea
Add code to set gpp config to IDHUB
pm-nitin-shirsat Apr 7, 2023
55ebda4
Setting this config to PBJS_NAMESPACE as prebid needs to read consent…
pm-nitin-shirsat Apr 7, 2023
be872ac
Add gpp config to OW namespace in case of IH profiles
pm-nitin-shirsat Apr 11, 2023
0fa61c1
Merge pull request #440 from PubMatic/nightly
pm-nitin-shirsat Apr 19, 2023
6e261b1
Merge pull request #465 from PubMatic/nightly
pm-nitin-shirsat Jun 27, 2023
2b67026
Update init-build.sh
pm-nitin-shirsat Jun 29, 2023
a75cf03
Update init-build.sh
pm-nitin-shirsat Jun 29, 2023
4ec8328
Consuming buckets for custom PG
Mar 5, 2024
eb83d2d
Passing pwtpb with price bucket value to GAM
Mar 5, 2024
1a6a811
Added pwtpb in wrapper targetting keys
Mar 5, 2024
9ac2b1f
Updated the functionality as per changes in API side
Mar 15, 2024
679c3eb
Merge branch 'UOE-10115' into UOE-10005
Mar 15, 2024
8389bf4
Changing bidderSequence to random or fixed based on bidderOrderingEna…
kapil-tuptewar Jul 11, 2024
79bbe22
Merge branch 'nightly' into UOE-10005
Jul 26, 2024
aa01a3f
Updated test cases
Jul 26, 2024
6ac8393
Merge branch 'gpp/phase1/UOE-10929' into gpp-phase-1
pm-nitin-shirsat Aug 13, 2024
525307d
Merge pull request #546 from PubMatic/gpp-phase-1
pm-nitin-shirsat Aug 13, 2024
8ae915c
Added Support for GPP
pm-nitin-shirsat Aug 13, 2024
89ac7e2
Merge branch 'nightly' into UOE-10005
Aug 19, 2024
9b152bf
Merge branch 'nightly' into UOE-10675
kapil-tuptewar Aug 21, 2024
02281ba
Sync with nightly
pm-nitin-shirsat Aug 26, 2024
3525837
Sync with nightly
pm-nitin-shirsat Aug 26, 2024
e4128d8
Merge pull request #548 from PubMatic/nightly
pm-nitin-shirsat Aug 26, 2024
ecb045b
removed the pwtpb key from ignore list
Aug 27, 2024
ab5393c
Merge pull request #549 from PubMatic/bidder_ord_cpg
pm-azhar-mulla Aug 30, 2024
2340f52
Merge pull request #550 from PubMatic/gpp/phase1/UOE-10929
pm-nitin-shirsat Sep 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Consuming buckets for custom PG
pm-azhar-mulla authored and pm-azhar-mulla committed Mar 5, 2024
commit 4ec83282eb3241f60e1635023ba270751d90c526
19 changes: 18 additions & 1 deletion src_new/config.js
Original file line number Diff line number Diff line change
@@ -292,7 +292,24 @@ exports.isReduceCodeSizeFeatureEnabled = function(){
};
// endRemoveIf(removeAlways)
exports.getPriceGranularity = function(){
return config[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY] || null;
var priceGranularity = config[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY] || null;

if (priceGranularity === CONSTANTS.COMMON.PRICE_GRANULARITY_CUSTOM) {
var bucketsValue = refThis.getPriceGranularityBuckets();
if(bucketsValue !== null) {
return bucketsValue;
} else {
util.logWarning(CONSTANTS.MESSAGES.M33);
return null;
}
}
else {
return priceGranularity;
}
};

exports.getPriceGranularityBuckets = function(){
return config[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY_BUCKETS] || null;
};

exports.getGranularityMultiplier = function(){
3 changes: 3 additions & 0 deletions src_new/constants.js
Original file line number Diff line number Diff line change
@@ -46,6 +46,8 @@ exports.COMMON = {
"TEST_GROUP_DETAILS": "testConfigDetails",
"TEST_PWT": "test_pwt",
"PRICE_GRANULARITY" : "priceGranularity",
"PRICE_GRANULARITY_CUSTOM" : "custom",
"PRICE_GRANULARITY_BUCKETS" : "priceGranularityBuckets",
"GRANULARITY_MULTIPLIER" : "granularityMultiplier",
"TEST_PARTNER": "test_adapters",
"REDUCE_CODE_SIZE": "reduceCodeSize",
@@ -217,6 +219,7 @@ exports.MESSAGES = {
"M30": "AB Test Enabled With Config",
"M31": "AB Test Enabled With Partner Config",
"M32": "Invalid MediaConfig regex pattern : ",
"M33": "Price Buckets should be set for custom price granularity",
IDENTITY: {
M1: "Unable to get User Id from OpenIdentity",
M2: "Setting UserIds to EB ",
50 changes: 49 additions & 1 deletion test/config.spec.js
Original file line number Diff line number Diff line change
@@ -2183,11 +2183,13 @@ describe('Config', function() {
describe('#getPriceGranularity',function(){
beforeEach(function(done){
CONF[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY] = "high";
sinon.spy(UTIL, "logWarning");
done();
});

afterEach(function(done){
delete CONF[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY] ;
delete CONF[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY];
UTIL.logWarning.restore();
done();
})

@@ -2207,6 +2209,52 @@ describe('Config', function() {
expect(CONFIG.getPriceGranularity()).to.equal(null);
done();
});

it('should return PriceGranularity Buckets if price granularity is custom', function(done){
CONF[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY] = 'custom';
CONF[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY_BUCKETS] = 'customBuckets';

expect(CONFIG.getPriceGranularity()).to.equal('customBuckets');
done();
});

it('should return null and log warning if Buckets are missing for custom price granularity', function(done){
CONF[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY] = 'custom';
delete CONF[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY_BUCKETS]

expect(CONFIG.getPriceGranularity()).to.equal(null);
UTIL.logWarning.calledWith(CONSTANTS.MESSAGES.M33).should.be.true;
done();
});
});

describe('#getPriceGranularityBuckets',function(){
beforeEach(function(done){
CONF[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY_BUCKETS] = "customBuckets";
done();
});

afterEach(function(done){
delete CONF[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY_BUCKETS];
done();
})

it('is a function', function(done) {
CONFIG.getPriceGranularityBuckets.should.be.a('function');
done();
});

it('should return the buckets by reading from config', function(done) {
var expectedResult = 'customBuckets';
CONFIG.getPriceGranularityBuckets().should.be.deep.equal(expectedResult);
done();
});

it('should return null if bucket is not present',function(done){
delete CONF[CONSTANTS.CONFIG.COMMON][CONSTANTS.COMMON.PRICE_GRANULARITY_BUCKETS];
expect(CONFIG.getPriceGranularityBuckets()).to.equal(null);
done();
});
});

describe('#getGranularityMultiplier',function(){