Skip to content

Commit

Permalink
Merge branch 'master' into prebid_v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pubmatic-Supriya-Patil committed Nov 24, 2023
2 parents ec729e6 + c527f01 commit 5e40322
Show file tree
Hide file tree
Showing 396 changed files with 60,762 additions and 474 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @viral-vala @shriprasad-marathe @ganesh-salpure
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Description

Please add change description or link to ticket, docs, etc.

# Checklist:

- [ ] PR commit list is unique (rebase/pull with the origin branch to keep master clean).
- [ ] JIRA number is added in the PR title and the commit message.
- [ ] Updated the `header-bidding` repo with appropiate commit id.
- [ ] Documented the new changes.

For Prebid upgrade, refer: https://inside.pubmatic.com:8443/confluence/display/Products/Prebid-server+upgrade
9 changes: 8 additions & 1 deletion .github/workflows/adapter-code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
id: run_coverage
if: steps.get_directories.outputs.result != ''
run: |
git config --global url."https://${USERNAME}:${TOKEN}@git.pubmatic.com".insteadOf "https://git.pubmatic.com"
directories=$(echo '${{ steps.get_directories.outputs.result }}' | jq -r '.[]')
go mod download
Expand All @@ -65,13 +67,18 @@ jobs:
# remove pull request branch files
cd ..
rm -f -r ./*
env:
GO111MODULE: "on"
GOPRIVATE: "git.pubmatic.com/PubMatic/*"
TOKEN: ${{ secrets.PM_OPENWRAP_CICD_PASSWORD }}
USERNAME: ${{ secrets.PM_OPENWRAP_CICD_USERNAME }}

- name: Checkout coverage-preview branch
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: coverage-preview
repository: prebid/prebid-server
repository: PubMatic-OpenWrap/prebid-server

- name: Commit coverage files to coverage-preview branch
if: steps.run_coverage.outputs.coverage_dir != ''
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cross-repo-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request_target:
types: [closed]
branches:
- "master"
- "master-disable"

jobs:
cross-repo:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/validate-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:

- name: Validate
run: |
git config --global url."https://${USERNAME}:${TOKEN}@git.pubmatic.com".insteadOf "https://git.pubmatic.com"
./validate.sh --nofmt --cov --race 10
env:
GO111MODULE: "on"
GOPRIVATE: "git.pubmatic.com/PubMatic/*"
TOKEN: ${{ secrets.PM_OPENWRAP_CICD_PASSWORD }}
USERNAME: ${{ secrets.PM_OPENWRAP_CICD_USERNAME }}
4 changes: 4 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:

- name: Validate
run: |
git config --global url."https://${USERNAME}:${TOKEN}@git.pubmatic.com".insteadOf "https://git.pubmatic.com"
./validate.sh --nofmt --cov --race 10
env:
GO111MODULE: "on"
GOPRIVATE: "git.pubmatic.com/PubMatic/*"
TOKEN: ${{ secrets.PM_OPENWRAP_CICD_PASSWORD }}
USERNAME: ${{ secrets.PM_OPENWRAP_CICD_USERNAME }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ inventory_url.yaml

# generated log files during tests
analytics/config/testFiles/
analytics/config/xyz*
analytics/filesystem/testFiles/

# autogenerated version file
Expand All @@ -56,3 +57,5 @@ analytics/filesystem/testFiles/
*~
*.swp
*.swo
pbsimage
manual_build
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,23 @@ image:

# format runs format
format:
./scripts/format.sh -f true
./scripts/format.sh -f true

mockgen: mockgeninstall mockgendb mockgencache mockgenmetrics

# export GOPATH=~/go ; GOBIN=~/go/bin; export PATH=$PATH:$GOBIN
mockgeninstall:
go install github.com/golang/mock/[email protected]

mockgendb:
mkdir -p modules/pubmatic/openwrap/database/mock modules/pubmatic/openwrap/database/mock_driver
mockgen database/sql/driver Driver,Connector,Conn,DriverContext > modules/pubmatic/openwrap/database/mock_driver/mock.go
mockgen github.com/PubMatic-OpenWrap/prebid-server/modules/pubmatic/openwrap/database Database > modules/pubmatic/openwrap/database/mock/mock.go

mockgencache:
mkdir -p modules/pubmatic/openwrap/cache/mock
mockgen github.com/PubMatic-OpenWrap/prebid-server/modules/pubmatic/openwrap/cache Cache > modules/pubmatic/openwrap/cache/mock/mock.go

mockgenmetrics:
mkdir -p modules/pubmatic/openwrap/metrics/mock
mockgen github.com/PubMatic-OpenWrap/prebid-server/modules/pubmatic/openwrap/metrics MetricsEngine > modules/pubmatic/openwrap/metrics/mock/mock.go
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Download and prepare Prebid Server:

```bash
cd YOUR_DIRECTORY
git clone https://github.com/prebid/prebid-server src/github.com/prebid/prebid-server
cd src/github.com/prebid/prebid-server
git clone https://github.com/PubMatic-OpenWrap/prebid-server src/github.com/PubMatic-OpenWrap/prebid-server
cd src/github.com/PubMatic-OpenWrap/prebid-server
```

Run the automated tests:
Expand Down Expand Up @@ -69,11 +69,10 @@ of exported types.

Want to [add an adapter](https://docs.prebid.org/prebid-server/developers/add-new-bidder-go.html)? Found a bug? Great!

Report bugs, request features, and suggest improvements [on Github](https://github.com/prebid/prebid-server/issues).

Or better yet, [open a pull request](https://github.com/prebid/prebid-server/compare) with the changes you'd like to see.
Or better yet, [open a pull request](https://github.com/PubMatic-OpenWrap/prebid-server/compare) with the changes you'd like to see.

## IDE Recommendations

The quickest way to start developing Prebid Server in a reproducible environment isolated from your host OS
is by using Visual Studio Code with [Remote Container Setup](devcontainer.md).

5 changes: 3 additions & 2 deletions adapters/appnexus/appnexus.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,17 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.E
return nil, append(errs, err)
}

// Commenting out the following piece of code to avoid populating adpod_id in the Appnexus request (ref: https://inside.pubmatic.com:9443/jira/browse/UOE-6196)
// For long form requests if adpodId feature enabled, adpod_id must be sent downstream.
// Adpod id is a unique identifier for pod
// All impressions in the same pod must have the same pod id in request extension
// For this all impressions in request should belong to the same pod
// If impressions number per pod is more than maxImpsPerReq - divide those imps to several requests but keep pod id the same
// If adpodId feature disabled and impressions number per pod is more than maxImpsPerReq - divide those imps to several requests but do not include ad pod id
if isVIDEO == 1 && *shouldGenerateAdPodId {
/*if isVIDEO == 1 && *shouldGenerateAdPodId {
requests, errors := a.buildAdPodRequests(request.Imp, request, reqExt, reqExtAppnexus, requestURI.String())
return requests, append(errs, errors...)
}
}*/

