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

PulsePoint: Marking cp/ct params to be either String or Int #3677

Merged

Conversation

anand-venkatraman
Copy link
Contributor

No description provided.

Copy link

github-actions bot commented May 9, 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, 929b96b

pulsepoint

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:22:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:29:	MakeRequests	95.6%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:106:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:153:	getBidType	88.9%
total:										(statements)	96.2%

@bsardo bsardo changed the title PulsePoint Adapter: Marking cp/ct params to be either String or Int PulsePoint: Marking cp/ct params to be either String or Int May 13, 2024
Comment on lines +8 to +18
"type": [
"integer",
"string"
],
"description": "An ID which identifies the publisher selling the impression"
},
"ct": {
"type": "integer",
"type": [
"integer",
"string"
],
Copy link
Contributor

Choose a reason for hiding this comment

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

@anand-venkatraman could you add JSON test where cp and ct are string

Copy link
Contributor

Choose a reason for hiding this comment

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

@anand-venkatraman requesting to address above comment ^^

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry for the delay, i have added a few tests cases to validParams under params_test.go file.

Copy link
Contributor

Choose a reason for hiding this comment

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

@anand-venkatraman thanks for adding params test. Requesting to add Json framework tests as well for scenario where cp and ct are string in imp.ext

Copy link
Contributor Author

@anand-venkatraman anand-venkatraman Jun 12, 2024

Choose a reason for hiding this comment

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

addressed in commit 4539af1

Copy link

github-actions bot commented Jun 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, e732c3f

pulsepoint

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:22:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:29:	MakeRequests	95.6%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:106:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:153:	getBidType	88.9%
total:										(statements)	96.2%

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, 4539af1

pulsepoint

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:23:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:30:	MakeRequests	88.7%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:121:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:168:	getBidType	88.9%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:182:	parseParam	100.0%
total:										(statements)	92.5%

Comment on lines 7 to 8
PubID interface{} `json:"cp"`
TagID interface{} `json:"ct"`
Copy link
Contributor

Choose a reason for hiding this comment

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

PubID and TagID are expected to be int or string.
However interface{} will allow int, string and any other values

Should use StringInt type

package jsonutil
import (
"github.com/buger/jsonparser"
)
type StringInt int
func (st *StringInt) UnmarshalJSON(b []byte) error {
if len(b) == 0 {
return nil
}
if b[0] == '"' {
b = b[1 : len(b)-1]
}
if len(b) == 0 {
return nil
}
i, err := jsonparser.ParseInt(b)
if err != nil {
return err
}
*st = StringInt(i)
return nil
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated params to use StringInt instead of interface{}

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.

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, 394b0da

pulsepoint

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:25:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:32:	MakeRequests	92.5%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:123:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:170:	getBidType	88.9%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:184:	parseParam	100.0%
total:										(statements)	94.5%

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, 0a2a52c

pulsepoint

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:25:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:32:	MakeRequests	92.5%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:123:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:170:	getBidType	88.9%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:184:	parseParam	100.0%
total:										(statements)	94.5%

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

pulsepoint

Refer here for heat map coverage report

github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:24:	Builder		100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:31:	MakeRequests	92.5%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:122:	MakeBids	100.0%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:169:	getBidType	88.9%
github.com/prebid/prebid-server/v2/adapters/pulsepoint/pulsepoint.go:183:	parseParam	100.0%
total:										(statements)	94.4%

@gargcreation1992 gargcreation1992 merged commit a907ecb into prebid:master Jul 1, 2024
5 checks passed
mefjush pushed a commit to adhese/prebid-server that referenced this pull request Jul 19, 2024
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.

None yet

3 participants