Skip to content

Commit 9fe580b

Browse files
Merge branch 'master' into master
2 parents f6178e4 + a361ae7 commit 9fe580b

File tree

430 files changed

+8241
-1277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

430 files changed

+8241
-1277
lines changed
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Rule Based Reviewer Assignment
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
permissions:
8+
pull-requests: write
9+
contents: read
10+
11+
jobs:
12+
assign_reviewers:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout base repo
17+
uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.base.ref }}
20+
fetch-depth: 2
21+
22+
- name: Get PR Author and Files Changed
23+
id: pr-info
24+
run: |
25+
# Get PR author
26+
echo "author=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV
27+
28+
FILES_CHANGED=$(GH_TOKEN="${{ secrets.PAT_CODE_REVIEWER_AUTOMATION }}" gh api \
29+
repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files \
30+
--jq '.[].filename')
31+
32+
CORE_FILES_CHANGED="false"
33+
for FILE in $FILES_CHANGED; do
34+
echo "$FILE"
35+
if [[ ! "$FILE" =~ ^modules/[^/]+$ && ! "$FILE" =~ ^test/ && ! "$FILE" =~ ^integrationExamples/ ]]; then
36+
CORE_FILES_CHANGED="true"
37+
echo "Found a core change"
38+
break
39+
fi
40+
done
41+
42+
echo "core_change=$CORE_FILES_CHANGED" >> $GITHUB_ENV
43+
44+
- name: Assign Reviewers Based on Rules
45+
run: |
46+
# Load PR author and core change flag
47+
AUTHOR=${{ env.author }}
48+
CORE_CHANGE=${{ env.core_change }}
49+
echo "PR Author: $AUTHOR"
50+
echo "Core Change: $CORE_CHANGE"
51+
52+
# Define groups
53+
PREBID_LEAD_ENG=("dgirardi")
54+
PREBID_ENG=("mkomorski")
55+
VOLUNTEERS=($(GH_TOKEN="${{ secrets.PAT_CODE_REVIEWER_AUTOMATION }}" gh api \
56+
-H "Accept: application/vnd.github+json" \
57+
-H "X-GitHub-Api-Version: 2022-11-28" \
58+
/orgs/prebid/teams/pbjs-reviewers/members \
59+
--jq '.[].login'))
60+
MEMBERS=("3link" "abazylewicz-id5" "Abyfall" "adserver-online" "aleksatr" "alexander-kislitsyn" "AlexBVolcy" "AlexisBRENON" "alexsavelyev" "anastasiiapankivFS" "And1sS" "andre-gielow-ttd" "andreacastello" "andrewmarriott-aws" "andyblackwell" "ankit-thanekar007" "AntoxaAntoxic" "apukh-magnite" "arielmtk" "armando-fs" "AvinashKapre" "bbaresic" "BenBoonsiri" "bjorn-lw" "bokelley" "bretg" "bsardo" "Bugxyb" "bwnodak" "bwschmidt" "carlosfelix" "cciocov" "ccorbo" "chicoman25" "Compile-Ninja" "CTMBNara" "danielsao" "dbemiller" "dbridges12" "decaffeinatedio" "deepthivenkat" "el-chuck" "EmilNadimanov" "Enigo" "EvgeniiMunin" "farukcam" "fatihkaya84" "Fawke" "fliccione" "FlorentDancy" "florianerl" "freestarjonny" "Fuska1" "gargcreation1992" "Gershon-Brainin" "gilbertococchi" "github-matthieu-wipliez" "github-mickael-leclerc" "github-richard-depierre" "gmcgrath11" "gmiedlar-ox" "gpolaert" "guscarreon" "gwhigs" "harpere" "harrykingriches" "headertag" "heatherboveri" "hhhjort" "hjeong12" "ianwow" "idettman" "ikp4success" "IrinLen" "jaiminpanchal27" "jclou" "jdcauley" "jdelhommeau" "jdwieland8282" "jefftmahoney" "jeremy-greenbids" "jerrycychen" "JimTharioAmazon" "jlaso" "jlquaccia" "jlukas79" "jlustig11" "jney" "joedrew" "JoelPM" "johnwier" "JonGoSonobi" "jsnellbaker" "jsut" "justadreamer" "jwrosewell" "kamermans" "kapil-tuptewar" "katherynhrabik" "khang-vu-ttd" "kim-ng93" "kiril-kalchev" "kkharma" "kvnsw" "laurb9" "lcorrigall" "linux019" "lksharma" "lpagnypubstack" "lucor" "MaksymTeqBlaze" "mansinahar" "marki1an" "matthewlane" "MaxSmileWanted" "mbellomi" "mercuryyy" "michachen" "Miroku87" "mkendall07" "mmoschovas" "mmullin" "monis0395" "monisq" "muuki88" "mwilsonmagnite" "nassimlounadi" "ncolletti" "Net-burst" "nhedley" "nicgallardo" "nickllerandi" "NikhilGopalChennissery" "OlenaPostindustria" "ollyburns" "omerDotan" "onkarvhanumante" "optidigital-prebid" "oronno" "osazos" "osulzhenko" "ourcraig" "passani" "patmmccann" "paulborile" "pb-pete" "pdamoc" "peixunzhang" "piotrj-rtbh" "pkowalski-id5" "pm-abhinav-deshpande" "pm-asit-sahoo" "pm-azhar-mulla" "pm-harshad-mane" "pm-isha-bharti" "pm-jaydeep-mohite" "pm-kapil-tuptewar" "pm-komal-kumari" "pm-manasi-moghe" "pm-nikhil-vaidya" "pm-nitin-nimbalkar" "pm-nitin-shirsat" "pm-priyanka-bagade" "pm-priyanka-deshmane" "pm-saurabh-narkhede" "pm-shivam-soni" "pm-tanishka-vishwakarma" "pm-viral-vala" "Pratik3307" "protonate" "Pubmatic-Dhruv-Sonone" "PubMatic-OpenWrap" "Pubmatic-Supriya-Patil" "PyjamaWarrior" "QuentinGallard" "rBeefrz" "richmtk" "rickyblaha" "rimaburder-index" "rishi-parmar" "rmloveland" "robertrmartinez" "schernysh" "scr-oath" "sebastienrufiange" "sebmil-daily" "sergseven" "shahinrahbariasl" "ShriprasadM" "sigma-software-prebid" "SKOCHERI" "smenzer" "snapwich" "softcoder594" "sonali-more-xandr" "ssundahlTTD" "StavBenShlomoBrowsi" "stephane-ein" "teads-antoine-azar" "tej656" "teqblaze-yurii" "thyagram-aws" "ValentinPostindustria" "VeronikaSolovei9" "vivekyadav15" "vkimcm" "vraybaud" "wi101" "yq-yang-qin" "ysfbsf" "YuriyVelichkoPI" "yuva-inmobi-1" "zapo" "zhongshixi" "zxPhoenix")
61+
62+
# Helpers
63+
pick_random_from_group() {
64+
local group=("$@")
65+
echo "${group[$RANDOM % ${#group[@]}]}"
66+
}
67+
68+
pick_random_from_group_excluding() {
69+
local excludes_str="$1"
70+
shift
71+
local group=("$@")
72+
IFS=" " read -r -a excludes <<< "$excludes_str"
73+
74+
local filtered=()
75+
for user in "${group[@]}"; do
76+
local skip=false
77+
for ex in "${excludes[@]}"; do
78+
if [[ "$user" == "$ex" ]]; then
79+
skip=true
80+
break
81+
fi
82+
done
83+
if [[ "$skip" == false ]]; then
84+
filtered+=("$user")
85+
fi
86+
done
87+
88+
if [[ ${#filtered[@]} -eq 0 ]]; then
89+
echo ""
90+
else
91+
echo "${filtered[$RANDOM % ${#filtered[@]}]}"
92+
fi
93+
}
94+
95+
REVIEWERS=()
96+
97+
if [[ " ${PREBID_LEAD_ENG[@]} " =~ " ${AUTHOR} " ]]; then
98+
# Prebid Lead authored --> 2 Reviewers (Non-Lead Prebid + Volunteer)
99+
echo "Prebid Lead engineer authored the PR"
100+
REVIEWERS+=("$(pick_random_from_group "${PREBID_ENG[@]}")")
101+
REVIEWERS+=("$(pick_random_from_group "${VOLUNTEERS[@]}")")
102+
elif [[ " ${PREBID_ENG[@]} " =~ " ${AUTHOR} " ]]; then
103+
echo "Prebid engineer authored the PR"
104+
# Any other Prebid engineer authored --> 2 Reviewers (Lead Prebid + Volunteer)
105+
REVIEWERS+=("${PREBID_LEAD_ENG[0]}")
106+
REVIEWERS+=("$(pick_random_from_group "${VOLUNTEERS[@]}")")
107+
elif [[ "$CORE_CHANGE" == "true" ]]; then
108+
# Core rules apply to anyone else --> 2 Reviewers (Lead Prebid + Volunteer)
109+
echo "Core change detected, applying core rules"
110+
REVIEWERS+=("${PREBID_LEAD_ENG[0]}")
111+
REVIEWERS+=("$(pick_random_from_group_excluding "$AUTHOR" "${VOLUNTEERS[@]}")")
112+
elif [[ " ${MEMBERS[@]} " =~ " ${AUTHOR} " ]]; then
113+
echo "Non-core, member authored"
114+
# Non-core, member authored --> 1 Reviewer (Non-Lead Prebid)
115+
REVIEWERS+=("$(pick_random_from_group "${PREBID_ENG[@]}")")
116+
else
117+
echo "Non-core, non-member authored"
118+
# Non-core, non-member authored --> 1 Reviewer (Volunteer)
119+
REVIEWERS+=("$(pick_random_from_group_excluding "$AUTHOR" "${VOLUNTEERS[@]}")")
120+
fi
121+
122+
echo "Reviewers selected: ${REVIEWERS[@]}"
123+
124+
# Assign reviewers using gh api
125+
for R in "${REVIEWERS[@]}"; do
126+
if [[ -n "$R" ]]; then
127+
echo "Assigning reviewer: $R"
128+
gh api \
129+
--method POST \
130+
-H "Accept: application/vnd.github+json" \
131+
-H "X-GitHub-Api-Version: 2022-11-28" \
132+
repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers \
133+
-f reviewers[]="$R"
134+
fi
135+
done
136+
137+
env:
138+
GITHUB_TOKEN: ${{ secrets.PAT_CODE_REVIEWER_AUTOMATION }}

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
# Initializes the CodeQL tools for scanning.
4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@v3
45+
uses: github/codeql-action/init@v4
4646
with:
4747
languages: ${{ matrix.language }}
4848
config-file: ./.github/codeql/codeql-config.yml
@@ -57,7 +57,7 @@ jobs:
5757
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5858
# If this step fails, then you should remove it and run the build manually (see below)
5959
- name: Autobuild
60-
uses: github/codeql-action/autobuild@v3
60+
uses: github/codeql-action/autobuild@v4
6161

6262
# ℹ️ Command-line programs to run using the OS shell.
6363
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -70,4 +70,4 @@ jobs:
7070
# ./location_of_script_within_repo/buildscript.sh
7171

7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/analyze@v3
73+
uses: github/codeql-action/analyze@v4

.github/workflows/test-chunk.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,15 @@ jobs:
5555
key: ${{ inputs.wdir }}
5656
fail-on-cache-miss: true
5757

58+
- name: Start BrowserstackLocal
59+
run: |
60+
./BrowserStackLocal --key $BROWSERSTACK_ACCESS_KEY --daemon start
61+
5862
- name: Run tests
5963
uses: nick-fields/retry@v3
6064
with:
6165
timeout_minutes: 8
62-
max_attempts: 3
66+
max_attempts: 1
6367
command: ${{ inputs.cmd }}
6468

6569
- name: Save working directory

.github/workflows/test.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ jobs:
5555
- name: Install dependencies
5656
run: npm ci
5757

58+
- name: Download Browserstack binary
59+
run: |
60+
wget https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip
61+
unzip BrowserStackLocal-linux-x64.zip
62+
5863
- name: Cache source
5964
uses: actions/cache/save@v4
6065
with:
@@ -132,11 +137,16 @@ jobs:
132137
path: .
133138
key: source-${{ github.run_id }}
134139
fail-on-cache-miss: true
140+
141+
- name: Start BrowserstackLocal
142+
run: |
143+
./BrowserStackLocal --key $BROWSERSTACK_ACCESS_KEY --daemon start
144+
135145
- name: Run tests
136146
uses: nick-fields/retry@v3
137147
with:
138-
timeout_minutes: 10
139-
max_attempts: 3
148+
timeout_minutes: 20
149+
max_attempts: 1
140150
command: npx gulp e2e-test
141151

142152
coveralls:

eslint.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ module.exports = [
151151
'jsdoc/tag-lines': 'off',
152152
'no-var': 'off',
153153
'no-void': 'off',
154-
'array-callback-return': 'off',
155154
'prefer-const': 'off',
156155
'no-prototype-builtins': 'off',
157156
'object-shorthand': 'off',

integrationExamples/gpt/x-domain/creative.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// creative will be rendered, e.g. GAM delivering a SafeFrame
33

44
// this code is autogenerated, also available in 'build/creative/creative.js'
5-
<script>(()=>{"use strict";const e="Prebid Event",n=(()=>{const e={frameBorder:0,scrolling:"no",marginHeight:0,marginWidth:0,topMargin:0,leftMargin:0,allowTransparency:"true"};return(n,t)=>{const r=n.createElement("iframe");return Object.entries(Object.assign({},t,e)).forEach(e=>{let[n,t]=e;return r.setAttribute(n,t)}),r}})();function t(e){return!!e.frames.__pb_locator__}window.pbRender=function(r){let o=r.parent;try{for(;o!==r.top&&!t(o);)o=o.parent;t(o)||(o=r.parent)}catch(e){}return function(t){let{adId:s,pubUrl:i,clickUrl:a}=t;const c=new URL(i,window.location).origin;function d(e,n,t){const r=new MessageChannel;r.port1.onmessage=u(t),o.postMessage(JSON.stringify(Object.assign({message:e,adId:s},n)),c,[r.port2])}function l(n){d(e,{event:"adRenderFailed",info:{reason:n?.reason||"exception",message:n?.message}}),n?.stack&&console.error(n)}function u(e){return function(){try{return e.apply(this,arguments)}catch(e){l(e)}}}d("Prebid Request",{options:{clickUrl:a}},function(t){let o;try{o=JSON.parse(t.data)}catch(e){return}if("Prebid Response"===o.message&&o.adId===s){const t=n(r.document,{width:0,height:0,style:"display: none"});t.onload=u(function(){const s=t.contentWindow;s.Promise.resolve(s.render(o,{sendMessage:d,mkFrame:n},r)).then(()=>d(e,{event:"adRenderSucceeded"}),l)}),t.srcdoc=`<script>${o.renderer}<\/script>`,r.document.body.appendChild(t)}})}}(window)})();</script>
5+
<script>(()=>{"use strict";const e="Prebid Event",n=(()=>{const e={frameBorder:0,scrolling:"no",marginHeight:0,marginWidth:0,topMargin:0,leftMargin:0,allowTransparency:"true"};return(n,t)=>{const r=n.createElement("iframe");return Object.entries(Object.assign({},t,e)).forEach(e=>{let[n,t]=e;return r.setAttribute(n,t)}),r}})();function t(e){return!!e.frames.__pb_locator__}window.pbRender=function(r){let o=r.parent;try{for(;o!==r.top&&!t(o);)o=o.parent;t(o)||(o=r.parent)}catch(e){}return function(t){let{adId:s,pubUrl:i,clickUrl:c}=t;const a=new URL(i,window.location).origin;function d(e,n,t){const r=new MessageChannel;r.port1.onmessage=u(t),o.postMessage(JSON.stringify(Object.assign({message:e,adId:s},n)),a,[r.port2])}function l(n){d(e,{event:"adRenderFailed",info:{reason:(null==n?void 0:n.reason)||"exception",message:null==n?void 0:n.message}}),(null==n?void 0:n.stack)&&console.error(n)}function u(e){return function(){try{return e.apply(this,arguments)}catch(e){l(e)}}}d("Prebid Request",{options:{clickUrl:c}},function(t){let o;try{o=JSON.parse(t.data)}catch(e){return}if("Prebid Response"===o.message&&o.adId===s){const t=n(r.document,{width:0,height:0,style:"display: none"});t.onload=u(function(){const s=t.contentWindow;s.Promise.resolve(s.render(o,{sendMessage:d,mkFrame:n},r)).then(()=>d(e,{event:"adRenderSucceeded"}),l)}),t.srcdoc="<script>".concat(o.renderer,"<\/script>"),r.document.body.appendChild(t)}})}}(window)})();</script>
66

77
<script>
88
pbRender({

libraries/advangUtils/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { generateUUID, isFn, parseSizesInput, parseUrl } from '../../src/utils.js';
2+
import { getDNT as getNavigatorDNT } from '../navigatorData/dnt.js';
23
import { config } from '../../src/config.js';
34

45
export const DEFAULT_MIMES = ['video/mp4', 'application/javascript'];
@@ -45,8 +46,8 @@ export function isConnectedTV() {
4546
return (/(smart[-]?tv|hbbtv|appletv|googletv|hdmi|netcast\.tv|viera|nettv|roku|\bdtv\b|sonydtv|inettvbrowser|\btv\b)/i).test(navigator.userAgent);
4647
}
4748

48-
export function getDoNotTrack() {
49-
return navigator.doNotTrack === '1' || window.doNotTrack === '1' || navigator.msDoNoTrack === '1' || navigator.doNotTrack === 'yes';
49+
export function getDoNotTrack(win = typeof window !== 'undefined' ? window : undefined) {
50+
return getNavigatorDNT(win);
5051
}
5152

5253
export function findAndFillParam(o, key, value) {
@@ -144,7 +145,7 @@ export function createRequestData(bid, bidderRequest, isVideo, getBidParam, getS
144145
const o = {
145146
'device': {
146147
'langauge': (global.navigator.language).split('-')[0],
147-
'dnt': (global.navigator.doNotTrack === 1 ? 1 : 0),
148+
'dnt': getDoNotTrack(global) ? 1 : 0,
148149
'devicetype': isMobile() ? 4 : isConnectedTV() ? 3 : 2,
149150
'js': 1,
150151
'os': getOsVersion()
@@ -169,7 +170,7 @@ export function createRequestData(bid, bidderRequest, isVideo, getBidParam, getS
169170
o.site['ref'] = topReferrer;
170171
o.site['mobile'] = isMobile() ? 1 : 0;
171172
const secure = topLocation.protocol.indexOf('https') === 0 ? 1 : 0;
172-
o.device['dnt'] = getDoNotTrack() ? 1 : 0;
173+
o.device['dnt'] = getDoNotTrack(global) ? 1 : 0;
173174

174175
findAndFillParam(o.site, 'name', function() {
175176
return global.top.document.title;

libraries/dnt/index.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
function isDoNotTrackActive(value) {
2+
if (value == null) {
3+
return false;
4+
}
5+
6+
if (typeof value === 'string') {
7+
const normalizedValue = value.toLowerCase();
8+
return normalizedValue === '1' || normalizedValue === 'yes';
9+
}
10+
11+
return value === 1;
12+
}
13+
14+
function getTopWindow(win) {
15+
try {
16+
return win.top;
17+
} catch (error) {
18+
return win;
19+
}
20+
}
21+
22+
export function getDNT(win = window) {
23+
const valuesToInspect = [];
24+
25+
if (!win) {
26+
return false;
27+
}
28+
29+
const topWindow = getTopWindow(win);
30+
31+
valuesToInspect.push(win.doNotTrack);
32+
33+
if (topWindow && topWindow !== win) {
34+
valuesToInspect.push(topWindow.doNotTrack);
35+
}
36+
37+
const navigatorInstances = new Set();
38+
39+
if (win.navigator) {
40+
navigatorInstances.add(win.navigator);
41+
}
42+
43+
if (topWindow && topWindow.navigator) {
44+
navigatorInstances.add(topWindow.navigator);
45+
}
46+
47+
navigatorInstances.forEach(navigatorInstance => {
48+
valuesToInspect.push(navigatorInstance.doNotTrack, navigatorInstance.msDoNotTrack);
49+
});
50+
51+
return valuesToInspect.some(isDoNotTrackActive);
52+
}

libraries/extraWinDimensions/extraWinDimensions.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

libraries/mediaImpactUtils/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export function getUserSyncs(syncOptions, serverResponses, gdprConsent, uspConse
123123

124124
serverResponses.forEach(resp => {
125125
if (resp.body) {
126-
Object.keys(resp.body).map(key => {
126+
Object.keys(resp.body).forEach(key => {
127127
const respObject = resp.body[key];
128128
if (
129129
respObject['syncs'] !== undefined &&

0 commit comments

Comments
 (0)