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

Refactoring of AuctionContext workflow #815

Merged
merged 16 commits into from
Nov 11, 2021

Conversation

DGarbar
Copy link
Contributor

@DGarbar DGarbar commented Jul 17, 2020

The main idea is to make AuctionContext to have information about each individual request. (AuctionParticipation)

This will allow simplify method signature and will make work with (bidderRequest, bidderResponse) less clumsy.

Also notice that blocked requests has more explicit workflow in the code. (Previously we just return null and silently filter them out). Now we can see each AuctionParticipation even if it was blocked.

Notice that code is making refactoring without any workflow changes (probably only in metrics so I left TODO to resolve with @rpanchyk ).
The next step is to resolve second TODO and make modularity actually see blocked AuctionParticipation and resolve them in the code.

!!! Concerns: Notice that we will work (more) with incomplete AuctionContext. I mean that we could pass AuctionContext that won't have bidResponse or some value yet because it was not populated. And the same think with AuctionParticipation.
(Also keep in mind that if we populating object outside of pipe (ampEventBuilder for example) and we have the Exception before population of this object, we would have incomplete object in the setHandler)

This is the main concerns regarding this change.

…analects

+ Refactored ExchangeService with tests.

We need to know information about TCF in high level classes.

P.S. Mb we can change AuctionContext into mutable object and change bidResponse place.
@DGarbar DGarbar requested a review from rpanchyk July 17, 2020 09:03
DGarbar added 4 commits July 17, 2020 12:11
# Conflicts:
#	src/main/java/org/prebid/server/auction/BidResponseCreator.java
#	src/main/java/org/prebid/server/auction/ExchangeService.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/ExchangeServiceTest.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
@rpanchyk rpanchyk requested a review from schernysh October 9, 2020 15:21
…ed-tcf-exchange-refactoring

# Conflicts:
#	src/main/java/org/prebid/server/auction/ExchangeService.java
#	src/test/java/org/prebid/server/auction/ExchangeServiceTest.java
@DGarbar DGarbar changed the title Add Passing necessary through full workflow for blocking request and analytics Refactoring of ActionContext workflow Oct 15, 2020
DGarbar added a commit that referenced this pull request Oct 20, 2020
It can be refactored after #815 will be merged
# Conflicts:
#	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/StoredResponseProcessor.java
#	src/main/java/org/prebid/server/auction/model/AuctionContext.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/test/java/org/prebid/server/auction/BidResponseCreatorTest.java
#	src/test/java/org/prebid/server/auction/ExchangeServiceTest.java
#	src/test/java/org/prebid/server/auction/StoredResponseProcessorTest.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
@Net-burst Net-burst requested review from Net-burst and And1sS and removed request for schernysh September 30, 2021 09:56
Serhii Nahornyi added 3 commits September 30, 2021 13:59
# Conflicts:
#	src/main/java/org/prebid/server/auction/ExchangeService.java
#	src/main/java/org/prebid/server/handler/openrtb2/AmpHandler.java
#	src/test/java/org/prebid/server/auction/ExchangeServiceTest.java
#	src/test/java/org/prebid/server/handler/openrtb2/AmpHandlerTest.java
# Conflicts:
#	src/main/java/org/prebid/server/auction/ExchangeService.java
#	src/test/java/org/prebid/server/auction/ExchangeServiceTest.java
# Conflicts:
#	src/main/java/org/prebid/server/auction/VideoResponseFactory.java
#	src/main/java/org/prebid/server/handler/openrtb2/VideoHandler.java
#	src/test/java/org/prebid/server/handler/openrtb2/VideoHandlerTest.java
rpanchyk
rpanchyk previously approved these changes Nov 9, 2021
@SerhiiNahornyi SerhiiNahornyi changed the title Refactoring of ActionContext workflow Refactoring of AuctionContext workflow Nov 10, 2021
# Conflicts:
#	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/test/java/org/prebid/server/handler/openrtb2/VideoHandlerTest.java
@SerhiiNahornyi SerhiiNahornyi merged commit de605e4 into master Nov 11, 2021
@SerhiiNahornyi SerhiiNahornyi deleted the analytics-blocked-tcf-exchange-refactoring branch November 11, 2021 10:35
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.

3 participants