-
Notifications
You must be signed in to change notification settings - Fork 269
Description
forDebuggingOnly
endpoints are very useful to debug client side Javascript code. It has been recently announced to keep them available in a heavily sampled mode which will be very useful for monitoring.
Due to the limited number of received events (around 5k per day) it still makes sense to be able to have a solution to be able to debug more data. A complementary solution could be to activate those endpoints in Debug mode in a local Chrome browser and randomly explore observed real interest group taggings and real auctions (without knowing the exact user journey as this is not possible anymore).
Integration tests
Here is a documented example on how integration tests could be executed with Chromedriver & Selenium: https://github.com/RTBHOUSE/chromium-fledge-tests
Those tests could be executed on:
- a locally spawned webserver (one needs to replicate production server side user data, currently difficult because only endpoints with (fake) HTTPS certificates work
- a real hosted staging/production endpoint (no need to replicate user data, HTTPS certificates would already work)
Sample workflow
Some sample workflow to achieve the random user journey could be to:
- Query server side logs of visited publisher pages (contextual call for perBuyerSignals) & advertiser pages (tagging call for interest group data)
- Create a Chrome driver session
- Replay some tagging endpoints for interest group creation
driver = webdriver.Chrome(..)
driver.get("https://adtech.com/create-ig-group")
-
Current restriction: IG owner will be the endpoint hosted on https://adtech.com, all endpoints like
biddingLogicURL
must be hosted on this domain -
Call a locally hosted test publisher page with real collected
perBuyerSignals
(as there is currently no constraint that the seller must also own the publisher domain)
const adUrn = await navigator.runAdAuction({
seller: 'https://publisher.com',
decisionLogicUrl: 'https://publisher.com/fledge_logic',
interestGroupBuyers: ["https://adtech.com"],
perBuyerSignals: my_collected_buyer_signals
});
- Collect the calls to
forDebuggingOnly.reportAdAuctionWin
&forDebuggingOnly.reportAdAuctionLoss
, in this workflow they will be sent to https://adtech.com. As it is end to end encrypted with HTTPS it is hard to intercept those calls even with some proxy
We would like to collect the calls to forDebuggingOnly.reportAdAuctionWin
& forDebuggingOnly.reportAdAuctionLoss
locally (console, file, ..) or at least on a webserver running on localhost
As of now we would need to patch the interest group in InterestGroup DB to expose a dedicated bidding script that calls the debug endpoint on https://localhost/ or some hosted server https://adtech1.com with a real certificate
- it doesn’t seem to make much sense to expose a dedicated bidding script on domain https://adtech.com that registers a debug endpoint with forDebuggingOnly.reportAdAuctionWin("https://localhost/...)
- it is difficult to create a local server with fake SSL certificates or setup reverse proxies (often platform dependent, works differently based on the stack Python, c#, ..)
- if we use a new domain for this https://adtech1.com we need to copy back the data to our testing environment
Chromium debug features that could potentially unlock or simplify this use case
- Be able register interest groups under http://localhost, see https://bugs.chromium.org/p/chromium/issues/detail?id=1208187
- Be able to patch only some endpoints of the interest group without owner domain restrictions, currently I can patch interest groups already by doing a SQL query to Chrome’s local DB but then if I update the
biddingLogicURL
on a domain like https://localhost/my_bidding_logic it will not work because domain must be the same as the IG owner domain (https://adtech.com) - Currently by design there is little feedback from the auction which makes automatic tests complicated, one could for example allow output to the Chrome console from inside the bidding script for easier debugging and to be able to create some output and assert that some conditions hold true