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

Add ImpIds in RequestData for associated Impressions #3364

Merged

Conversation

pm-saurabh-narkhede
Copy link
Contributor

@pm-saurabh-narkhede pm-saurabh-narkhede commented Dec 19, 2023

Implements #2973

@bsardo bsardo self-assigned this Dec 19, 2023
Copy link
Contributor

@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.

The approach here looks good. There's still a major effort left though to update the tests which involves explicitly defining what the expected RequestData.ImpIDs are in every adapter's JSON tests via httpCalls[i].expectedRequests.

The team discussed a few possible test solutions and figured we should provide the test framework update we're looking for so that we can be sure we avoid rework.

Please add the following field to httpRequest here (https://github.com/prebid/prebid-server/blob/master/adapters/adapterstest/test_json.go#L203):

ImpIDs  []string        `json:"impIDs"`

If you could then add the following just before the last return statement here (https://github.com/prebid/prebid-server/blob/master/adapters/adapterstest/test_json.go#L321) and update all of the JSON tests accordingly that would be great:

if len(expected.ImpIDs) < 1 {
    return fmt.Errorf(`expected.ImpIDs must contain at least one imp ID`)
}
if !reflect.DeepEqual(expected.ImpIDs, actual.ImpIDs) {
    return fmt.Errorf(`%s actual.ImpIDs "%q" do not match expected "%q"`, description, actual.ImpIDs, expected.ImpIDs)
}

adapters/bidder.go Outdated Show resolved Hide resolved
@pm-saurabh-narkhede
Copy link
Contributor Author

pm-saurabh-narkhede commented Jan 9, 2024

Hello @bsardo,
I shared the same perspective and implemented the changes you requested. Could you kindly review my latest two commits to confirm whether I am heading in the right direction or not?

Copy link
Contributor

@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.

@pm-saurabh-narkhede Your approach looks good. I think you can continue with this for the remaining adapters.

adapters/adapterstest/test_json.go Outdated Show resolved Hide resolved
adapters/adapterstest/test_json.go Outdated Show resolved Hide resolved
@pm-saurabh-narkhede
Copy link
Contributor Author

Hello @bsardo ,
Can you please specifically check this commit 90a190a
where I have added impIDs for json test files where imp.id not present/given.

@prebid prebid deleted a comment from github-actions bot Jan 12, 2024
@prebid prebid deleted a comment from github-actions bot Jan 12, 2024
@prebid prebid deleted a comment from github-actions bot Jan 12, 2024
@prebid prebid deleted a comment from github-actions bot Jan 12, 2024
@prebid prebid deleted a comment from github-actions bot Jan 12, 2024
@prebid prebid deleted a comment from github-actions bot Jan 12, 2024
@SyntaxNode SyntaxNode self-assigned this Jan 16, 2024
@SyntaxNode SyntaxNode self-requested a review January 16, 2024 16:42
@bsardo
Copy link
Contributor

bsardo commented Jan 16, 2024

Hello @bsardo , Can you please specifically check this commit 90a190a where I have added impIDs for json test files where imp.id not present/given.

Hi @pm-saurabh-narkhede this commit looks good. Is this ready for review? At first glance it looks like you updated all of the applicable JSON tests.

@pm-saurabh-narkhede
Copy link
Contributor Author

Hello @bsardo , Can you please specifically check this commit 90a190a where I have added impIDs for json test files where imp.id not present/given.

Hi @pm-saurabh-narkhede this commit looks good. Is this ready for review? At first glance it looks like you updated all of the applicable JSON tests.

Hi @bsardo ,
It is ready to review. All applicable changes are done from my side.

@bsardo
Copy link
Contributor

bsardo commented Feb 14, 2024

@pm-saurabh-narkhede no rush, I just want to make sure you saw my couple of other comments requesting changes. Once those are made I will re-review.

@pm-saurabh-narkhede
Copy link
Contributor Author

@pm-saurabh-narkhede no rush, I just want to make sure you saw my couple of other comments requesting changes. Once those are made I will re-review.

@bsardo I have made the changes. You can review them.

bsardo
bsardo previously approved these changes Feb 15, 2024
@bretg
Copy link
Contributor

bretg commented Mar 25, 2024

blocks #2852

@hhhjort hhhjort assigned hhhjort and unassigned SyntaxNode Mar 26, 2024
@@ -73,7 +73,8 @@
"X-Forwarded-For": [
"0.0.0.0"
]
}
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is a shame that adgeneration does not have any multi-imp tests. But that is beyond the scope of this PR. We will have to try to be more picky about that in adapter reviews.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree with you @hhhjort .
Thanks for noticing it out.

openrtb_ext/imp.go Outdated Show resolved Hide resolved
@pm-saurabh-narkhede
Copy link
Contributor Author

Hi @SyntaxNode , @hhhjort , @bsardo ,
@bsardo approval got dismissed because of my new commit. I have merge latest master to my branch and added changes in new json files. Request you Provide inputs/comments/suggestions/approvals earliest as it blocks multiple issues and also new json files will be added. Thank you !

Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

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

LGTM

@SyntaxNode SyntaxNode merged commit 2cc2c90 into prebid:master Apr 10, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants