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

New Adapter: QT #3696

Merged
merged 5 commits into from
Aug 1, 2024
Merged

New Adapter: QT #3696

merged 5 commits into from
Aug 1, 2024

Conversation

qt-io
Copy link
Contributor

@qt-io qt-io commented May 21, 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, 05e07f0

qt

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/qt/qt.go:29:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:36:	MakeRequests	76.5%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:91:	makeRequest	85.7%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:109:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:146:	getBidType	83.3%
total:								(statements)	85.3%

adapters/qt/qt.go Outdated Show resolved Hide resolved
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, 8fafb87

qt

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/qt/qt.go:29:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:36:	MakeRequests	76.5%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:91:	makeRequest	85.7%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:109:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:146:	getBidType	100.0%
total:								(statements)	86.6%

@qt-io
Copy link
Contributor Author

qt-io commented Jun 3, 2024

@onkarvhanumante can you please check again?

Comment on lines 83 to 88
if len(adapterRequests) == 0 {
errs = append(errs, errors.New("found no valid impressions"))
return nil, errs
}

return adapterRequests, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

These could be combined as - return adapterRequests, append(errs, errors.New("found no valid impressions"))

Copy link
Contributor

Choose a reason for hiding this comment

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

@qt-io please update on the comment above.

Copy link
Contributor

Choose a reason for hiding this comment

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

@qt-io Gentle reminder.

Copy link
Contributor Author

@qt-io qt-io Jun 25, 2024

Choose a reason for hiding this comment

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

@gargcreation1992 but this code will append error "found no valid impressions" even if len(adapterRequests) > 0
So, what's the purpose of that? Perhaps I'm missing something.
Maybe better to do something like this:

if len(adapterRequests) == 0 {
	errs = append(errs, errors.New("found no valid impressions"))
}

return adapterRequests, errs

?

Copy link
Contributor

Choose a reason for hiding this comment

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

^ Looks good to me. These are equivalent since adapterRequests will be nil if never appended.

Not sure what value a "found no valid impressions" error provides since there must be at least one error for this condition to be hit.

Comment on lines 83 to 88
if len(adapterRequests) == 0 {
errs = append(errs, errors.New("found no valid impressions"))
return nil, errs
}

return adapterRequests, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

^ Looks good to me. These are equivalent since adapterRequests will be nil if never appended.

Not sure what value a "found no valid impressions" error provides since there must be at least one error for this condition to be hit.


func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderQT, config.Adapter{
Endpoint: "https://endpoint1.qt.io/pserver"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: It's not necessary to use a real url for tests. Might be easier to use an obviously fake value so there's no pressure to keep it updated.

static/bidder-info/qt.yaml Outdated Show resolved Hide resolved
@qt-io
Copy link
Contributor Author

qt-io commented Jun 27, 2024

@SyntaxNode @gargcreation1992 @onkarvhanumante
So let's sum this up. What do we need to do for this pull request to be approved?

  • We need to change maintainer email
  • What do we need to do with the code? Because every reviewer says differently. Do we need to change something or everything is ok?

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, 70882e9

qt

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/qt/qt.go:29:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:36:	MakeRequests	76.5%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:91:	makeRequest	85.7%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:109:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:146:	getBidType	100.0%
total:								(statements)	86.6%

@SyntaxNode
Copy link
Contributor

  • We need to change maintainer email

Yes. This needs to be a group email address and we need to receive a reply from a test email to approve.

  • What do we need to do with the code? Because every reviewer says differently. Do we need to change something or everything is ok?

I see only the len(adapterRequests) == 0 thread unresolved. The code is fine. Please review my comment to verify you want to include the "found no valid impressions" error message.

@qt-io qt-io requested a review from SyntaxNode July 1, 2024 07:26
@qt-io
Copy link
Contributor Author

qt-io commented Jul 1, 2024

@SyntaxNode email changed

@@ -0,0 +1,18 @@
endpoint: "https://endpoint1.qt.io/pserver"
maintainer:
email: "[email protected]"
Copy link
Contributor

Choose a reason for hiding this comment

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

Prebid team has sent email to verify above maintainers email. Requesting to responding back on email thread

Copy link
Contributor

Choose a reason for hiding this comment

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

received response on email thread

Comment on lines +17 to +18
url: "https://cs.qt.io/pbserver?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&gpp={{.GPP}}&gpp_sid={{.GPPSID}}&redir={{.RedirectURL}}"
userMacro: "[UID]"
Copy link
Contributor

Choose a reason for hiding this comment

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

redirect url is working

https://cs.qt.io/pbserver?gdpr=&gdpr_consent=&us_privacy=&gpp=&gpp_sid=&redir=https%3A%2F%2Fprebid.adnxs.com%2Fpbs%2Fv1%2Fsetuid%3Fbidder%3DQT%26gdpr%3D%26gdpr_consent%3D%26f%3Di%26uid%3D%22%5BUID%5D%22

Copy link
Contributor

@onkarvhanumante onkarvhanumante left a comment

Choose a reason for hiding this comment

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

@qt-io
Copy link
Contributor Author

qt-io commented Jul 16, 2024

@onkarvhanumante The email has been responded to

Copy link
Collaborator

@bsardo bsardo left a comment

Choose a reason for hiding this comment

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

@qt-io The code looks good. I left two comments.

Could you also please acknowledge these two outstanding comments?
#3696 (comment)

#3696 (comment)

"httpCalls": [
{
"expectedRequest": {
"uri": "https://endpoint1.qt.io/pserver",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest using a fake url in all of your tests instead of a real url.

}
},
{
"id": "test-imp-id",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest making this imp ID different from the first imp so you can be sure the adapter is working properly.

Copy link

github-actions bot commented Aug 1, 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, 8fe38fd

qt

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/qt/qt.go:29:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:36:	MakeRequests	76.5%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:91:	makeRequest	85.7%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:109:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:146:	getBidType	100.0%
total:								(statements)	86.6%

@qt-io
Copy link
Contributor Author

qt-io commented Aug 1, 2024

@bsardo @onkarvhanumante improved multi-imp test and used fake URLs in tests. I also removed 'no valid impression' error from code. Can this PR be merged now?

Copy link

github-actions bot commented Aug 1, 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, 9c183b9

qt

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/qt/qt.go:28:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:35:	MakeRequests	74.2%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:85:	makeRequest	85.7%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:103:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/qt/qt.go:140:	getBidType	100.0%
total:								(statements)	85.9%

@onkarvhanumante onkarvhanumante merged commit 7c92e10 into prebid:master Aug 1, 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.

5 participants