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

Silvermob: Use mtype and add global host #3936

Merged
merged 7 commits into from
Dec 10, 2024
Merged

Conversation

freemmy
Copy link
Contributor

@freemmy freemmy commented Sep 24, 2024

Metdia type detection by mtype rather than by imp object
global host for geo-based routing added

errs = append(errs, err)
} else {
bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{
Bid: &bid,

Choose a reason for hiding this comment

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

Found incorrect assignment made to Bid. bid variable receives a new value in each iteration of range loop. Assigning the address of bid (&bid) to Bid will result in a pointer that always points to the same memory address with the value of the last iteration. This can lead to unexpected behavior or incorrect results. Refer https://go.dev/play/p/9ZS1f-5h4qS
Consider using an index variable in the seatBids.Bid loop as shown below

  for _, seatBid := range response.SeatBid {
    for i := range seatBids.Bid {
      ...
      responseBid := &adapters.TypedBid{
        Bid: &seatBids.Bid[i],
        ...
      }
      ...
      ...
    }
  }

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, 8a597e3

silvermob

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:21:	isValidHost			100.0%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:26:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:38:	GetHeaders			91.7%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:61:	MakeRequests			91.3%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:112:	getImpressionExt		85.7%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:128:	buildEndpointURL		100.0%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:139:	MakeBids			100.0%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:197:	getBidMediaTypeFromMtype	83.3%
total:									(statements)			93.6%

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, 457a76d

silvermob

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:21:	isValidHost			100.0%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:26:	Builder				100.0%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:38:	GetHeaders			91.7%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:61:	MakeRequests			91.3%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:112:	getImpressionExt		85.7%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:128:	buildEndpointURL		100.0%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:139:	MakeBids			100.0%
github.com/prebid/prebid-server/v2/adapters/silvermob/silvermob.go:198:	getBidMediaTypeFromMtype	83.3%
total:									(statements)			93.7%

@bsardo bsardo changed the title Metdia type detection by mtype, global host added Silvermob: Use mtype and add global host Sep 24, 2024
@przemkaczmarek przemkaczmarek self-assigned this Oct 10, 2024
@przemkaczmarek przemkaczmarek self-requested a review October 10, 2024 13:28
przemkaczmarek
przemkaczmarek previously approved these changes Oct 22, 2024
@bsardo
Copy link
Collaborator

bsardo commented Nov 4, 2024

Hi @freemmy, we recently released PBS 3.0, more specifically v3.1.0, which updates Prebid Server package import references throughout the project from v2 to v3.
For example:

import (
    "github.com/prebid/prebid-server/v3/adapters"
)

As a result, please merge with master (no rebase) and then ensure all Prebid Server package import references in the files you’ve changed are v3 such that the test suite passes so we can resume reviewing. Thanks!

Merge upstream/master and update imports to v3
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, 2e4b140

silvermob

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:22:	isValidHost			100.0%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:27:	Builder				100.0%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:39:	GetHeaders			91.7%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:62:	MakeRequests			91.3%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:113:	getImpressionExt		85.7%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:129:	buildEndpointURL		100.0%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:140:	MakeBids			100.0%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:199:	getBidMediaTypeFromMtype	83.3%
total:									(statements)			93.7%

@freemmy
Copy link
Contributor Author

freemmy commented Nov 13, 2024

Hi @freemmy, we recently released PBS 3.0, more specifically v3.1.0, which updates Prebid Server package import references throughout the project from v2 to v3. For example:

import (
    "github.com/prebid/prebid-server/v3/adapters"
)

As a result, please merge with master (no rebase) and then ensure all Prebid Server package import references in the files you’ve changed are v3 such that the test suite passes so we can resume reviewing. Thanks!

Done, could you please review? Thanks in advance

@freemmy
Copy link
Contributor Author

freemmy commented Nov 21, 2024

Hi @freemmy, we recently released PBS 3.0, more specifically v3.1.0, which updates Prebid Server package import references throughout the project from v2 to v3. For example:

import (
    "github.com/prebid/prebid-server/v3/adapters"
)

As a result, please merge with master (no rebase) and then ensure all Prebid Server package import references in the files you’ve changed are v3 such that the test suite passes so we can resume reviewing. Thanks!

Hello @bsardo, could you let us know when the review might be completed? Our pull request has been pending for 2 months now, and during this time, our adapter has an issue where bid requests containing both video and banner are always treated as video. This prevents us from serving banners in such cases. As a result, OpenWrap isn’t functioning properly with 300x250 and 320x480 ad sizes.

@bsardo
Copy link
Collaborator

bsardo commented Dec 5, 2024

Hi @freemmy, sorry for the delay. We've been overloaded. I'll give this a look today.

@bsardo bsardo self-assigned this Dec 5, 2024
Comment on lines 207 to 210
case openrtb2.MarkupAudio:
return openrtb_ext.BidTypeAudio, nil
default:
return "", fmt.Errorf("Unable to fetch mediaType for imp: %s", bid.ImpID)
Copy link
Collaborator

Choose a reason for hiding this comment

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

According to your YAML file you don't support audio which leads me to believe this case statement should be removed so that an audio mtype results in an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually we do support audio, but I've removed for now this case statement. We will back it later when add tests and update yaml

Copy link

github-actions bot commented Dec 6, 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, 65354fa

silvermob

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:22:	isValidHost			100.0%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:27:	Builder				100.0%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:39:	GetHeaders			91.7%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:62:	MakeRequests			91.3%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:113:	getImpressionExt		85.7%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:129:	buildEndpointURL		100.0%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:140:	MakeBids			100.0%
github.com/prebid/prebid-server/v3/adapters/silvermob/silvermob.go:199:	getBidMediaTypeFromMtype	100.0%
total:									(statements)			94.9%

@bsardo bsardo merged commit 30b1d75 into prebid:master Dec 10, 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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants