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

First cut of established hook interfaces #1195

Merged
merged 2 commits into from
Mar 22, 2021
Merged

Conversation

schernysh
Copy link
Contributor

No description provided.

@schernysh schernysh requested a review from rpanchyk March 22, 2021 09:59
@rpanchyk rpanchyk requested a review from DGarbar March 22, 2021 10:01
@rpanchyk rpanchyk removed the request for review from DGarbar March 22, 2021 10:29
@rpanchyk rpanchyk merged commit 0e45013 into hooks-framework Mar 22, 2021
@rpanchyk rpanchyk deleted the hooks-interfaces branch March 22, 2021 10:35
@muuki88
Copy link
Contributor

muuki88 commented Mar 22, 2021

What's the usage for this? I'm currently looking for something that let's us

  • add bid floors dynamically within prebid server for all adapters
  • add static targetings for AMP auctions ( hb_source: "s2s" in our case )

Is this something that hook infrastructure is capable of?

@schernysh
Copy link
Contributor Author

Hey @muuki88,

This PR is the beginning of the journey to modularity: prebid/prebid-server#1734. It's on an early stage so far so feel free to join this effort - you may want to start with reviewing PRD, feel free to ask questions and suggest also.

Addressing your questions - modularity is envisioned as a response to the needs similar to those you mentioned.


public interface AuctionRequestPayload {

BidRequest bidRequest();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the BidRequest mutable and can be modified the hook?

@muuki88
Copy link
Contributor

muuki88 commented Mar 22, 2021

Thanks a lot for the pointers. I'll take a look at the documents and see where I can give valuable feedback.

Regarding this PR. As an external contributor I would love to see more documentation on the interfaces and how they are supposed to work, what I need to do as an implementor and where I can take a look at the whole picture (e.g. the google doc).

@bretg
Copy link
Collaborator

bretg commented Mar 30, 2021

@muuki88 - thought I'd answered this, but maybe not

add static targetings for AMP auctions ( hb_source: "s2s" in our case )

static AMP targets are supported -- https://docs.prebid.org/prebid-server/endpoints/openrtb2/pbs-endpoint-auction.html#custom-targeting-pbs-java-only

schernysh added a commit that referenced this pull request Jul 1, 2021
…sing (#1345)

* First cut of established hook interfaces (#1195)

* Insert Entrypoint hook invocation logic (#1203)

* Insert bidder request hooks invocation logic (#1206)

* Insert auction response hooks invocation logic (#1208)

* Add Module interface and HookCatalog utility (#1199)

* Add hooks execution plan to application and account configuration (#1211)

* Insert raw auction request hooks invocation logic  (#1210)

* Merge master into hook framework (#1228)

* Prebid Server prepare release 1.61.0

* Prebid Server prepare for next development iteration

* Make generation of Bid Adm as a first step to remove duplicating call (#1214)

* Support boolean for bidrequest.ext.prebid.debug together with integer for backward compatibility (#1160)

* Update setuid format parameter and make pixel depends on cookie type (#997)

* Refactored: Extracted Ortb2RequestFactory (#1224)

* Implement usersync method choosing according to filter settings from request (#1130)

Co-authored-by: rpanchyk <rpanchyk@rubiconproject.com>
Co-authored-by: Braslavskyi Andrii <abraslavskyi@rubiconproject.com>
Co-authored-by: Sergii Chernysh <schernysh@users.noreply.github.com>

* Insert processed bidder response hooks invocation logic (#1234)

* Inject RawBidderResponseStage (#1239)

* Flesh out machinery for running hooks following execution plan (#1227)

* Flesh out machinery for running entrypoint hooks

* Unit tests for hooks execution machinery

* Move HookCatalog up in package hierarchy

* Make checkstyle happy

* Split hook execution functionality into smaller and manageable pieces

* Extend hook execution onto raw auction request stage

* Move HookCatalog close to other classes responsible for hooks execution

* Put hooks-related interface implementations to more granular package structure

* Implement bidder request hooks execution

* Implement auction response hooks execution

* Simplify stage executor bootstrapping

* Check that response phase hooks are not able to cause request rejection

* Implement (raw and processed) bidder response hooks execution

* Introduce module context - a way for hook implementations within single module to pass arbitrary data between each other

* Put module context management in one place

* Replace duplication with delegation in invocation contexts implementations

* Processed auction request stage (#1241)

* Basic integration tests for hooks framework (#1250)

* Sample module for integration testing

* Integration test specifically for hooks invocation

* Add sample raw auction request hook to integration test

* Add sample processed auction request hook to integration test

* Add sample bidder request hook to integration test

* Add sample raw bidder response hook to integration test

* Add sample processed bidder response hook to integration test

* Add sample auction response hook to integration test

* Simplify integration test for hooks framework by using a separate account

* Add tests for rejection scenarios at different stages

* Handle whole request rejection scenarios (#1268)

* Drop synchronous groups support (#1278)

* Split host-level execution plan into two parts: one is always executed, another could be overridden by account configuration (#1282)

* Populate auction response with hooks debug and trace output (#1292)

* Implement hooks metrics submission (#1305)

* Expose analytics tags from hooks to analytics adapters (#1311)

* Account for stages that may produce several outcomes (per-bidder) (#1321)

* Rename HttpRequestWrapper to HttpRequestContext and use own models in it and hooks interfaces (#1330)

* Rename HttpRequestWrapper to HttpRequestContext

* Use own model for passing query parameters and headers around

* Make CaseInsensitiveMultiMap immutable

* Add tests for CaseInsensitiveMultiMap

* Get rid of cookies map on HttpRequestContext

* Properly handle and log the errors happened during interaction with hooks (#1340)

* Validate host and default account execution plan

* Tests for unknown hooks validation at startup

* Re-design HookCatalog to make it more generic

* Log and write into hooks trace the errors happened when applying hooks invocation results

* Install and deploy original PBS JAR instead of repackaged Spring Boot fat JAR

* Avoid tampering with impid in integration test for hooks (#1349)

* Avoid tampering with impid in integration test for hooks

* Tidy up BidResponseCreator after refactoring

Co-authored-by: rpanchyk <rpanchyk@rubiconproject.com>
Co-authored-by: rpanchyk <rpanchyk@users.noreply.github.com>
Co-authored-by: Dmitriy <DimaGarbar49@gmail.com>
Co-authored-by: Braslavskyi Andrii <abraslavskyi@rubiconproject.com>
nickluck9 pushed a commit that referenced this pull request Aug 9, 2021
…sing (#1345)

* First cut of established hook interfaces (#1195)

* Insert Entrypoint hook invocation logic (#1203)

* Insert bidder request hooks invocation logic (#1206)

* Insert auction response hooks invocation logic (#1208)

* Add Module interface and HookCatalog utility (#1199)

* Add hooks execution plan to application and account configuration (#1211)

* Insert raw auction request hooks invocation logic  (#1210)

* Merge master into hook framework (#1228)

* Prebid Server prepare release 1.61.0

* Prebid Server prepare for next development iteration

* Make generation of Bid Adm as a first step to remove duplicating call (#1214)

* Support boolean for bidrequest.ext.prebid.debug together with integer for backward compatibility (#1160)

* Update setuid format parameter and make pixel depends on cookie type (#997)

* Refactored: Extracted Ortb2RequestFactory (#1224)

* Implement usersync method choosing according to filter settings from request (#1130)

Co-authored-by: rpanchyk <rpanchyk@rubiconproject.com>
Co-authored-by: Braslavskyi Andrii <abraslavskyi@rubiconproject.com>
Co-authored-by: Sergii Chernysh <schernysh@users.noreply.github.com>

* Insert processed bidder response hooks invocation logic (#1234)

* Inject RawBidderResponseStage (#1239)

* Flesh out machinery for running hooks following execution plan (#1227)

* Flesh out machinery for running entrypoint hooks

* Unit tests for hooks execution machinery

* Move HookCatalog up in package hierarchy

* Make checkstyle happy

* Split hook execution functionality into smaller and manageable pieces

* Extend hook execution onto raw auction request stage

* Move HookCatalog close to other classes responsible for hooks execution

* Put hooks-related interface implementations to more granular package structure

* Implement bidder request hooks execution

* Implement auction response hooks execution

* Simplify stage executor bootstrapping

* Check that response phase hooks are not able to cause request rejection

* Implement (raw and processed) bidder response hooks execution

* Introduce module context - a way for hook implementations within single module to pass arbitrary data between each other

* Put module context management in one place

* Replace duplication with delegation in invocation contexts implementations

* Processed auction request stage (#1241)

* Basic integration tests for hooks framework (#1250)

* Sample module for integration testing

* Integration test specifically for hooks invocation

* Add sample raw auction request hook to integration test

* Add sample processed auction request hook to integration test

* Add sample bidder request hook to integration test

* Add sample raw bidder response hook to integration test

* Add sample processed bidder response hook to integration test

* Add sample auction response hook to integration test

* Simplify integration test for hooks framework by using a separate account

* Add tests for rejection scenarios at different stages

* Handle whole request rejection scenarios (#1268)

* Drop synchronous groups support (#1278)

* Split host-level execution plan into two parts: one is always executed, another could be overridden by account configuration (#1282)

* Populate auction response with hooks debug and trace output (#1292)

* Implement hooks metrics submission (#1305)

* Expose analytics tags from hooks to analytics adapters (#1311)

* Account for stages that may produce several outcomes (per-bidder) (#1321)

* Rename HttpRequestWrapper to HttpRequestContext and use own models in it and hooks interfaces (#1330)

* Rename HttpRequestWrapper to HttpRequestContext

* Use own model for passing query parameters and headers around

* Make CaseInsensitiveMultiMap immutable

* Add tests for CaseInsensitiveMultiMap

* Get rid of cookies map on HttpRequestContext

* Properly handle and log the errors happened during interaction with hooks (#1340)

* Validate host and default account execution plan

* Tests for unknown hooks validation at startup

* Re-design HookCatalog to make it more generic

* Log and write into hooks trace the errors happened when applying hooks invocation results

* Install and deploy original PBS JAR instead of repackaged Spring Boot fat JAR

* Avoid tampering with impid in integration test for hooks (#1349)

* Avoid tampering with impid in integration test for hooks

* Tidy up BidResponseCreator after refactoring

Co-authored-by: rpanchyk <rpanchyk@rubiconproject.com>
Co-authored-by: rpanchyk <rpanchyk@users.noreply.github.com>
Co-authored-by: Dmitriy <DimaGarbar49@gmail.com>
Co-authored-by: Braslavskyi Andrii <abraslavskyi@rubiconproject.com>
nickluck9 pushed a commit that referenced this pull request Aug 10, 2021
…sing (#1345)

* First cut of established hook interfaces (#1195)

* Insert Entrypoint hook invocation logic (#1203)

* Insert bidder request hooks invocation logic (#1206)

* Insert auction response hooks invocation logic (#1208)

* Add Module interface and HookCatalog utility (#1199)

* Add hooks execution plan to application and account configuration (#1211)

* Insert raw auction request hooks invocation logic  (#1210)

* Merge master into hook framework (#1228)

* Prebid Server prepare release 1.61.0

* Prebid Server prepare for next development iteration

* Make generation of Bid Adm as a first step to remove duplicating call (#1214)

* Support boolean for bidrequest.ext.prebid.debug together with integer for backward compatibility (#1160)

* Update setuid format parameter and make pixel depends on cookie type (#997)

* Refactored: Extracted Ortb2RequestFactory (#1224)

* Implement usersync method choosing according to filter settings from request (#1130)

Co-authored-by: rpanchyk <rpanchyk@rubiconproject.com>
Co-authored-by: Braslavskyi Andrii <abraslavskyi@rubiconproject.com>
Co-authored-by: Sergii Chernysh <schernysh@users.noreply.github.com>

* Insert processed bidder response hooks invocation logic (#1234)

* Inject RawBidderResponseStage (#1239)

* Flesh out machinery for running hooks following execution plan (#1227)

* Flesh out machinery for running entrypoint hooks

* Unit tests for hooks execution machinery

* Move HookCatalog up in package hierarchy

* Make checkstyle happy

* Split hook execution functionality into smaller and manageable pieces

* Extend hook execution onto raw auction request stage

* Move HookCatalog close to other classes responsible for hooks execution

* Put hooks-related interface implementations to more granular package structure

* Implement bidder request hooks execution

* Implement auction response hooks execution

* Simplify stage executor bootstrapping

* Check that response phase hooks are not able to cause request rejection

* Implement (raw and processed) bidder response hooks execution

* Introduce module context - a way for hook implementations within single module to pass arbitrary data between each other

* Put module context management in one place

* Replace duplication with delegation in invocation contexts implementations

* Processed auction request stage (#1241)

* Basic integration tests for hooks framework (#1250)

* Sample module for integration testing

* Integration test specifically for hooks invocation

* Add sample raw auction request hook to integration test

* Add sample processed auction request hook to integration test

* Add sample bidder request hook to integration test

* Add sample raw bidder response hook to integration test

* Add sample processed bidder response hook to integration test

* Add sample auction response hook to integration test

* Simplify integration test for hooks framework by using a separate account

* Add tests for rejection scenarios at different stages

* Handle whole request rejection scenarios (#1268)

* Drop synchronous groups support (#1278)

* Split host-level execution plan into two parts: one is always executed, another could be overridden by account configuration (#1282)

* Populate auction response with hooks debug and trace output (#1292)

* Implement hooks metrics submission (#1305)

* Expose analytics tags from hooks to analytics adapters (#1311)

* Account for stages that may produce several outcomes (per-bidder) (#1321)

* Rename HttpRequestWrapper to HttpRequestContext and use own models in it and hooks interfaces (#1330)

* Rename HttpRequestWrapper to HttpRequestContext

* Use own model for passing query parameters and headers around

* Make CaseInsensitiveMultiMap immutable

* Add tests for CaseInsensitiveMultiMap

* Get rid of cookies map on HttpRequestContext

* Properly handle and log the errors happened during interaction with hooks (#1340)

* Validate host and default account execution plan

* Tests for unknown hooks validation at startup

* Re-design HookCatalog to make it more generic

* Log and write into hooks trace the errors happened when applying hooks invocation results

* Install and deploy original PBS JAR instead of repackaged Spring Boot fat JAR

* Avoid tampering with impid in integration test for hooks (#1349)

* Avoid tampering with impid in integration test for hooks

* Tidy up BidResponseCreator after refactoring

Co-authored-by: rpanchyk <rpanchyk@rubiconproject.com>
Co-authored-by: rpanchyk <rpanchyk@users.noreply.github.com>
Co-authored-by: Dmitriy <DimaGarbar49@gmail.com>
Co-authored-by: Braslavskyi Andrii <abraslavskyi@rubiconproject.com>
nickluck9 pushed a commit that referenced this pull request Aug 10, 2021
…sing (#1345)

* First cut of established hook interfaces (#1195)

* Insert Entrypoint hook invocation logic (#1203)

* Insert bidder request hooks invocation logic (#1206)

* Insert auction response hooks invocation logic (#1208)

* Add Module interface and HookCatalog utility (#1199)

* Add hooks execution plan to application and account configuration (#1211)

* Insert raw auction request hooks invocation logic  (#1210)

* Merge master into hook framework (#1228)

* Prebid Server prepare release 1.61.0

* Prebid Server prepare for next development iteration

* Make generation of Bid Adm as a first step to remove duplicating call (#1214)

* Support boolean for bidrequest.ext.prebid.debug together with integer for backward compatibility (#1160)

* Update setuid format parameter and make pixel depends on cookie type (#997)

* Refactored: Extracted Ortb2RequestFactory (#1224)

* Implement usersync method choosing according to filter settings from request (#1130)

Co-authored-by: rpanchyk <rpanchyk@rubiconproject.com>
Co-authored-by: Braslavskyi Andrii <abraslavskyi@rubiconproject.com>
Co-authored-by: Sergii Chernysh <schernysh@users.noreply.github.com>

* Insert processed bidder response hooks invocation logic (#1234)

* Inject RawBidderResponseStage (#1239)

* Flesh out machinery for running hooks following execution plan (#1227)

* Flesh out machinery for running entrypoint hooks

* Unit tests for hooks execution machinery

* Move HookCatalog up in package hierarchy

* Make checkstyle happy

* Split hook execution functionality into smaller and manageable pieces

* Extend hook execution onto raw auction request stage

* Move HookCatalog close to other classes responsible for hooks execution

* Put hooks-related interface implementations to more granular package structure

* Implement bidder request hooks execution

* Implement auction response hooks execution

* Simplify stage executor bootstrapping

* Check that response phase hooks are not able to cause request rejection

* Implement (raw and processed) bidder response hooks execution

* Introduce module context - a way for hook implementations within single module to pass arbitrary data between each other

* Put module context management in one place

* Replace duplication with delegation in invocation contexts implementations

* Processed auction request stage (#1241)

* Basic integration tests for hooks framework (#1250)

* Sample module for integration testing

* Integration test specifically for hooks invocation

* Add sample raw auction request hook to integration test

* Add sample processed auction request hook to integration test

* Add sample bidder request hook to integration test

* Add sample raw bidder response hook to integration test

* Add sample processed bidder response hook to integration test

* Add sample auction response hook to integration test

* Simplify integration test for hooks framework by using a separate account

* Add tests for rejection scenarios at different stages

* Handle whole request rejection scenarios (#1268)

* Drop synchronous groups support (#1278)

* Split host-level execution plan into two parts: one is always executed, another could be overridden by account configuration (#1282)

* Populate auction response with hooks debug and trace output (#1292)

* Implement hooks metrics submission (#1305)

* Expose analytics tags from hooks to analytics adapters (#1311)

* Account for stages that may produce several outcomes (per-bidder) (#1321)

* Rename HttpRequestWrapper to HttpRequestContext and use own models in it and hooks interfaces (#1330)

* Rename HttpRequestWrapper to HttpRequestContext

* Use own model for passing query parameters and headers around

* Make CaseInsensitiveMultiMap immutable

* Add tests for CaseInsensitiveMultiMap

* Get rid of cookies map on HttpRequestContext

* Properly handle and log the errors happened during interaction with hooks (#1340)

* Validate host and default account execution plan

* Tests for unknown hooks validation at startup

* Re-design HookCatalog to make it more generic

* Log and write into hooks trace the errors happened when applying hooks invocation results

* Install and deploy original PBS JAR instead of repackaged Spring Boot fat JAR

* Avoid tampering with impid in integration test for hooks (#1349)

* Avoid tampering with impid in integration test for hooks

* Tidy up BidResponseCreator after refactoring

Co-authored-by: rpanchyk <rpanchyk@rubiconproject.com>
Co-authored-by: rpanchyk <rpanchyk@users.noreply.github.com>
Co-authored-by: Dmitriy <DimaGarbar49@gmail.com>
Co-authored-by: Braslavskyi Andrii <abraslavskyi@rubiconproject.com>
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