-
Notifications
You must be signed in to change notification settings - Fork 181
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
Introduce a framework for hooks at different stages of request processing #1345
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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>
* 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
* 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
…d, another could be overridden by account configuration (#1282)
# Conflicts: # pom.xml # src/main/java/org/prebid/server/auction/BidResponseCreator.java # src/main/java/org/prebid/server/auction/ExchangeService.java # src/main/java/org/prebid/server/auction/model/AuctionContext.java # src/main/java/org/prebid/server/auction/requestfactory/AmpRequestFactory.java # src/main/java/org/prebid/server/auction/requestfactory/AuctionRequestFactory.java # src/main/java/org/prebid/server/auction/requestfactory/Ortb2ImplicitParametersResolver.java # src/main/java/org/prebid/server/auction/requestfactory/Ortb2RequestFactory.java # src/main/java/org/prebid/server/auction/requestfactory/VideoRequestFactory.java # src/main/java/org/prebid/server/bidder/UsersyncInfoAssembler.java # src/main/java/org/prebid/server/bidder/model/BidderSeatBid.java # src/main/java/org/prebid/server/handler/CookieSyncHandler.java # src/main/java/org/prebid/server/handler/SetuidHandler.java # src/main/java/org/prebid/server/handler/openrtb2/AmpHandler.java # src/main/java/org/prebid/server/handler/openrtb2/AuctionHandler.java # src/main/java/org/prebid/server/handler/openrtb2/VideoHandler.java # src/main/java/org/prebid/server/spring/config/ServiceConfiguration.java # src/test/java/org/prebid/server/auction/BidResponseCreatorTest.java # src/test/java/org/prebid/server/auction/requestfactory/AmpRequestFactoryTest.java # src/test/java/org/prebid/server/auction/requestfactory/AuctionRequestFactoryTest.java # src/test/java/org/prebid/server/auction/requestfactory/Ortb2ImplicitParametersResolverTest.java # src/test/java/org/prebid/server/auction/requestfactory/Ortb2RequestFactoryTest.java # src/test/java/org/prebid/server/auction/requestfactory/VideoRequestFactoryTest.java # src/test/java/org/prebid/server/cache/CacheServiceTest.java # src/test/java/org/prebid/server/handler/CookieSyncHandlerTest.java # src/test/java/org/prebid/server/handler/SetuidHandlerTest.java # src/test/java/org/prebid/server/handler/openrtb2/AmpHandlerTest.java # src/test/java/org/prebid/server/handler/openrtb2/AuctionHandlerTest.java # src/test/java/org/prebid/server/handler/openrtb2/VideoHandlerTest.java # src/test/java/org/prebid/server/it/ApplicationTest.java # src/test/resources/org/prebid/server/it/openrtb2/datablocks/test-auction-datablocks-response.json # src/test/resources/org/prebid/server/it/openrtb2/rubicon_appnexus/test-auction-rubicon-appnexus-response.json # src/test/resources/org/prebid/server/it/openrtb2/zeroclickfraud/test-auction-zeroclickfraud-response.json
… 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
Prebid Server copy for tag 1.67.0
…ooks (#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
rpanchyk
previously approved these changes
Jun 30, 2021
* Avoid tampering with impid in integration test for hooks * Tidy up BidResponseCreator after refactoring
rpanchyk
approved these changes
Jul 1, 2021
🎉 🎉 Does this mean the next release will contain the possibility to write modules and use them? |
@muuki88 Sure. you can already try it. Documentation is coming soon. |
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>
21 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.