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

Update Prebid.sj to Most Recent Version #21

Merged
merged 183 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
cb91a7c
Support for cids (#11713)
MartinGumGum Jun 5, 2024
f4c0b7b
Add plmct (#11706)
Rothalack Jun 5, 2024
2853602
pass user.geo and device.geo to payload (#11723)
aivanov-zeta Jun 6, 2024
8556426
KRKPD-1247: sends refererInfo to Kraken (#36) (#11725)
nickllerandi Jun 6, 2024
577e8a2
RelevateHealth Bid Adapter : Initial release (#11640)
hasanideepak Jun 6, 2024
03d7059
UID2: Remove obsolete optout-check code for EUID (#11709)
ssundahlTTD Jun 6, 2024
3002377
Consumable Bid Adapter: add language to request (#11722)
jpiros Jun 6, 2024
e3ea280
AMX Bid Adapter: add support for overriding bidderCode (allowAlternat…
nickjacob Jun 7, 2024
203ebe5
Cee id System: add custom token name and optional value to pass (#11547)
decemberWP Jun 7, 2024
903b9ad
TheAdx Bid Adapter : eids support added (#11681)
mustafakemal16 Jun 7, 2024
bf3af24
SeedingAlliance Bid Adapter : get and set UUID and read EIDs where ap…
sag-henmus Jun 7, 2024
031f96b
MGIDX Adapter: Update (#11728)
xmgiddev Jun 7, 2024
e94e081
Insticator adapter update with publisherId param (#11733)
shashidhar-insticator Jun 7, 2024
090863f
Yieldmo Bid Adapter: Prevent Consent Override and Eids fix (#11734)
desidiver Jun 7, 2024
dc01e40
Cleanmedianet Bid Adapter : update Placement to plcmt (#11698)
CleanMediaNet Jun 8, 2024
b3fbd02
AdHash Bid Adapter: brand safety changes (#11617)
wyand-sp Jun 8, 2024
5985642
Github action: Create jscpd.yml (#11738)
patmmccann Jun 8, 2024
869696d
GitHub action: report on code dupe (#11739)
patmmccann Jun 8, 2024
77a96f6
Update how key-values are passed into ad server (#11721)
antosarho Jun 9, 2024
1211c5c
GitHub action: update node (#11741)
patmmccann Jun 9, 2024
990e4e8
Update jscpd.yml (#11742)
patmmccann Jun 9, 2024
ba94bca
loyal: fix tests filename (#11743)
patmmccann Jun 9, 2024
1fc387a
Github Actions: fail the pr if duplication found (#11744)
patmmccann Jun 9, 2024
d215211
Update jscpd.yml (#11747)
patmmccann Jun 10, 2024
19e9c99
Github Actions: fix commenting on pr's from forks (#11751)
patmmccann Jun 10, 2024
33663e9
Github actions: Update jscpd.yml to actually fix commenting (#11753)
patmmccann Jun 10, 2024
e2c30ff
Update jscpd.yml (#11755)
patmmccann Jun 10, 2024
7bdab2b
Update jscpd.yml
patmmccann Jun 10, 2024
6ba49e6
Code duplication: Update jscpd.yml to run in repo context (#11757)
patmmccann Jun 10, 2024
a96643f
Adot Bid Adapter: remove video.placement (#11771)
khouajaSadok Jun 12, 2024
f61da87
json-deep-clone (#11768)
bbaresic Jun 12, 2024
df57b81
Relaido Bid Adapter : add placementId to renderAd parameters (#11769)
relaido Jun 12, 2024
12e2e1c
PBjs Core and Tests : fix spurious tests (#11767)
dgirardi Jun 12, 2024
236a8ad
Smartyads Analytics Adapter : initial release (#11397)
rishko00 Jun 12, 2024
69d7906
feat(analytics): retrieve cpm and currency from bids (#11774)
maelmrgt Jun 12, 2024
13c3dbb
Added DSA support for smaato adapter (#11789)
tetianaatsmaato Jun 13, 2024
f7726ec
Conversant Bid Adapter: handle paapi data in the response (#11663)
johnwier Jun 13, 2024
ab23840
Update jscpd.yml (#11793)
dgirardi Jun 13, 2024
5126673
CI: improve duplicate checker comment (#11794)
dgirardi Jun 13, 2024
19131b9
Build system: increase heap size for test-coverage (#11792)
dgirardi Jun 13, 2024
8466868
Magnite Analytics: Minor fix for default rule name (#11791)
robertrmartinez Jun 13, 2024
646f79d
OrtbConverter: PBS Extension: Alias GVL ID (#11699)
robertrmartinez Jun 13, 2024
e8be790
Greenbids Analytics Adapter : send params field to payload. (#11642)
maelmrgt Jun 13, 2024
7ded2b7
Discovery Bid Adapter : fix window.top bug (#11511)
lhxx121 Jun 13, 2024
fd40156
Yandex: add id system (#11196)
chernodub Jun 13, 2024
0c0bc0e
Prebid 8.52.0 release
prebidjs-release Jun 13, 2024
babd603
Increment version to 8.52.1-pre
prebidjs-release Jun 13, 2024
c3a594d
Prebid 9.0 - Breaking Changes (#11720)
patmmccann Jun 13, 2024
7fdc9d5
Prebid 9.0.0 release
prebidjs-release Jun 13, 2024
566c48f
Increment version to 9.1.0-pre
prebidjs-release Jun 13, 2024
5b0e6b8
Mgid Bid Adapter : don't throw error without floors module (#11796)
patmmccann Jun 14, 2024
560ad53
Smaato: Add DOOH support (#11801)
Enigo Jun 15, 2024
02e1581
Real Time Data Module: Mobian Brand Safety (#11798)
ehb-mtk Jun 15, 2024
f43411f
Update .nvmrc (#11808)
muuki88 Jun 16, 2024
eedcb05
Setupad adapter: param change and minor fixes (#11770)
eldzis Jun 16, 2024
8e1d5a7
ZetaGlobalSsp Analytics Adapter : provide adUnitCode (#11812)
orazumov-zeta Jun 17, 2024
3ecb1f4
Update novatiqIdSystem.md (just resolved problem with syntax) (#11816)
senaev Jun 17, 2024
03d4162
Dailymotion Bid Adapter: fix content cat type (#11818)
kvnsw Jun 18, 2024
3268156
Update richaudienceBidAdapter.md (#11826)
richaudience Jun 18, 2024
7bad57e
Richaudience Bid Adapter: add adapter JS file (#11827)
richaudience Jun 18, 2024
c2a9785
Prebid 9.1.0 release
prebidjs-release Jun 18, 2024
b03ca3d
Increment version to 9.2.0-pre
prebidjs-release Jun 18, 2024
a6b235a
Core: fix video cache silent failure (#11781)
dgirardi Jun 19, 2024
b350eab
ID5 UserId module - integrate with TrueLink Id (#11802)
abazylewicz-id5 Jun 19, 2024
4fb10cd
Utils: add `getDomLoadingDuration()` to remove dupe code (#11831)
osazos Jun 19, 2024
ede12d2
sends gpid into seedtag adapter payload (#11832)
sangarbe Jun 19, 2024
4bf11bd
SmartytechBidAdapter: Add meta (#11815)
nalexand Jun 19, 2024
eacd24e
Ozone Bid Adapter: add support for GPP Module & updates (#11648)
AskRupert-DM Jun 19, 2024
0668544
Adagio Rtd Provider: add missing signal at ortb2.site.ext.data.adg_rt…
osazos Jun 19, 2024
cdda91b
Update pubxaiAnalyticsAdapter.js (#11830)
patmmccann Jun 20, 2024
e132450
nobid Analytics Adapter : import logMessage (#11833)
patmmccann Jun 20, 2024
1a8b993
Loyal Bid Adapter : no error without floors module (#11834)
patmmccann Jun 20, 2024
e647c39
update rayn rtd provider module with rayn persona taxonomy (#11841)
aleksandar-rayn Jun 20, 2024
2efc834
Setupad adapter: Use ortbConverter (#11842)
eldzis Jun 20, 2024
77303f4
AdagioRtdProvider: add to .submodules.json (#11846)
osazos Jun 20, 2024
27a2d3b
PAAPI: fix perBuyerSignals + topicsFpdModule: fix exception (#11845)
dgirardi Jun 20, 2024
0ee1ba7
Adagio*: add adagioUtils.js, remove duplicated code (#11849)
osazos Jun 20, 2024
9dc08c5
Prebid Server Bid Adapter : Support for custom headers for XHR call (…
sanved77 Jun 20, 2024
d4cae0a
Autoplay detection: fix fullscreen issue on iOS (#11822)
github-matthieu-wipliez Jun 21, 2024
4478591
fix API endpoint in Mobian RTD module (#11850)
ehb-mtk Jun 21, 2024
1f8af9e
Add new appnexus alias stailamedia (#11852)
Pubstream Jun 21, 2024
a4a6de8
PubMatic Analytics Adapter : Logging MultiBids from bidders (#11844)
pm-azhar-mulla Jun 21, 2024
b92bff3
AdagioRtdProvider: add placementSource param (#11779)
osazos Jun 21, 2024
8000f23
PBS adapter: fix bug where incorrect bidderCode is used on certain br…
dgirardi Jun 22, 2024
850e0e2
Libraries: New utility file to Remove code duplication in several ada…
MaksymTeqBlaze Jun 22, 2024
124fa0a
Prebid Core: TTL counts only when page is active (#11803)
mkomorski Jun 23, 2024
98801df
Conversant Bid Adapter: send request in USD (#11857)
johnwier Jun 24, 2024
2cbeb80
improve-server-bid-adapter-error-message (#11858)
bbaresic Jun 24, 2024
ea36465
Prebid 9.2.0 release
prebidjs-release Jun 24, 2024
64729a1
Increment version to 9.3.0-pre
prebidjs-release Jun 24, 2024
743e749
orbidderBidAdapter.js: remove mediaType video to avoid broken request…
renebaudisch Jun 25, 2024
d8937d7
consentManagementTcf: add flag to set dsarequired (#11824)
dgirardi Jun 25, 2024
980a11e
Various modules: don't import global to get version (#11836)
patmmccann Jun 25, 2024
ac3f0e8
Seedtag - add device.sua parameter to the bidRequest (#11856)
ybootin Jun 25, 2024
8e27b09
Copper6SSP: new adapter (#11809)
Copper6SSP Jun 26, 2024
c533b08
New Adapter: Oraki (#11727)
BenOraki Jun 26, 2024
92c77f5
criteoBidAdapter.js: allow plcmt instead of placement (#11819)
patmmccann Jun 26, 2024
0ea2add
Vidazoo Adapter: save and send first request time (#11821)
uditalias Jun 26, 2024
1131a90
SmartyadsBidAdapter remove usprivacy (#11829)
rishko00 Jun 26, 2024
a3455e5
Adds advertiserTransparency as an option. (#11866)
antosarho Jun 26, 2024
281b99f
Update liveIntentIdSystem.js (#11873)
patmmccann Jun 26, 2024
ff488d9
yahooAdsBidAdapter.js: add gvl to alias (#11871)
patmmccann Jun 26, 2024
ad2af8f
userID: better config validation (#11872)
dgirardi Jun 26, 2024
2c8811a
Intent iq id submodule: various enhancements (#11765)
DimaIntentIQ Jun 27, 2024
f6e1008
Update pairIdSystem.js: add defensive code before json parse (#11870)
patmmccann Jun 27, 2024
c1c1a76
s2s config formatted correctly (#11878)
edmonl Jun 27, 2024
1771824
Smartadserver Bid Adapter: disable Sec-Browsing-Topics for calls to S…
janzych-smart Jun 27, 2024
8ef5719
Prebid 9.3.0 release
prebidjs-release Jun 27, 2024
2f72b57
Increment version to 9.4.0-pre
prebidjs-release Jun 27, 2024
75e3375
viantOrtbBidAdapter': deals support (#11864)
skapoor-viant Jun 28, 2024
c1fbae1
ZetaGlobalSsp adapter: merge ortb2.site and params.site (#11773)
asurovenko-zeta Jun 28, 2024
6660561
cpmstarBidAdapter: added gvlid, additional request data (#11881)
JoshuaMGoldstein Jun 28, 2024
ca24c39
Visx bid adapter: import utilities and retrieve data from user on ort…
Goncakkd Jun 28, 2024
795e92b
Update ozoneBidAdapter.js (#11885)
AskRupert-DM Jun 28, 2024
67774de
AdagioRtdProvider: ensure fallback when adUnit.ortb2Imp is missing (#…
osazos Jun 28, 2024
0c560a3
Dailymotion bid adapter: Fix user sync parsing (#11887)
sebmil-daily Jun 28, 2024
d236eb1
Various Adapters: Use Vidazoo utils lib to remove code duplications (…
uditalias Jun 30, 2024
4f2ae43
Core: add location method for cross-frame creatives and update creati…
dgirardi Jul 1, 2024
3192ed1
Outbrain adapter: send placement and plcmt fields separately (#11799)
markkuhar Jul 1, 2024
41df410
Outbrain bid adapter add ortb2 device (#11748)
jwrosewell Jul 1, 2024
8c447c3
Prebid 9.4.0 release
prebidjs-release Jul 1, 2024
344e187
Increment version to 9.5.0-pre
prebidjs-release Jul 1, 2024
4e470c5
AdagioBidAdapter: fix typo (#11895)
osazos Jul 1, 2024
5caa7fc
create site.ext.data when it doesn't exist (#11902)
ehb-mtk Jul 2, 2024
ac95edb
Fix typo for GDPR/GPDR (#11908)
JulieLorin Jul 2, 2024
2ef1861
Adkernel Bid Adapter: add globalsun alias (#11907)
ckbo3hrk Jul 2, 2024
ecd9a7b
Report resize warning as error (#11896)
Sir-Will Jul 2, 2024
56b798a
update eslint jsdoc plugin (#11909)
chernodub Jul 2, 2024
96cfb46
Admixer Bid Adapter: change admixerwl to rtbstack alias (#11905)
dariaboyko Jul 2, 2024
33373f0
[JW Player Video Provider][Video JS Video Provider]: Add missing type…
karimMourra Jul 2, 2024
082ee5f
GumGum Bid Adapter: Send ae parameter in the request (#11913)
MartinGumGum Jul 2, 2024
85d38aa
symitriDapRtdProvider : initial release and update akamaiDapRTD to im…
jpalladino84 Jul 2, 2024
97687dd
fix: use error-prone reference to crypto module (#11882)
chernodub Jul 2, 2024
8984260
add gpid to imp ext (#11916)
Gaudeamus Jul 3, 2024
7458aeb
JW Player RTD Module : fallback to lone player on page (#11186)
karimMourra Jul 3, 2024
9529ae3
Anonymised RTD: Added Global Vendor List ID (#11919)
kyrylenko Jul 3, 2024
e0a8c58
permutiveRtd : transform integers to strings (#11910)
AntonioGargaro Jul 3, 2024
a2a9a22
AF-3683 added currencies: CHF and SEK (#11923)
Goncakkd Jul 4, 2024
ed6a92b
Reduce log spamming (#11922)
muuki88 Jul 4, 2024
9bdc5d5
Supporting battr param to pubmaticBidAdapter in banner requests (#11917)
pm-nitin-shirsat Jul 4, 2024
0110b3c
PubxAi Analytics Adapter : code cleanup and additional data collectio…
pnhegde Jul 4, 2024
a4cc27c
Linter checks: dom manipulation, network traffic, and direct storage …
patmmccann Jul 4, 2024
8f817bd
Discovery Bid Adapter : add ext params (#11877)
ecoeco163 Jul 4, 2024
61b46af
AdmixerBidAdapter: rtbstack change endpointId to tagId (#11925)
dariaboyko Jul 5, 2024
42e55d0
Medianet Bid Adapter: passing uidsAsEids in adapter and log refactor …
adish1997 Jul 5, 2024
b6184e2
AdagioRtdProvider: add support for AB Testing (#11935)
osazos Jul 5, 2024
4422d44
Connatix Bid Adapter: Support For Video Media Type (#11933)
Alex404Damsa Jul 5, 2024
c30f105
AzerionEdge RTD Module: Compatibility with GDPR/USP Privacy Modules (…
garciapuig Jul 6, 2024
cfc2ed9
Playdigo: add user sync (#11939)
Yanivplaydigo Jul 8, 2024
ba3279e
Update jscpd.yml (#11940)
patmmccann Jul 8, 2024
3511b54
SmileWanted : add schain support (#11804)
QuentinGallard Jul 8, 2024
c140dc0
Adkernel Bid Adapter: add voisetech alias (#11942)
ckbo3hrk Jul 8, 2024
907fa73
CORE: check if the body is available before adding the locator iframe…
olafbuitelaar Jul 8, 2024
eada00f
Less aggressive linter check workflow (#11945)
dgirardi Jul 8, 2024
ba82380
DSPx Bid Adapter: add ortb2 content, topics support (#11941)
onlsol Jul 8, 2024
5d2fc68
IntentIQ Analytics Adapter: initial release (#11930)
DimaIntentIQ Jul 8, 2024
2a64490
UA utils: fix tests (#11947)
dgirardi Jul 8, 2024
e8964d4
Core: Add Session Storage Manager & Contxtful RTD Provider: use sessi…
sebastienrufiange Jul 8, 2024
c4360d3
Smaato: Add UserSyncs (#11932)
el-chuck Jul 9, 2024
b26107c
Validation module: jsdoc fixes (#11952)
patmmccann Jul 9, 2024
4343dda
AdvRed Analytics Adapter : initial release (#11703)
danoykin Jul 10, 2024
10fcd20
Dailymotion Bid Adapter: add consent enforcement to read the advertis…
kvnsw Jul 10, 2024
c8b4b5b
TargetVideo Bid Adapter : add video support (#11867)
danijel-ristic Jul 10, 2024
37d742c
Dynamic creatives: fix exception on rendering (#11956)
dgirardi Jul 10, 2024
5b4797e
Appnexus bid adapter add ortb2 device (#11788)
jwrosewell Jul 10, 2024
865252b
EightPod Bid Adapter + EightPod Analytic Adapter - Support multiple a…
GreDiSe Jul 11, 2024
ff15574
sizeMapping: do not require configuration (#11920)
dgirardi Jul 11, 2024
9b8b6e3
Core: Remove default value for unused timeoutBuffer config (#11960)
dgirardi Jul 11, 2024
5074acd
PAAPI: fix bug where configuration is not picked up correctly by the …
dgirardi Jul 11, 2024
efbf6ad
Update eightPodAnalyticsAdapter.js (#11962)
patmmccann Jul 11, 2024
1bd87b7
gptPreAuction: pass publisher provided signals to GPT (#11946)
mkomorski Jul 11, 2024
3ae8423
Prebid 9.5.0 release
prebidjs-release Jul 11, 2024
d285f79
Increment version to 9.6.0-pre
prebidjs-release Jul 11, 2024
af742ce
Adagio Bid Adapter|Analytics Adapter: use rtd uid as auctionid (#11958)
Abyfall Jul 12, 2024
85e6ef1
removes idx and loop to create 5 syncs (#37) (#11968)
nickllerandi Jul 12, 2024
20bf00e
AdagioBidAdapter: GPP: remove useless logic (#11971)
osazos Jul 12, 2024
eccf064
amxId fix (#11973)
gchicoye Jul 15, 2024
6a85621
AdagioAnalyticsAdapter: send PBA for all auctions (#11961)
Abyfall Jul 15, 2024
57f7453
add global clearAllAuctions method (#11912)
mmoschovas Jul 16, 2024
ef9388f
ConnectIdSystem.js: fix storage bypass (#11964)
patmmccann Jul 16, 2024
62f50cb
Smarthub bid adapter: alias vimayx (#11874)
SmartHubSolutions Jul 16, 2024
db59494
uid2IdSystem_shared.js : better logging messages (#11969)
patmmccann Jul 16, 2024
bb5dcef
Rise utils: initial commit (#11951)
patmmccann Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ aliases:
- &environment
docker:
# specify the version you desire here
- image: cimg/node:16.20-browsers
- image: cimg/node:20.14.0-browsers
resource_class: xlarge
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand All @@ -18,8 +18,6 @@ aliases:
- &restore_dep_cache
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- &save_dep_cache
paths:
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG VARIANT="12"
ARG VARIANT="20"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:${VARIANT}

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor > /usr/share/keyrings/yarn-archive-keyring.gpg
Expand Down
38 changes: 38 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports = {
'no-useless-escape': 'off',
'no-console': 'error',
'jsdoc/check-types': 'off',
'jsdoc/no-defaults': 'off',
'jsdoc/newline-after-description': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
Expand Down Expand Up @@ -89,11 +90,48 @@ module.exports = {
name: 'require',
message: 'use import instead'
}
],
'prebid/no-global': [
'error',
...['localStorage', 'sessionStorage'].map(name => ({name, message: 'use storageManager instead'})),
{
name: 'XMLHttpRequest',
message: 'use ajax.js instead'
},
],
'prebid/no-member': [
'error',
{
name: 'cookie',
target: 'document',
message: 'use storageManager instead'
},
{
name: 'sendBeacon',
target: 'navigator',
message: 'use ajax.js instead'
},
...['outerText', 'innerText'].map(name => ({
name,
message: 'use .textContent instead'
}))
]
}
})).concat([{
// code in other packages (such as plugins/eslint) is not "seen" by babel and its parser will complain.
files: 'plugins/*/**/*.js',
parser: 'esprima'
}, {
files: '**BidAdapter.js',
rules: {
'no-restricted-imports': [
'error', {
patterns: [
'**/src/events.js',
'**/src/adloader.js'
]
}
]
}
}])
};
124 changes: 124 additions & 0 deletions .github/workflows/jscpd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Check for Duplicated Code

on:
pull_request_target:
branches:
- master

jobs:
check-duplication:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: |
npm install -g jscpd diff-so-fancy

- name: Create jscpd config file
run: |
echo '{
"threshold": 20,
"minTokens": 50,
"reporters": [
"json"
],
"output": "./",
"pattern": "**/*.js",
"ignore": "**/*spec.js"
}' > .jscpd.json

- name: Run jscpd on entire codebase
run: jscpd

- name: Fetch base and target branches
run: |
git fetch origin +refs/heads/${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }}
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/merge:refs/remotes/pull/${{ github.event.pull_request.number }}/merge

- name: Get the diff
run: git diff --name-only origin/${{ github.event.pull_request.base.ref }}...refs/remotes/pull/${{ github.event.pull_request.number }}/merge > changed_files.txt

- name: List generated files (debug)
run: ls -l

- name: Upload unfiltered jscpd report
if: always()
uses: actions/upload-artifact@v4
with:
name: unfiltered-jscpd-report
path: ./jscpd-report.json

- name: Filter jscpd report for changed files
run: |
if [ ! -f ./jscpd-report.json ]; then
echo "jscpd-report.json not found"
exit 1
fi
echo "Filtering jscpd report for changed files..."
CHANGED_FILES=$(jq -R -s -c 'split("\n")[:-1]' changed_files.txt)
echo "Changed files: $CHANGED_FILES"
jq --argjson changed_files "$CHANGED_FILES" '
.duplicates | map(select(
(.firstFile?.name as $fname | $changed_files | any(. == $fname)) or
(.secondFile?.name as $sname | $changed_files | any(. == $sname))
))
' ./jscpd-report.json > filtered-jscpd-report.json
cat filtered-jscpd-report.json

- name: Check if filtered jscpd report exists
id: check_filtered_report
run: |
if [ $(wc -l < ./filtered-jscpd-report.json) -gt 1 ]; then
echo "filtered_report_exists=true" >> $GITHUB_ENV
else
echo "filtered_report_exists=false" >> $GITHUB_ENV
fi

- name: Upload filtered jscpd report
if: env.filtered_report_exists == 'true'
uses: actions/upload-artifact@v4
with:
name: filtered-jscpd-report
path: ./filtered-jscpd-report.json

- name: Post GitHub comment
if: env.filtered_report_exists == 'true'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const filteredReport = JSON.parse(fs.readFileSync('filtered-jscpd-report.json', 'utf8'));
let comment = "Whoa there, partner! 🌵🤠 We wrangled some duplicated code in your PR:\n\n";
function link(dup) {
return `https://github.com/${{ github.event.repository.full_name }}/blob/${{ github.event.pull_request.head.sha }}/${dup.name}#L${dup.start + 1}-L${dup.end - 1}`
}
filteredReport.forEach(duplication => {
const firstFile = duplication.firstFile;
const secondFile = duplication.secondFile;
const lines = duplication.lines;
comment += `- [\`${firstFile.name}\`](${link(firstFile)}) has ${lines} duplicated lines with [\`${secondFile.name}\`](${link(secondFile)})\n`;
});
comment += "\nReducing code duplication by importing common functions from a library not only makes our code cleaner but also easier to maintain. Please move the common code from both files into a library and import it in each. We hate that we have to mention this, however, commits designed to hide from this utility by renaming variables or reordering an object are poor conduct. We will not look upon them kindly! Keep up the great work! 🚀";
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: comment
});

- name: Fail if duplications are found
if: env.filtered_report_exists == 'true'
run: |
echo "Duplications found, failing the check."
exit 1
107 changes: 107 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Check for linter warnings / exceptions

on:
pull_request_target:
branches:
- master

jobs:
check-linter:
runs-on: ubuntu-latest

steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.base.sha }}

- name: Fetch base and target branches
run: |
git fetch origin +refs/heads/${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }}
git fetch origin +refs/pull/${{ github.event.pull_request.number }}/merge:refs/remotes/pull/${{ github.event.pull_request.number }}/merge

- name: Install dependencies
run: npm ci

- name: Get the diff
run: git diff --name-only origin/${{ github.event.pull_request.base.ref }}...refs/remotes/pull/${{ github.event.pull_request.number }}/merge | grep '^\(modules\|src\|libraries\|creative\)/.*\.js$' > __changed_files.txt || true

- name: Run linter on base branch
run: npx eslint --no-inline-config --format json $(cat __changed_files.txt | xargs stat --printf '%n\n' 2> /dev/null) > __base.json || true

- name: Check out PR
run: git checkout ${{ github.event.pull_request.head.sha }}

- name: Run linter on PR
run: npx eslint --no-inline-config --format json $(cat __changed_files.txt | xargs stat --printf '%n\n' 2> /dev/null) > __pr.json || true

- name: Compare them and post comment if necessary
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
const process = require('process');

function parse(fn) {
return JSON.parse(fs.readFileSync(fn)).reduce((memo, data) => {
const file = path.relative(process.cwd(), data.filePath);
if (!memo.hasOwnProperty(file)) { memo[file] = { errors: 0, warnings: 0} }
data.messages.forEach(({severity}) => {
memo[file][severity > 1 ? 'errors' : 'warnings']++;
});
return memo;
}, {})
}

function mkDiff(old, new_) {
const files = Object.fromEntries(
Object.entries(new_)
.map(([file, {errors, warnings}]) => {
const {errors: oldErrors, warnings: oldWarnings} = old[file] || {};
return [file, {errors: Math.max(0, errors - (oldErrors ?? 0)), warnings: Math.max(0, warnings - (oldWarnings ?? 0))}]
})
.filter(([_, {errors, warnings}]) => errors > 0 || warnings > 0)
)
return Object.values(files).reduce((memo, {warnings, errors}) => {
memo.errors += errors;
memo.warnings += warnings;
return memo;
}, {errors: 0, warnings: 0, files})
}

function mkComment({errors, warnings, files}) {
function pl(noun, number) {
return noun + (number === 1 ? '' : 's')
}
if (errors === 0 && warnings === 0) return;
const summary = [];
if (errors) summary.push(`**${errors}** linter ${pl('error', errors)}`)
if (warnings) summary.push(`**${warnings}** linter ${pl('warning', warnings)}`)
let cm = `Tread carefully! This PR adds ${summary.join(' and ')} (possibly disabled through directives):\n\n`;
Object.entries(files).forEach(([file, {errors, warnings}]) => {
const summary = [];
if (errors) summary.push(`+${errors} ${pl('error', errors)}`);
if (warnings) summary.push(`+${warnings} ${pl('warning', warnings)}`)
cm += ` * \`${file}\` (${summary.join(', ')})\n`
})
return cm;
}

const [base, pr] = ['__base.json', '__pr.json'].map(parse);
const comment = mkComment(mkDiff(base, pr));

if (comment) {
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: comment
});
}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.16.1
20.13.1
17 changes: 10 additions & 7 deletions PR_REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ General gulp commands include separate commands for serving the codebase on a bu
- Checkout the branch (these instructions are available on the GitHub PR page as well).
- Verify PR is a single change type. Example, refactor OR bugfix. If more than 1 type, ask submitter to break out requests.
- Verify code under review has at least 80% unit test coverage. If legacy code doesn't have enough unit test coverage, require that additional unit tests to be included in the PR.
- Verify tests are green in Travis-ci + local build by running `gulp serve` | `gulp test`
- Verify tests are green in circle-ci + local build by running `gulp serve` | `gulp test`
- Verify no code quality violations are present from linting (should be reported in terminal)
- Make sure the code is not setting cookies or localstorage directly -- it must use the `StorageManager`.
- Review for obvious errors or bad coding practice / use best judgement here.
- Don't allow needless code duplication with other js files; require both files import common code. Do not allow commits designed to fool the code duplication checker.
- If the change is a new feature / change to core prebid.js - review the change with a Tech Lead on the project and make sure they agree with the nature of change.
- If the change results in needing updates to docs (such as public API change, module interface etc), add a label for "needs docs" and inform the submitter they must submit a docs PR to update the appropriate area of Prebid.org **before the PR can merge**. Help them with finding where the docs are located on prebid.org if needed.
- If all above is good, add a `LGTM` comment and, if the change is in PBS-core or is an important module like the prebidServerBidAdapter, request 1 additional core member to review.
Expand All @@ -51,20 +52,21 @@ Follow steps above for general review process. In addition, please verify the fo
- If the adapter being submitted is an alias type, check with the bidder contact that is being aliased to make sure it's allowed.
- All bidder parameter conventions must be followed:
- Video params must be read from AdUnit.mediaTypes.video when available; however bidder config can override the ad unit.
- First party data must be read from [getConfig('ortb2');](https://docs.prebid.org/dev-docs/publisher-api-reference/setConfig.html#setConfig-fpd).
- First party data must be read from the bid request object: bidrequest.ortb2
- Adapters that accept a floor parameter must also support the [floors module](https://docs.prebid.org/dev-docs/modules/floors.html) -- look for a call to the `getFloor()` function.
- Adapters cannot accept an schain parameter. Rather, they must look for the schain parameter at bidRequest.schain.
- The bidderRequest.refererInfo.referer must be checked in addition to any bidder-specific parameter.
- Page position must come from bidrequest.mediaTypes.banner.pos or bidrequest.mediaTypes.video.pos
- Global OpenRTB fields should come from [getConfig('ortb2');](https://docs.prebid.org/dev-docs/publisher-api-reference/setConfig.html#setConfig-fpd):
- Eids object is to be preferred to Userids object in the bid request, as the userid object may be removed in a future version
- Global OpenRTB fields should come from bidrequest.ortb2
- bcat, battr, badv
- Impression-specific OpenRTB fields should come from bidrequest.ortb2imp
- instl
- Below are some examples of bidder specific updates that should require docs update (in their dev-docs/bidders/BIDDER.md file):
- If they support the GDPR consentManagement module and TCF1, add `gdpr_supported: true`
- If they support the GDPR consentManagement module and TCF2, add `tcf2_supported: true`
- If they support the TCF consentManagementTcf module and TCF2, add `tcf2_supported: true`
- If they support the US Privacy consentManagementUsp module, add `usp_supported: true`
- If they support one or more userId modules, add `userId: (list of supported vendors)`
- If they support the GPP consentManagementGpp module, add `gpp_supported: true`
- If they support one or more userId modules, add `userId: (list of supported vendors) or (all)`
- If they support video and/or native mediaTypes add `media_types: video, native`. Note that display is added by default. If you don't support display, add "no-display" as the first entry, e.g. `media_types: no-display, native`
- If they support COPPA, add `coppa_supported: true`
- If they support SChain, add `schain_supported: true`
Expand Down Expand Up @@ -100,7 +102,7 @@ Follow steps above for general review process. In addition:
- modules/userId/userId.md
- tests can go either within the userId_spec.js file or in their own _spec file if they wish
- GVLID is recommended in the *IdSystem file if they operate in EU
- make sure example configurations align to the actual code (some modules use the userId storage settings and allow pub configuration, while others handle reading/writing cookies on their own, so should not include the storage params in examples)
- make sure example configurations align to the actual code (some modules use the userId storage settings and allow pub configuration, while others handle reading/writing cookies on their own, so should not include the storage params in examples). This ability to write will be removed in a future version, see https://github.com/prebid/Prebid.js/issues/10710
- the 3 available methods (getId, extendId, decode) should be used as they were intended
- decode (required method) should not be making requests to retrieve a new ID, it should just be decoding a response
- extendId (optional method) should not be making requests to retrieve a new ID, it should just be adding additional data to the id object
Expand All @@ -121,6 +123,7 @@ Follow steps above for general review process. In addition:
- Confirm that the module
- is not loading external code. If it is, escalate to the #prebid-js Slack channel.
- is reading `config` from the function signature rather than calling `getConfig`.
- Is practicing reasonable data minimization, eg not sending all eids over the wire without publisher whitelisting
- is sending data to the bid request only as either First Party Data or in bidRequest.rtd.RTDPROVIDERCODE.
- is making HTTPS requests as early as possible, but not more often than needed.
- doesn't force bid adapters to load additional code.
Expand Down
1 change: 0 additions & 1 deletion allowedModules.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

module.exports = {
'modules': [
'criteo-direct-rsa-validate',
'crypto-js',
'live-connect' // Maintained by LiveIntent : https://github.com/liveintent-berlin/live-connect/
],
Expand Down
Loading