requests, errors := splitRequests(request.Imp, request, reqExt, reqExtAppnexus, requestURI.String())
return requests, append(errs, errors...)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
"id": "test-request-id",
"ext": {
"appnexus": {
"adpod_id": "10",
"hb_source": 6
"hb_source": 6
}
},
"imp": [
Expand Down Expand Up @@ -94,4 +93,4 @@
}
],
"expectedBidResponses": [{"currency":"USD","bids":[]}]
}
}
9 changes: 9 additions & 0 deletions adapters/bidder.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ type TypedBid struct {
BidMeta *openrtb_ext.ExtBidPrebidMeta
BidType openrtb_ext.BidType
BidVideo *openrtb_ext.ExtBidPrebidVideo
BidTargets map[string]string
DealPriority int
Seat openrtb_ext.BidderName
}
Expand All @@ -115,12 +116,20 @@ type ResponseData struct {
Headers http.Header
}

type BidRequestParams struct {
ImpIndex int
VASTTagIndex int
}

// RequestData packages together the fields needed to make an http.Request.
type RequestData struct {
Params *BidRequestParams
Method string
Uri string
Body []byte
Headers http.Header

BidderName openrtb_ext.BidderName `json:"-"`
}

// ExtImpBidder can be used by Bidders to unmarshal any request.imp[i].ext.
Expand Down
2 changes: 1 addition & 1 deletion adapters/conversant/conversant.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (c *ConversantAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *
}

func parseCnvrParams(imp *openrtb2.Imp, cnvrExt openrtb_ext.ExtImpConversant) {
imp.DisplayManager = "prebid-s2s"
imp.DisplayManager = "pubmatic-openwrap"
imp.DisplayManagerVer = "2.0.0"

if imp.BidFloor <= 0 && cnvrExt.BidFloor > 0 {
Expand Down
2 changes: 1 addition & 1 deletion adapters/conversant/conversanttest/exemplary/banner.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"tagid": "mytag",
"secure": 1,
"bidfloor": 0.01,
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"banner": {
"format": [{"w": 300, "h": 250}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"tagid": "mytag",
"secure": 1,
"bidfloor": 0.01,
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"banner": {
"format": [{"w": 300, "h": 250}]
Expand Down
2 changes: 1 addition & 1 deletion adapters/conversant/conversanttest/exemplary/video.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"tagid": "mytag",
"secure": 1,
"bidfloor": 0.01,
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"video": {
"w": 300,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"imp": [
{
"id": "1",
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"banner": {
"format": [{"w": 300, "h": 250}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"imp": [
{
"id": "1",
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"banner": {
"format": [{"w": 300, "h": 250}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"imp": [
{
"id": "1",
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"banner": {
"format": [{"w": 300, "h": 250}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"bidfloor": 7,
"secure": 1,
"tagid": "mytag",
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"video": {
"api": [1,2],
Expand All @@ -126,7 +126,7 @@
"bidfloor": 1,
"secure": 1,
"tagid": "mytag",
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"video": {
"api": [1,2],
Expand Down Expand Up @@ -154,7 +154,7 @@
"bidfloor": 7,
"secure": 1,
"tagid": "mytag",
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"video": {
"api": [1,2],
Expand Down Expand Up @@ -182,7 +182,7 @@
"bidfloor": -3,
"secure": 1,
"tagid": "mytag",
"displaymanager": "prebid-s2s",
"displaymanager": "pubmatic-openwrap",
"displaymanagerver": "2.0.0",
"video": {
"api": [1,2],
Expand Down
Loading

0 comments on commit 5e40322

Please sign in to comment.