Skip to content

Commit

Permalink
merged master branch into OTT-48
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-viral-vala committed May 18, 2021
1 parent 6789fa2 commit 101f131
Show file tree
Hide file tree
Showing 1,107 changed files with 34,618 additions and 9,553 deletions.
9 changes: 9 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
change-template: '* $TITLE (#$NUMBER)'
template: |
## Changes
$CHANGES
## Contributors
$CONTRIBUTORS
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
release:
name: Create Release
if: github.event.base_ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Get Version
id: get_version
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}

- name: Create & Publish Release
uses: release-drafter/[email protected]
with:
name: ${{ steps.get_version.outputs.version }}
tag: ${{ steps.get_version.outputs.version }}
version: ${{ steps.get_version.outputs.version }}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ vendor
prebid-server
build
debug
__debug_bin

# config files
pbs.*
Expand Down
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test: deps
ifeq "$(adapter)" ""
./validate.sh
else
go test github.com/PubMatic-OpenWrap/prebid-server/adapters/$(adapter) -bench=.
go test github.com/prebid/prebid-server/adapters/$(adapter) -bench=.
endif

# build will ensure all of our tests pass and then build the go binary
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Build Status](https://travis-ci.org/prebid/prebid-server.svg?branch=master)](https://travis-ci.org/prebid/prebid-server)
[![Go Report Card](https://goreportcard.com/badge/github.com/PubMatic-OpenWrap/prebid-server?style=flat-square)](https://goreportcard.com/report/github.com/PubMatic-OpenWrap/prebid-server)
[![Build](https://img.shields.io/github/workflow/status/prebid/prebid-server/Validate/master?style=flat-square)](https://github.com/prebid/prebid-server/actions/workflows/validate.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/prebid/prebid-server?style=flat-square)](https://goreportcard.com/report/github.com/prebid/prebid-server)
![Go Version](https://img.shields.io/github/go-mod/go-version/prebid/prebid-server?style=flat-square)

# Prebid Server

Expand All @@ -16,6 +17,8 @@ For more information, see:
- [Prebid Server Overview](https://docs.prebid.org/prebid-server/overview/prebid-server-overview.html)
- [Current Bidders](http://prebid.org/dev-docs/pbs-bidders.html)

Please consider [registering your Prebid Server](https://docs.prebid.org/prebid-server/hosting/pbs-hosting.html#optional-registration) to get on the mailing list for updates, etc.

## Installation

First install [Go](https://golang.org/doc/install) version 1.14 or newer.
Expand Down
8 changes: 4 additions & 4 deletions account/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"encoding/json"
"fmt"

"github.com/PubMatic-OpenWrap/prebid-server/config"
"github.com/PubMatic-OpenWrap/prebid-server/errortypes"
"github.com/PubMatic-OpenWrap/prebid-server/metrics"
"github.com/PubMatic-OpenWrap/prebid-server/stored_requests"
jsonpatch "github.com/evanphx/json-patch"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/metrics"
"github.com/prebid/prebid-server/stored_requests"
)

// GetAccount looks up the config.Account object referenced by the given accountID, with access rules applied
Expand Down
8 changes: 4 additions & 4 deletions account/account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"fmt"
"testing"

"github.com/PubMatic-OpenWrap/prebid-server/config"
"github.com/PubMatic-OpenWrap/prebid-server/errortypes"
"github.com/PubMatic-OpenWrap/prebid-server/metrics"
"github.com/PubMatic-OpenWrap/prebid-server/stored_requests"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/metrics"
"github.com/prebid/prebid-server/stored_requests"
"github.com/stretchr/testify/assert"
)

Expand Down
32 changes: 16 additions & 16 deletions adapters/33across/33across.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"fmt"
"net/http"

"github.com/PubMatic-OpenWrap/openrtb"
"github.com/PubMatic-OpenWrap/prebid-server/adapters"
"github.com/PubMatic-OpenWrap/prebid-server/config"
"github.com/PubMatic-OpenWrap/prebid-server/errortypes"
"github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext"
"github.com/mxmCherry/openrtb/v15/openrtb2"
"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/openrtb_ext"
)

type TtxAdapter struct {
Expand Down Expand Up @@ -51,7 +51,7 @@ type bidTtxExt struct {
}

// MakeRequests create the object for TTX Reqeust.
func (a *TtxAdapter) MakeRequests(request *openrtb.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
func (a *TtxAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
var errs []error
var adapterRequests []*adapters.RequestData

Expand All @@ -77,14 +77,14 @@ func (a *TtxAdapter) MakeRequests(request *openrtb.BidRequest, reqInfo *adapters
return adapterRequests, errs
}

func (a *TtxAdapter) makeRequest(request openrtb.BidRequest, imp openrtb.Imp) (*adapters.RequestData, error) {
func (a *TtxAdapter) makeRequest(request openrtb2.BidRequest, imp openrtb2.Imp) (*adapters.RequestData, error) {
impCopy, err := makeImps(imp)

if err != nil {
return nil, err
}

request.Imp = []openrtb.Imp{*impCopy}
request.Imp = []openrtb2.Imp{*impCopy}

// Last Step
reqJSON, err := json.Marshal(request)
Expand All @@ -103,7 +103,7 @@ func (a *TtxAdapter) makeRequest(request openrtb.BidRequest, imp openrtb.Imp) (*
}, nil
}

func makeImps(imp openrtb.Imp) (*openrtb.Imp, error) {
func makeImps(imp openrtb2.Imp) (*openrtb2.Imp, error) {
if imp.Banner == nil && imp.Video == nil {
return nil, &errortypes.BadInput{
Message: fmt.Sprintf("Imp ID %s must have at least one of [Banner, Video] defined", imp.ID),
Expand Down Expand Up @@ -158,7 +158,7 @@ func makeImps(imp openrtb.Imp) (*openrtb.Imp, error) {
return &imp, nil
}

func makeReqExt(request *openrtb.BidRequest) ([]byte, error) {
func makeReqExt(request *openrtb2.BidRequest) ([]byte, error) {
var reqExt reqExt

if len(request.Ext) > 0 {
Expand All @@ -181,7 +181,7 @@ func makeReqExt(request *openrtb.BidRequest) ([]byte, error) {
}

// MakeBids make the bids for the bid response.
func (a *TtxAdapter) MakeBids(internalRequest *openrtb.BidRequest, externalRequest *adapters.RequestData, response *adapters.ResponseData) (*adapters.BidderResponse, []error) {
func (a *TtxAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest *adapters.RequestData, response *adapters.ResponseData) (*adapters.BidderResponse, []error) {
if response.StatusCode == http.StatusNoContent {
return nil, nil
}
Expand All @@ -198,7 +198,7 @@ func (a *TtxAdapter) MakeBids(internalRequest *openrtb.BidRequest, externalReque
}}
}

var bidResp openrtb.BidResponse
var bidResp openrtb2.BidResponse

if err := json.Unmarshal(response.Body, &bidResp); err != nil {
return nil, []error{err}
Expand Down Expand Up @@ -227,8 +227,8 @@ func (a *TtxAdapter) MakeBids(internalRequest *openrtb.BidRequest, externalReque

}

func validateVideoParams(video *openrtb.Video, prod string) (*openrtb.Video, error) {
videoCopy := video
func validateVideoParams(video *openrtb2.Video, prod string) (*openrtb2.Video, error) {
videoCopy := *video
if videoCopy.W == 0 ||
videoCopy.H == 0 ||
videoCopy.Protocols == nil ||
Expand All @@ -248,11 +248,11 @@ func validateVideoParams(video *openrtb.Video, prod string) (*openrtb.Video, err
videoCopy.Placement = 1

if videoCopy.StartDelay == nil {
videoCopy.StartDelay = openrtb.StartDelay.Ptr(0)
videoCopy.StartDelay = openrtb2.StartDelay.Ptr(0)
}
}

return videoCopy, nil
return &videoCopy, nil
}

func getBidType(ext bidExt) openrtb_ext.BidType {
Expand Down
6 changes: 3 additions & 3 deletions adapters/33across/33across_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package ttx
import (
"testing"

"github.com/PubMatic-OpenWrap/prebid-server/adapters/adapterstest"
"github.com/PubMatic-OpenWrap/prebid-server/config"
"github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext"
"github.com/prebid/prebid-server/adapters/adapterstest"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/openrtb_ext"
)

func TestJsonSamples(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion adapters/33across/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"testing"

"github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext"
"github.com/prebid/prebid-server/openrtb_ext"
)

// This file actually intends to test static/bidder-params/33across.json
Expand Down
6 changes: 3 additions & 3 deletions adapters/33across/usersync.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package ttx
import (
"text/template"

"github.com/PubMatic-OpenWrap/prebid-server/adapters"
"github.com/PubMatic-OpenWrap/prebid-server/usersync"
"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/usersync"
)

func New33AcrossSyncer(temp *template.Template) usersync.Usersyncer {
return adapters.NewSyncer("33across", 58, temp, adapters.SyncTypeIframe)
return adapters.NewSyncer("33across", temp, adapters.SyncTypeIframe)
}
7 changes: 3 additions & 4 deletions adapters/33across/usersync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"testing"
"text/template"

"github.com/PubMatic-OpenWrap/prebid-server/privacy"
"github.com/PubMatic-OpenWrap/prebid-server/privacy/ccpa"
"github.com/PubMatic-OpenWrap/prebid-server/privacy/gdpr"
"github.com/prebid/prebid-server/privacy"
"github.com/prebid/prebid-server/privacy/ccpa"
"github.com/prebid/prebid-server/privacy/gdpr"
"github.com/stretchr/testify/assert"
)

Expand All @@ -30,6 +30,5 @@ func Test33AcrossSyncer(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, "https://ic.tynt.com/r/d?m=xch&rt=html&gdpr=A&gdpr_consent=B&us_privacy=C&ru=%2Fsetuid%3Fbidder%3D33across%26uid%3D33XUSERID33X&id=zzz000000000002zzz", syncInfo.URL)
assert.Equal(t, "iframe", syncInfo.Type)
assert.EqualValues(t, 58, syncer.GDPRVendorID())
assert.False(t, syncInfo.SupportCORS)
}
24 changes: 12 additions & 12 deletions adapters/acuityads/acuityads.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"net/http"
"text/template"

"github.com/PubMatic-OpenWrap/openrtb"
"github.com/PubMatic-OpenWrap/prebid-server/adapters"
"github.com/PubMatic-OpenWrap/prebid-server/config"
"github.com/PubMatic-OpenWrap/prebid-server/errortypes"
"github.com/PubMatic-OpenWrap/prebid-server/macros"
"github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext"
"github.com/mxmCherry/openrtb/v15/openrtb2"
"github.com/prebid/prebid-server/adapters"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/errortypes"
"github.com/prebid/prebid-server/macros"
"github.com/prebid/prebid-server/openrtb_ext"
)

type AcuityAdsAdapter struct {
Expand All @@ -31,7 +31,7 @@ func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters
return bidder, nil
}

func getHeaders(request *openrtb.BidRequest) http.Header {
func getHeaders(request *openrtb2.BidRequest) http.Header {
headers := http.Header{}
headers.Add("Content-Type", "application/json;charset=utf-8")
headers.Add("Accept", "application/json")
Expand All @@ -55,7 +55,7 @@ func getHeaders(request *openrtb.BidRequest) http.Header {
}

func (a *AcuityAdsAdapter) MakeRequests(
openRTBRequest *openrtb.BidRequest,
openRTBRequest *openrtb2.BidRequest,
reqInfo *adapters.ExtraRequestInfo,
) (
requestsToBidder []*adapters.RequestData,
Expand Down Expand Up @@ -87,7 +87,7 @@ func (a *AcuityAdsAdapter) MakeRequests(
}}, nil
}

func (a *AcuityAdsAdapter) getImpressionExt(imp *openrtb.Imp) (*openrtb_ext.ExtAcuityAds, error) {
func (a *AcuityAdsAdapter) getImpressionExt(imp *openrtb2.Imp) (*openrtb_ext.ExtAcuityAds, error) {
var bidderExt adapters.ExtImpBidder
if err := json.Unmarshal(imp.Ext, &bidderExt); err != nil {
return nil, &errortypes.BadInput{
Expand Down Expand Up @@ -136,7 +136,7 @@ func (a *AcuityAdsAdapter) checkResponseStatusCodes(response *adapters.ResponseD
}

func (a *AcuityAdsAdapter) MakeBids(
openRTBRequest *openrtb.BidRequest,
openRTBRequest *openrtb2.BidRequest,
requestToBidder *adapters.RequestData,
bidderRawResponse *adapters.ResponseData,
) (
Expand All @@ -153,7 +153,7 @@ func (a *AcuityAdsAdapter) MakeBids(
}

responseBody := bidderRawResponse.Body
var bidResp openrtb.BidResponse
var bidResp openrtb2.BidResponse
if err := json.Unmarshal(responseBody, &bidResp); err != nil {
return nil, []error{&errortypes.BadServerResponse{
Message: "Bad Server Response",
Expand All @@ -178,7 +178,7 @@ func (a *AcuityAdsAdapter) MakeBids(
return bidResponse, nil
}

func getMediaTypeForImp(impId string, imps []openrtb.Imp) openrtb_ext.BidType {
func getMediaTypeForImp(impId string, imps []openrtb2.Imp) openrtb_ext.BidType {
mediaType := openrtb_ext.BidTypeBanner
for _, imp := range imps {
if imp.ID == impId {
Expand Down
6 changes: 3 additions & 3 deletions adapters/acuityads/acuityads_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package acuityads
import (
"testing"

"github.com/PubMatic-OpenWrap/prebid-server/adapters/adapterstest"
"github.com/PubMatic-OpenWrap/prebid-server/config"
"github.com/PubMatic-OpenWrap/prebid-server/openrtb_ext"
"github.com/prebid/prebid-server/adapters/adapterstest"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/openrtb_ext"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion adapters/acuityads/acuityadstest/exemplary/banner-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@
]
}
]
}
}
2 changes: 1 addition & 1 deletion adapters/acuityads/acuityadstest/exemplary/native-app.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@
}
]
}


Loading

0 comments on commit 101f131

Please sign in to comment.