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

Attekmi: Remove partnerName param requirement #4208

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

SmartHubSolutions
Copy link
Contributor

@SmartHubSolutions SmartHubSolutions commented Feb 13, 2025

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

smarthub

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:30:	Builder			80.0%
github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:43:	getImpressionExt	100.0%
github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:61:	buildEndpointURL	100.0%
github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:74:	MakeRequests		86.7%
github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:111:	MakeBids		96.4%
github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:187:	getBidType		100.0%
total:									(statements)		93.3%

@SmartHubSolutions
Copy link
Contributor Author

@SyntaxNode @bsardo Please review it.

@bsardo bsardo self-assigned this Feb 13, 2025
@bsardo bsardo added the adapter label Feb 13, 2025
@bsardo bsardo changed the title Attekmi: not required partnerName hotfix Attekmi: Remove partnerName param requirement Feb 13, 2025
@@ -35,11 +35,9 @@ var invalidParams = []string{
`{"partnerName":"partnertest"}`,
`{"seat":"9Q20EdGxzgWdfPYShScl"}`,
`{"token":"Y9Evrh40ejsrCR4EtidUt1cSxhJsz8X1"}`,
`{"seat":"9Q20EdGxzgWdfPYShScl", "token":"alNYtemWggraDVbhJrsOs9pXc3Eld32E"}`,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since none of your params are now considered required, please add the following test cases to validParams to ensure that the absence of each param is valid, the empty string is allowed for partnerId and a minimum length of 1 is valid for seat and token:

{"partnerName":""}
{"partnerName":"1"}
{"seat":"1"},
{"token":"1"},

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok I added this test cases and all tests was passed

Copy link
Contributor

Choose a reason for hiding this comment

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

Since none of your params are now considered required

@bsardo - The seat and token params are still required in this schema.

Copy link
Contributor Author

@SmartHubSolutions SmartHubSolutions Feb 13, 2025

Choose a reason for hiding this comment

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

Hmm this cases I added to invalidParams because we using parnterName+seat+token OR seat+token in aliases, this means that the pair seat+token will always be required.

For example:

endpoint: "https://prebid.attekmi.com/pbserver?partnerName={{.Host}}&seat={{.AccountID}}&token={{.SourceId}}"

endpoint: "https://vimayx-prebid.attekmi.com/pbserver/?seat={{.AccountID}}&token={{.SourceId}}"

adapters/smarthub/smarthub.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, f4bedfc

smarthub

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:30:	Builder			80.0%
github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:43:	getImpressionExt	100.0%
github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:61:	buildEndpointURL	100.0%
github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:71:	MakeRequests		86.7%
github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:108:	MakeBids		96.4%
github.com/prebid/prebid-server/v3/adapters/smarthub/smarthub.go:184:	getBidType		100.0%
total:									(statements)		93.1%

AccountID: params.Seat,
SourceId: params.Token,
Host: params.PartnerName,
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be better to delete the Host template param entirely. This is only used for endpoint macros and neither smarthub nor its aliases use this macro.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, we use both methods of redirecting traffic, both through partnerName and using aliases.We also need to use param partnerName to temporarily connect partners.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see. The aliases do not use this macro, but the base smarthub adapter does. Ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants