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

Missena: Update params #4057

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

Conversation

jney
Copy link

@jney jney commented Nov 18, 2024

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, 9144aec

missena

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/missena/missena.go:76:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:83:	getCurrency	77.8%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:99:	makeRequest	87.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:165:	MakeRequests	91.3%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:209:	readGDPR	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:229:	MakeBids	94.1%
total:									(statements)	90.7%

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, 091ffa9

missena

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/missena/missena.go:76:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:83:	getCurrency	77.8%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:99:	makeRequest	87.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:165:	MakeRequests	91.3%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:209:	readGDPR	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:229:	MakeBids	94.1%
total:									(statements)	90.7%

url: https://sync.missena.io/iframe?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&t={{.APIKey}}&redirect={{.RedirectURL}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
url: https://sync.missena.io/iframe?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&t={{.APIKey}}&redirect={{.RedirectURL}}
url: https://sync.missena.io/iframe?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&redirect={{.RedirectURL}}

{{.APIKey}} is not a supported macro in Prebid Server

Copy link
Author

Choose a reason for hiding this comment

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

fixed

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, 9398c8a

missena

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/missena/missena.go:76:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:83:	getCurrency	77.8%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:99:	makeRequest	87.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:165:	MakeRequests	91.3%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:208:	readGDPR	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:228:	MakeBids	94.1%
total:									(statements)	90.7%

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, 75e77ba

missena

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/missena/missena.go:76:	Builder		100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:83:	getCurrency	77.8%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:99:	makeRequest	87.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:165:	MakeRequests	91.3%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:208:	readGDPR	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:228:	MakeBids	94.1%
total:									(statements)	90.7%

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

missena

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/missena/missena.go:64:	Builder		80.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:75:	getCurrency	77.8%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:91:	getEndPoint	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:98:	makeRequest	84.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:167:	MakeRequests	89.5%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:201:	readGDPR	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:221:	MakeBids	94.1%
total:									(statements)	88.8%

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

missena

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/missena/missena.go:64:	Builder		80.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:75:	getCurrency	77.8%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:91:	getEndPoint	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:98:	makeRequest	84.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:167:	MakeRequests	89.5%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:201:	readGDPR	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:221:	MakeBids	94.1%
total:									(statements)	88.8%

@SyntaxNode SyntaxNode changed the title update missena's params missena: update params Nov 20, 2024
url: https://sync.missena.io/iframe?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&t=YOUR_API_KEY&redirect={{.RedirectURL}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is an api key from Missena now required for user syncing?

Copy link
Author

Choose a reason for hiding this comment

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

yes

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for confirming. It's not appropriate to define user syncing which does not work out of the box. Please update this config to indicate that user syncing is possible, but requires configuring with a Missena provided api key. To signal availability of user syncing to host companies, please use the supports attribute documented here.

You're welcomed to keep the url and usermacro definitions if they're commented out.

}
currency, err := getCurrency(request.Cur)
if err != nil {
// TODO: convert unsupported currency on response
Copy link
Contributor

Choose a reason for hiding this comment

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

Please resolve the TODO.

Copy link
Author

Choose a reason for hiding this comment

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

I'd actually like to manage it on a next release. is it possible? should I remove the comment and consider some currencies unsupported

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@bsardo bsardo changed the title missena: update params Missena: Update params Nov 22, 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, 8f5c3f5

missena

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/missena/missena.go:66:	Builder		80.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:77:	getCurrency	77.8%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:93:	getEndPoint	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:100:	makeRequest	68.6%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:182:	MakeRequests	89.5%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:216:	readGDPR	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:236:	MakeBids	94.1%
total:									(statements)	82.8%

Copy link

github-actions bot commented Dec 3, 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, 5b606eb

missena

Refer here for heat map coverage report

github.com/prebid/prebid-server/v3/adapters/missena/missena.go:66:	Builder		80.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:77:	getCurrency	77.8%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:93:	getEndPoint	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:100:	makeRequest	75.6%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:198:	MakeRequests	89.5%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:232:	readGDPR	100.0%
github.com/prebid/prebid-server/v3/adapters/missena/missena.go:252:	MakeBids	94.1%
total:									(statements)	84.4%

url: https://sync.missena.io/iframe?gdpr={{.GDPR}}&gdpr_consent={{.GDPRConsent}}&us_privacy={{.USPrivacy}}&t=YOUR_API_KEY&redirect={{.RedirectURL}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for confirming. It's not appropriate to define user syncing which does not work out of the box. Please update this config to indicate that user syncing is possible, but requires configuring with a Missena provided api key. To signal availability of user syncing to host companies, please use the supports attribute documented here.

You're welcomed to keep the url and usermacro definitions if they're commented out.

body, errm := json.Marshal(missenaRequest)
if errm != nil {
return nil, errm
body, err := json.Marshal(missenaRequest)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use jsonutil.Marshal as a drop in replacement for json.Marshal.

}
return bidder, nil
}

func (a *adapter) makeRequest(missenaParams MissenaInternalParams, reqInfo *adapters.ExtraRequestInfo, impID string, request *openrtb2.BidRequest) (*adapters.RequestData, error) {
url := a.endpoint + "?t=" + missenaParams.ApiKey
func getCurrency(currencies []string) (string, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think is better to use MAP:

    currencySet := make(map[string]struct{}, len(currencies))
    for _, cur := range currencies {
        currencySet[cur] = struct{}{}
    }

    if _, found := currencySet[defaultCur]; found {
        return defaultCur, nil
    }
    if _, found := currencySet["EUR"]; found {
        return "EUR", nil
    }
    return "", fmt.Errorf("no currency supported %v", currencies)
}```
what Do You think? 

@@ -124,26 +209,20 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapte
continue
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIP:
Message: fmt.Sprintf("Error parsing bidderExt object: %v, input: %s", err, string(imp.Ext)),

httpRequests = append(httpRequests, newHttpRequest)

break
Copy link
Collaborator

Choose a reason for hiding this comment

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

break in the loop causes only the first imp to be processed. If this is intentional, it's worth making it clearer in the code, e.g., with a comment or better naming.

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.

4 participants