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

Smaato: DOOH support #3751

Merged
merged 1 commit into from
Jul 29, 2024
Merged

Smaato: DOOH support #3751

merged 1 commit into from
Jul 29, 2024

Conversation

Enigo
Copy link
Contributor

@Enigo Enigo commented Jun 14, 2024

Adding DOOH support for Smaato adapater

@Enigo Enigo changed the title smaato dooh support Smaato: DOOH support Jun 14, 2024
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, c82c49f

smaato

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/smaato/banner.go:9:		extractAdmBanner		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/native.go:14:	extractAdmNative		85.7%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:70:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:79:	MakeRequests			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:99:	MakeBids			85.3%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:163:	makeIndividualRequests		89.5%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:196:	splitImpressionsByMediaType	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:226:	makePodRequests			84.6%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:250:	makeRequest			85.7%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:269:	getAdMarkupType			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:279:	getTTLFromHeaderOrDefault	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:293:	renderAdMarkup			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:308:	convertAdMarkupTypeToMediaType	80.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:323:	prepareCommonRequest		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:338:	prepareIndividualRequest	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:348:	preparePodRequest		80.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:360:	setUser				95.2%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:403:	setExt				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:411:	setSite				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:431:	setApp				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:438:	setDOOH				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:445:	setPublisherId			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:468:	setImpForAdspace		90.9%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:488:	setImpForAdBreak		94.1%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:520:	makeImpExt			90.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:542:	groupImpressionsByPod		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:562:	buildBidVideo			87.5%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:582:	extractBidExt			100.0%
total:									(statements)			93.3%

adapters/smaato/smaato.go Outdated Show resolved Hide resolved
var clickEvent string
if len(curls) > 0 {
var clicks strings.Builder
for _, clicktracker := range curls {
Copy link
Contributor

Choose a reason for hiding this comment

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

How many curls do you expect the adm to contain?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unlikely more than 3
I believe atm we mostly supply 1

Copy link
Contributor Author

@Enigo Enigo Jun 19, 2024

Choose a reason for hiding this comment

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

I also changed it to only execute this logic when curls field is sent
and added quotes for onlick

cc @el-chuck

assert.Equal(t, tt.expectedAdMarkup, adMarkup)
})
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is fine, but doesn't count towards the test coverage for our review purposes. Please ensure these cases are covered with the json test framework.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, I added one more test case curls=nil
highly unlikely that we would ever return this from the server, but better have it covered

