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

UOE:10435 Migrate Wakanda to prebid #771

Closed
wants to merge 0 commits into from
Closed

Conversation

pm-priyanka-bagade
Copy link
Collaborator

No description provided.

@@ -142,6 +142,15 @@ func (m OpenWrap) handleEntrypointHook(
rCtx.PubID = pubid
}

// rCtx.WakandaDebug.EnableIfRequired(rCtx.PubIDStr, rCtx.ProfileIDStr)
// if rCtx.WakandaDebug.Enabled {
rCtx.WakandaDebug.DebugData.HTTPRequest = payload.Request
Copy link
Collaborator

Choose a reason for hiding this comment

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

getAccountIdFromRawRequest

@@ -81,4 +81,6 @@ func UpdateResponseExtOW(w http.ResponseWriter, bidResponse *openrtb2.BidRespons
w.WriteHeader(http.StatusNoContent)
}
}
rCtx.WakandaDebug.DebugData.HTTPResponse = w
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this required?. Response is already available in ao

Comment on lines 92 to 98
if rCtx.WakandaDebug.Enabled {
rCtx.WakandaDebug.DebugData.OpenRTB = payload.BidRequest
// defer rCtx.WakandaDebug.WriteLogToFiles() /// need to move
} else {
rCtx.WakandaDebug.DebugData.HTTPRequest = nil
rCtx.WakandaDebug.DebugData.HTTPRequestBody = nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is not needed.

@@ -88,6 +88,15 @@ func (m OpenWrap) handleBeforeValidationHook(
rCtx.DeviceCtx.Platform = getDevicePlatform(rCtx, payload.BidRequest)
populateDeviceContext(&rCtx.DeviceCtx, payload.BidRequest.Device)

rCtx.WakandaDebug.EnableIfRequired(rCtx.PubIDStr, rCtx.ProfileIDStr)
Copy link
Collaborator

Choose a reason for hiding this comment

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

move this to entrypoint hook

Comment on lines 103 to 117
hbMux := http.NewServeMux()
hbMux.HandleFunc("/wakanda", wakanda.Handler(cfg.Wakanda))
srvInterface := ":" + cfg.Server.Port
go startServer(srvInterface, hbMux)
wakanda.InitWakanda(time.Duration(cfg.Wakanda.MaxDuration), time.Duration(cfg.Wakanda.CleanupFrequency))
return *ow, nil
}

var startServer = func(srvInterface string, hbMux *http.ServeMux) error {
if err := http.ListenAndServe(srvInterface, hbMux); err != nil {
logger.Fatal("main.main:unable to start http server: %s", err.Error())
return err
}
return nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

move this code to separate file server.go

Comment on lines 11 to 24
HTTPRequest *http.Request
HTTPRequestBody json.RawMessage
HTTPResponse http.ResponseWriter
HTTPResponseBody string
OpenRTB any
PrebidHTTPRequest *http.Request
PrebidRequestBody json.RawMessage
PrebidHTTPResponse *httptest.ResponseRecorder
Logger json.RawMessage
WinningBid bool
// PartnerMapping
// AdUnitConfig
// Logger
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

HTTPRequest will be mapped to request cached in rctx.
HTTPRequestBody will be mapped to request body cached in rctx.
HTTPResponse will be mapped to ao.Response
OpenRTB will be mapped to ao.RequestWrapper
Logger will be mapped to ao.Logger

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.

2 participants