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

Huaweiads: Remove empty image assets from response #3308

Merged
merged 2 commits into from
Nov 23, 2023
Merged

Huaweiads: Remove empty image assets from response #3308

merged 2 commits into from
Nov 23, 2023

Conversation

ahmetfaruk59
Copy link
Contributor

bind the number of main image objects from huaweiads instead of all main image objects in the request

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

huaweiads

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:267:		MakeRequests				93.3%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:325:		getFinalEndPoint			85.7%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:355:		MakeBids				91.7%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:382:		Builder					100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:395:		getExtraInfo				94.1%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:430:		getHeaders				88.9%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:446:		getReqJson				90.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:461:		getReqAdslot30				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:483:		checkAndExtractOpenrtbFormat		100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:511:		getBannerFormat				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:527:		getNativeFormat				97.4%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:593:		filterPopularSizes			100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:615:		getVideoFormat				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:628:		convertAdtypeStringToInteger		60.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:652:		getReqAppInfo				93.8%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:686:		getFinalPkgName				93.8%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:721:		getClientTime				75.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:741:		getReqDeviceInfo			96.6%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:784:		getCountryCode				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:797:		convertCountryCode			75.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:818:		getCountryCodeFromMCC			100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:835:		getDeviceIDFromUserExt			100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:880:		getReqNetWorkInfo			85.7%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:916:		getReqRegsInfo				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:925:		getReqGeoInfo				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:937:		getReqConsentInfo			80.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:947:		unmarshalExtImpHuaweiAds		88.2%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:974:		checkRespStatusCode			77.8%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:997:		checkHuaweiAdsResponseRetcode		71.4%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1015:	convertHuaweiAdsRespToBidderResp	90.2%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1084:	getNurl					66.7%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1097:	handleHuaweiAdsContent			87.5%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1117:	extractAdmBanner			60.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1139:	extractAdmNative			86.4%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1262:	getDecodeValue				80.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1273:	jsonEncode				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1282:	extractAdmPicture			90.9%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1345:	getClickUrl				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1362:	getDspImpClickTrackings			100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1376:	getStrings				87.5%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1391:	getDuration				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1398:	extractAdmVideo				85.4%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1561:	getVastImpClickErrorTrackingUrls	100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1581:	getVastEventTrackingUrls		100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1601:	computeHmacSha256			100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1608:	getDigestAuthorization			100.0%
total:										(statements)				90.3%

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, 932600e

huaweiads

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:267:		MakeRequests				93.3%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:325:		getFinalEndPoint			85.7%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:355:		MakeBids				91.7%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:382:		Builder					100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:395:		getExtraInfo				94.1%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:430:		getHeaders				88.9%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:446:		getReqJson				90.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:461:		getReqAdslot30				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:483:		checkAndExtractOpenrtbFormat		100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:511:		getBannerFormat				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:527:		getNativeFormat				97.4%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:593:		filterPopularSizes			100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:615:		getVideoFormat				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:628:		convertAdtypeStringToInteger		60.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:652:		getReqAppInfo				93.8%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:686:		getFinalPkgName				93.8%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:721:		getClientTime				75.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:741:		getReqDeviceInfo			96.6%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:784:		getCountryCode				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:797:		convertCountryCode			75.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:818:		getCountryCodeFromMCC			100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:835:		getDeviceIDFromUserExt			100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:880:		getReqNetWorkInfo			85.7%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:916:		getReqRegsInfo				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:925:		getReqGeoInfo				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:937:		getReqConsentInfo			80.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:947:		unmarshalExtImpHuaweiAds		88.2%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:974:		checkRespStatusCode			77.8%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:997:		checkHuaweiAdsResponseRetcode		71.4%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1015:	convertHuaweiAdsRespToBidderResp	90.2%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1084:	getNurl					66.7%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1097:	handleHuaweiAdsContent			87.5%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1117:	extractAdmBanner			60.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1139:	extractAdmNative			86.4%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1262:	getDecodeValue				80.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1273:	jsonEncode				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1282:	extractAdmPicture			90.9%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1345:	getClickUrl				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1362:	getDspImpClickTrackings			100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1376:	getStrings				87.5%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1391:	getDuration				100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1398:	extractAdmVideo				85.4%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1561:	getVastImpClickErrorTrackingUrls	100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1581:	getVastEventTrackingUrls		100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1601:	computeHmacSha256			100.0%
github.com/prebid/prebid-server/v2/adapters/huaweiads/huaweiads.go:1608:	getDigestAuthorization			100.0%
total:										(statements)				90.3%

@SyntaxNode SyntaxNode changed the title Fix: Huaweiads remove empty image assets from response Huaweiads: Remove empty image assets from response Nov 20, 2023
Comment on lines +1181 to +1183
if len(content.MetaData.ImageInfo) == imgIndex && asset.Img.Type == native1.ImageAssetTypeMain {
continue
}
Copy link
Contributor

@onkarvhanumante onkarvhanumante Nov 22, 2023

Choose a reason for hiding this comment

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

@ahmetfaruk59 could you help to explain how this change bind the number of main image objects from huaweiads instead of all main image objects in the request

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @onkarvhanumante. Previously all assets for main image type in the request were included in the response. Now only the main images returned from the huaweiads service are returned as a response. in the mentioned condition block, imgIndex is for making sure that all returned ads from huaweiads are binded to response and the type of the asset is main image type3. after all image assets from the service is binded then "continue" for other image main assets in the request
Previous:
request: "{assets:[
{required:0,title:{len:90}},
{required:0,img:{type:1,w:20,wmin:20,h:20,hmin:20}},
{required:0,img:{type:3,w:300,wmin:300,h:250,hmin:250}},
{required:0,img:{type:3,w:640,wmin:640,h:360,hmin:360}},
{required:0,img:{type:3,w:1312,wmin:1080,h:607,hmin:768}},
...
...
]}
response
assets:[
{id:0,title:{text:"Jewel Blast Legend",len:18}},
{id:2,img:{type:1,url:"image1.png",w:20,h:20}},
{id:2,img:{type:3,url:"image2.png",w:1080,h:607}},
{id:3,img:{type:3,url: " " ,w:300,h:250}},
{id:4,img:{type:3,url: " " ,w:320,h:250}},
{id:5,img:{type:3,url: "" ,w:1312,h:768}},
.
.
.
]

@Sonali-More-Xandr Sonali-More-Xandr merged commit 6f5b03e into prebid:master Nov 23, 2023
5 checks passed
SuprPhatAnon pushed a commit to GiftConnect/prebid-server that referenced this pull request Dec 7, 2023
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.

3 participants