@@ -57,7 +57,8 @@ type bidRequestExt struct {

// bidExt defines Bid.Ext object for Smaato
type bidExt struct {
Duration int `json:"duration"`
Duration int `json:"duration"`
Curls []string `json:"curls"`
Copy link
Contributor

Choose a reason for hiding this comment

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

What is a Curl?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

click url

} else {
return "", &errortypes.BadServerResponse{
Message: fmt.Sprintf("Invalid ad markup %s.", adMarkup),
Message: fmt.Sprintf("X-Smt-Adtype header is missing!"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: Consider changing the ! to .. We keep to plain punctuation for errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@Enigo Enigo force-pushed the smaato_dooh_support branch from c82c49f to 90a0118 Compare June 19, 2024 03:18
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, 90a0118

smaato

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/smaato/banner.go:9:		extractAdmBanner		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/native.go:14:	extractAdmNative		85.7%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:70:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:79:	MakeRequests			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:99:	MakeBids			85.3%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:163:	makeIndividualRequests		89.5%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:196:	splitImpressionsByMediaType	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:226:	makePodRequests			84.6%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:250:	makeRequest			85.7%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:269:	getAdMarkupType			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:279:	getTTLFromHeaderOrDefault	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:293:	renderAdMarkup			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:308:	convertAdMarkupTypeToMediaType	80.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:323:	prepareCommonRequest		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:338:	prepareIndividualRequest	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:348:	preparePodRequest		80.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:360:	setUser				95.2%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:403:	setExt				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:411:	setSite				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:431:	setApp				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:438:	setDOOH				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:445:	setPublisherId			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:468:	setImpForAdspace		90.9%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:488:	setImpForAdBreak		94.1%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:520:	makeImpExt			90.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:542:	groupImpressionsByPod		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:562:	buildBidVideo			87.5%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:582:	extractBidExt			100.0%
total:									(statements)			93.3%

@Enigo Enigo force-pushed the smaato_dooh_support branch from 90a0118 to 00e84b0 Compare June 20, 2024 02:45
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, 00e84b0

smaato

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/smaato/banner.go:9:		extractAdmBanner		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/native.go:14:	extractAdmNative		85.7%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:70:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:79:	MakeRequests			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:99:	MakeBids			85.3%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:163:	makeIndividualRequests		89.5%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:196:	splitImpressionsByMediaType	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:226:	makePodRequests			84.6%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:250:	makeRequest			85.7%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:269:	getAdMarkupType			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:279:	getTTLFromHeaderOrDefault	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:293:	renderAdMarkup			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:308:	convertAdMarkupTypeToMediaType	80.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:323:	prepareCommonRequest		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:338:	prepareIndividualRequest	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:348:	preparePodRequest		80.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:360:	setUser				95.2%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:403:	setExt				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:411:	setSite				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:431:	setApp				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:438:	setDOOH				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:445:	setPublisherId			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:468:	setImpForAdspace		90.9%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:488:	setImpForAdBreak		94.1%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:520:	makeImpExt			90.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:542:	groupImpressionsByPod		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:562:	buildBidVideo			87.5%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:582:	extractBidExt			100.0%
total:									(statements)			93.3%

@Enigo Enigo requested a review from SyntaxNode June 20, 2024 02:46
@bretg bretg requested a review from przemkaczmarek July 9, 2024 15:51
@bsardo bsardo self-assigned this Jul 17, 2024
przemkaczmarek
przemkaczmarek previously approved these changes Jul 18, 2024
adapters/smaato/smaato.go Show resolved Hide resolved
@bsardo
Copy link
Collaborator

bsardo commented Jul 22, 2024

@Enigo it looks like this PR was built off of another PR. Let's work on getting #3734 merged first and then you can merge this PR with master so that this PR only consists of the DOOH changes.

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, 0fa2b80

smaato

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/smaato/banner.go:9:		extractAdmBanner		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/native.go:14:	extractAdmNative		85.7%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:70:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:79:	MakeRequests			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:99:	MakeBids			85.3%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:163:	makeIndividualRequests		89.5%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:196:	splitImpressionsByMediaType	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:226:	makePodRequests			84.6%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:250:	makeRequest			85.7%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:269:	getAdMarkupType			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:279:	getTTLFromHeaderOrDefault	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:293:	renderAdMarkup			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:308:	convertAdMarkupTypeToMediaType	80.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:323:	prepareCommonRequest		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:338:	prepareIndividualRequest	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:348:	preparePodRequest		80.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:360:	setUser				95.2%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:403:	setExt				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:411:	setSite				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:431:	setApp				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:438:	setDOOH				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:445:	setPublisherId			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:468:	setImpForAdspace		90.9%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:488:	setImpForAdBreak		94.1%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:520:	makeImpExt			90.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:542:	groupImpressionsByPod		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:562:	buildBidVideo			87.5%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:582:	extractBidExt			100.0%
total:									(statements)			93.3%

@Enigo Enigo requested a review from przemkaczmarek July 23, 2024 04:01
przemkaczmarek
przemkaczmarek previously approved these changes Jul 23, 2024
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, 54f78bf

smaato

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/smaato/banner.go:9:		extractAdmBanner		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/native.go:14:	extractAdmNative		85.7%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:70:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:79:	MakeRequests			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:99:	MakeBids			85.3%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:163:	makeIndividualRequests		89.5%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:196:	splitImpressionsByMediaType	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:226:	makePodRequests			84.6%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:250:	makeRequest			85.7%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:269:	getAdMarkupType			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:279:	getTTLFromHeaderOrDefault	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:293:	renderAdMarkup			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:308:	convertAdMarkupTypeToMediaType	80.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:323:	prepareCommonRequest		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:338:	prepareIndividualRequest	100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:348:	preparePodRequest		80.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:360:	setUser				95.2%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:403:	setExt				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:411:	setSite				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:431:	setApp				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:438:	setDOOH				100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:445:	setPublisherId			100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:468:	setImpForAdspace		90.9%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:488:	setImpForAdBreak		94.1%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:520:	makeImpExt			90.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:542:	groupImpressionsByPod		100.0%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:562:	buildBidVideo			87.5%
github.com/prebid/prebid-server/v2/adapters/smaato/smaato.go:582:	extractBidExt			100.0%
total:									(statements)			93.3%

@Enigo
Copy link
Contributor Author

Enigo commented Jul 25, 2024

@przemkaczmarek @bsardo
I've rebased this PR from the latest master, no other changes were made
so I think the build on master is broken?

@bsardo bsardo self-assigned this Jul 29, 2024
@bsardo bsardo merged commit 466ff83 into prebid:master Jul 29, 2024
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
Status: Ready for Dev
Development

Successfully merging this pull request may close these issues.

5 participants