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

Pubmatic: Forward displaymanager and displaymanagerver from app ext #4000

Merged
merged 4 commits into from
Dec 10, 2024

Conversation

AvinashKapre
Copy link
Contributor

No description provided.

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

pubmatic

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:85:	MakeRequests				92.2%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:195:	validateAdSlot				91.3%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:238:	assignBannerSize			100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:246:	assignBannerWidthAndHeight		100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:254:	parseImpressionObject			92.2%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:351:	extractPubmaticExtFromRequest		96.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:403:	getAlternateBidderCodesFromRequestExt	100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:421:	addKeywordsToExt			85.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:435:	MakeBids				90.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:517:	getNativeAdm				90.9%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:539:	getMapFromJSON				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:551:	populateFirstPartyDataImpAttributes	100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:564:	populateAdUnitKey			100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:579:	populateDctrKey				85.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:629:	getStringArray				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:642:	getBidType				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:662:	Builder					100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:671:	getDisplayManagerAndVer			100.0%
total:									(statements)				93.1%

@SyntaxNode SyntaxNode changed the title Forward displaymanager and displaymanagerver from app extension to pubmatic ssp Pubmatic: Forward displaymanager and displaymanagerver from app extension to pubmatic ssp Oct 21, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

Coded unit tests are fine, but we look at the json test coverage since that includes additional assertions for memory safety. Please add json tests to cover this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the test cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

@SyntaxNode Can you please review the latest 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, 38ea889

pubmatic

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:85:	MakeRequests				93.8%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:195:	validateAdSlot				91.3%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:238:	assignBannerSize			100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:246:	assignBannerWidthAndHeight		100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:254:	parseImpressionObject			92.2%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:351:	extractPubmaticExtFromRequest		96.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:403:	getAlternateBidderCodesFromRequestExt	100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:421:	addKeywordsToExt			85.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:435:	MakeBids				90.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:517:	getNativeAdm				90.9%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:539:	getMapFromJSON				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:551:	populateFirstPartyDataImpAttributes	100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:564:	populateAdUnitKey			100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:579:	populateDctrKey				85.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:629:	getStringArray				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:642:	getBidType				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:662:	Builder					100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:671:	getDisplayManagerAndVer			100.0%
total:									(statements)				93.4%

@pm-isha-bharti
Copy link
Contributor

@SyntaxNode Can you please review and merge the latest changes?

przemkaczmarek
przemkaczmarek previously approved these changes Nov 22, 2024
@pm-isha-bharti
Copy link
Contributor

pm-isha-bharti commented Nov 26, 2024

Hi @bsardo / @SyntaxNode

Can you please review and merge this PR?

Thanks

Comment on lines +678 to +682
if source, err := jsonparser.GetString(app.Ext, "source"); err == nil && source != "" {
if version, err := jsonparser.GetString(app.Ext, "version"); err == nil && version != "" {
return source, version
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

As mentioned earlier here, you're missing JSON test coverage.
Please add another display manager JSON test where the source and version are present at app.ext but not at app.ext.prebid to cover these lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

return source, version
}
}
return "", ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

As mentioned earlier here, you're missing JSON test coverage. Please either add a new JSON test or modify an existing JSON test so app.ext is present but without source or version being set so this default case is covered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

want want
}{
{
name: "request app object is not nil but app.ext has no source and version",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update the name strings throughout this test substituting dashes or underscores for spaces. t.Run does this automatically so doing this in the tests makes it easy to search for failed tests in the code base.
e.g. name: "request-app-object-is-not-nil-but-app.ext-has-no-source-and-version"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link

github-actions bot commented Dec 4, 2024

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, e55d42c

pubmatic

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:85:	MakeRequests				93.8%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:195:	validateAdSlot				91.3%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:238:	assignBannerSize			100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:246:	assignBannerWidthAndHeight		100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:254:	parseImpressionObject			92.2%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:351:	extractPubmaticExtFromRequest		96.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:403:	getAlternateBidderCodesFromRequestExt	100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:421:	addKeywordsToExt			85.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:435:	MakeBids				90.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:517:	getNativeAdm				90.9%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:539:	getMapFromJSON				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:551:	populateFirstPartyDataImpAttributes	100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:564:	populateAdUnitKey			100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:579:	populateDctrKey				85.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:629:	getStringArray				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:642:	getBidType				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:662:	Builder					100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:671:	getDisplayManagerAndVer			100.0%
total:									(statements)				93.4%

@AvinashKapre
Copy link
Contributor Author

@bsardo @SyntaxNode, Addressed review comments please review.

Copy link

github-actions bot commented Dec 4, 2024

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, 543fcce

pubmatic

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:85:	MakeRequests				93.8%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:195:	validateAdSlot				91.3%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:238:	assignBannerSize			100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:246:	assignBannerWidthAndHeight		100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:254:	parseImpressionObject			92.2%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:351:	extractPubmaticExtFromRequest		96.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:403:	getAlternateBidderCodesFromRequestExt	100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:421:	addKeywordsToExt			85.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:435:	MakeBids				90.7%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:517:	getNativeAdm				90.9%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:539:	getMapFromJSON				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:551:	populateFirstPartyDataImpAttributes	100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:564:	populateAdUnitKey			100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:579:	populateDctrKey				85.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:629:	getStringArray				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:642:	getBidType				100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:662:	Builder					100.0%
github.com/prebid/prebid-server/v2/adapters/pubmatic/pubmatic.go:671:	getDisplayManagerAndVer			100.0%
total:									(statements)				93.4%

@bsardo bsardo changed the title Pubmatic: Forward displaymanager and displaymanagerver from app extension to pubmatic ssp Pubmatic: Forward displaymanager and displaymanagerver from app ext Dec 4, 2024
@bsardo bsardo merged commit 994ef5b into prebid:master Dec 10, 2024
5 checks passed
scr-oath pushed a commit to scr-oath/prebid-server that referenced this pull request Dec 16, 2024
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.

5 participants