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 datablocks adapter #2838

Merged
merged 6 commits into from
Sep 4, 2023
Merged

Update datablocks adapter #2838

merged 6 commits into from
Sep 4, 2023

Conversation

jmayor
Copy link
Contributor

@jmayor jmayor commented Jun 12, 2023

Remove dynamic domain with static domain

Remove dynamic domain with static domain
@onkarvhanumante
Copy link
Contributor

@jmayor requesting to also update server urls mentioned in json tests and test files

func TestJsonSamples(t *testing.T) {
	bidder, buildErr := Builder(openrtb_ext.BidderDatablocks, config.Adapter{
		- Endpoint: "http://{{.Host}}/openrtb2?sid={{.SourceId}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})
		+ Endpoint: "http://pbserver.dblks.net/openrtb2?sid={{.SourceId}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

	if buildErr != nil {
		t.Fatalf("Builder returned unexpected error %v", buildErr)
	}

	adapterstest.RunJSONBidderTest(t, "datablockstest", bidder)
}

@@ -1,4 +1,4 @@
endpoint: "http://{{.Host}}/openrtb2?sid={{.SourceId}}"
endpoint: "http://pbserver.dblks.net/openrtb2?sid={{.SourceId}}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified that url is reachable

curl -i http://pbserver.dblks.net/openrtb2                                                  
HTTP/1.1 404 Wrong request type: need POST
Server: nginx/1.14.1
Date: Tue, 13 Jun 2023 05:54:31 GMT
Content-Type: text/plain; charset=UTF-8
Content-Length: 35
Connection: keep-alive
X-Fritter: 5.1-5.1-20230411.225543 hashx=8.0
X-Request: F357728-0/S0-0
x-first: good

Wrong request type. Must be POST.

@Sonali-More-Xandr
Copy link
Contributor

@jmayor Please take a look at the comment by @onkarvhanumante

@onkarvhanumante
Copy link
Contributor

@jmayor requesting to also update server urls mentioned in json tests and test files

func TestJsonSamples(t *testing.T) {
	bidder, buildErr := Builder(openrtb_ext.BidderDatablocks, config.Adapter{
		- Endpoint: "http://{{.Host}}/openrtb2?sid={{.SourceId}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})
		+ Endpoint: "http://pbserver.dblks.net/openrtb2?sid={{.SourceId}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

	if buildErr != nil {
		t.Fatalf("Builder returned unexpected error %v", buildErr)
	}

	adapterstest.RunJSONBidderTest(t, "datablockstest", bidder)
}

@jmayor could you address above comment

@onkarvhanumante
Copy link
Contributor

@jmayor reminder to help with addressing comment

Update test url
@jmayor
Copy link
Contributor Author

jmayor commented Jul 14, 2023

Sorry guys - I was travelling and away from internet access. I just committed a change to address it

@Sonali-More-Xandr
Copy link
Contributor

@jmayor Please update the server url used in the JSON tests to fix the failing tests

@onkarvhanumante
Copy link
Contributor

@jmayor tests are failing with following error

gofmt needs to be run, 1 files have issues.  Below is a list of files to review:
openrtb_ext/imp_datablocks.go

@onkarvhanumante
Copy link
Contributor

@jmayor tests are failing with following error

gofmt needs to be run, 1 files have issues.  Below is a list of files to review:
openrtb_ext/imp_datablocks.go

@jmayor requesting to address above comment

@onkarvhanumante
Copy link
Contributor

@jmayor tests are failing with following error

gofmt needs to be run, 1 files have issues.  Below is a list of files to review:
openrtb_ext/imp_datablocks.go

@jmayor requesting to address above comment

ping to make this change

@onkarvhanumante
Copy link
Contributor

@jmayor tests on PR are failing with following error. Reminder to fix it so we can merge this PR

gofmt needs to be run, 1 files have issues.  Below is a list of files to review:
openrtb_ext/imp_datablocks.go

@jmayor
Copy link
Contributor Author

jmayor commented Jul 27, 2023 via email

@onkarvhanumante
Copy link
Contributor

Sorry for the delay - I am on vacation in a very remote area with very little to no internet access. I will address this early next week when I am back

On Thu, Jul 27, 2023 at 7:24 AM Onkar Hanumante @.> wrote: @jmayor https:/jmayor tests on PR are failing with following error. Reminder to fix it so we can merge this PR gofmt needs to be run, 1 files have issues. Below is a list of files to review: openrtb_ext/imp_datablocks.go — Reply to this email directly, view it on GitHub <#2838 (comment)>, or unsubscribe https:/notifications/unsubscribe-auth/AAEX5KGD2CZYPV6R5PJQZDLXSJFVJANCNFSM6AAAAAAZDVDAQI . You are receiving this because you were mentioned.Message ID: @.>

@jmayor ping to move this PR forward

@guscarreon
Copy link
Contributor

The checks are failing because gofmt needs to be run. @jmayor friendly ping checking if you have time to move this PR forward.

@jmayor
Copy link
Contributor Author

jmayor commented Aug 25, 2023

Appreciate the follow up and patience

I just pushed a fix

@onkarvhanumante
Copy link
Contributor

@jmayor, jmayor:master feature branch is not in sync with prebid server master. Due to which Adapter code coverage and Adapter semgrep checks are failing.

Requesting to sync feature branch with updated master.

@github-actions
Copy link

Code coverage summary

Note:

  • Prebid team doesn't anticipate tests covering code paths that might result in marshal and unmarshal errors
  • Coverage summary encompasses all commits leading up to the latest one, 34c7969

datablocks

Refer here for heat map coverage report

github.com/prebid/prebid-server/adapters/datablocks/datablocks.go:22:	MakeRequests		80.0%
github.com/prebid/prebid-server/adapters/datablocks/datablocks.go:71:	MakeBids		100.0%
github.com/prebid/prebid-server/adapters/datablocks/datablocks.go:109:	splitImpressions	100.0%
github.com/prebid/prebid-server/adapters/datablocks/datablocks.go:130:	getBidderParams		88.9%
github.com/prebid/prebid-server/adapters/datablocks/datablocks.go:153:	getMediaType		100.0%
github.com/prebid/prebid-server/adapters/datablocks/datablocks.go:176:	Builder			100.0%
total:									(statements)		92.9%

@jmayor
Copy link
Contributor Author

jmayor commented Aug 30, 2023

@onkarvhanumante Ok - looks like it passed all the tests now

Comment on lines -12 to +14
},
"host": {
"type": "string",
"description": "Network Host to request from"
}
},
"required": ["host", "sourceId"]
"required": ["sourceId"]
Copy link
Contributor

@onkarvhanumante onkarvhanumante Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmayor this might be a breaking change. Should scenario where incoming auction request still has host. Prebid uses fail fast strategy. For example, if incoming auction request mentions multiple bidders. One of them is datablocks and has host param. Here request will fail in validation phase and entire auction will get aborted. This seems unfair for other bidders who are part of auction.

Therefore, consider having some transition period before removing host param. Giving enough opportunity to prebid server hosts/ publisher to make necessary change.

Recommended strategy is to not remove host param from the bidder-param and and required should only have sourceId. This will make host an optional param and can be removed after transition period

...
 "host": {
        "type": "string",
        "description": "Deprecated, Network Host to request from"
      }
  },
  "required": ["sourceId"]

also should create docs pr to remove host param

Copy link
Contributor

@SyntaxNode SyntaxNode Aug 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no issue with removing a parameter. If a request is received with the old parameter, that value will simply be ignored and Prebid Server will be happy. This becomes a problem for adding a new required field.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SyntaxNode that is what I assumed - we should be good to go

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The host parameter is already listed as optional. This is ok.

I'm going to assume this PR will be merged soon enough that the datablocks adapter will be part of PBS 2.0. Thanks for the work @jmayor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bretg Thanks for your patience

@bretg bretg changed the title Update datablocks.yaml Update datablocks adapter Sep 1, 2023
@Sonali-More-Xandr Sonali-More-Xandr merged commit 47f840d into prebid:master Sep 4, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants