Repository navigation
Conversation
✅ Deploy Preview for prebid-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
|
||
| - Runs only at the Processed-Auction stage. | ||
| - Only delivers functions for including and excluding bidders. | ||
| - Does not necessarily reload config periodically like the Floors feature, making integration with a backend machine learning system more challenging. |
There was a problem hiding this comment.
Go can reload config periodically assuming the host is somehow taking the machine learning system data and using it to update the account with new rules and the account fetcher is configured to be periodically fetched. Is this an example of how you envision it integrating with a backend machine learning system?
There was a problem hiding this comment.
The Floors feature takes a URL and polls it periodically for updates. i.e. there's no work for the Host Company to update data.
How about to make this clear we say something like "Unlike the Floors feature, the rules module does not fetch data on an external URL. To update the rules, the Host Company needs to merge updated data into the account system."
There was a problem hiding this comment.
AI assistant reply, posted on behalf of Patrick McCann (not written personally by Patrick):
The updated docs clarify this: unlike Floors, the Rules Engine does not poll a separate rules URL. A host can update the account config, with the account fetcher periodically refreshing it. PBS-Go hashes the received config and rebuilds its tree when changed. This is the host-mediated ML feedback loop, not a direct optimizer integration.
| "hooks": { | ||
| "modules": { |
There was a problem hiding this comment.
I thought the hooks.enabled flag needs to be set:
"hooks": {
"enabled": true
There was a problem hiding this comment.
@And1sS - is this the same for PBS-Java?
There was a problem hiding this comment.
AI assistant reply, posted on behalf of Patrick McCann (not written personally by Patrick):
Agreed. The updated PBS-Go examples explicitly set hooks.enabled: true; the Go hooks configuration exposes enabled at the hooks level.
| { | ||
| "hooks": { | ||
| "modules": { | ||
| "pb-rules-engine": { |
There was a problem hiding this comment.
This should be modules.vendor.module:
"modules": {
"prebid": {
"rules-engine": {
There was a problem hiding this comment.
AI assistant reply, posted on behalf of Patrick McCann (not written personally by Patrick):
Agreed for PBS-Go: the module lives under hooks.modules.prebid.rulesengine (vendor prebid, module rulesengine). Java differs: its module code is pb-rule-engine. The docs now distinguish them.
| "modules": { | ||
| "pb-rules-engine": { | ||
| "enabled": true, | ||
| "timestamp": "20250314 00:00:00", |
There was a problem hiding this comment.
This is not currently implemented in Go but I think we should leave it in the docs and we will support it. Right now Go is hashing the fetched config and comparing it against a cached hash to determine if there is a change but we will add timestamp support.
There was a problem hiding this comment.
AI assistant reply, posted on behalf of Patrick McCann (not written personally by Patrick):
Go's current configuration struct has a top-level timestamp, but the cache currently compares a hash of account config rather than using this timestamp as the recompile trigger. The docs now say so; timestamp-based invalidation should not be promised until implemented.
| "results": [{ | ||
| "function": "excludeBidders", | ||
| "args": [{ | ||
| "bidders": [], |
There was a problem hiding this comment.
As mentioned earlier, Go is considering it an error when bidders is empty. Couldn't you just omit this set of conditions in which case the default would be executed? I guess perhaps this has value in case you want to specify defaults but then not apply those defaults in certain instances like this. What do you think?
There was a problem hiding this comment.
Right - the default might be to remove bidderA, and one of the leaves says not to remove anything.
There was a problem hiding this comment.
AI assistant reply, posted on behalf of Patrick McCann (not written personally by Patrick):
Agree an empty bidders list is not valid for Go. The leaf was meant to represent 'do nothing, rather than execute the default'. A valid alternative would be a logATag result for that leaf or a different explicit default, not excludeBidders with bidders: []. This is an example behavior issue, not just a lint issue.
| } | ||
| ``` | ||
|
|
||
| And here's how these scenarios would play out in various runtime conditions: |
There was a problem hiding this comment.
"And here's how these scenarios would play out in various runtime conditions given the following request:"
Then we need to add the request here with the two imps as that is missing.
There was a problem hiding this comment.
The test request in the PRD is quite large. How about we make a copy of a test JSON file available, link to it, and then note that it's just a template for these test requests?
There was a problem hiding this comment.
AI assistant reply, posted on behalf of Patrick McCann (not written personally by Patrick):
Agreed—the original sample lacks a concrete two-imp request, so exact per-imp removal statements are not independently reproducible. A minimal checked-in request JSON showing the two impressions and their bidder arrays would make those examples testable. I haven't added such a fixture yet.
| We recommend placing the execution plan at the host level so all accounts have the module enabled. | ||
|
|
||
| ```json5 | ||
| "execution-plan": { |
There was a problem hiding this comment.
Is this called host-execution-plan in Java? It is host_execution_plan in Go.
There was a problem hiding this comment.
AI assistant reply, posted on behalf of Patrick McCann (not written personally by Patrick):
Yes—this is implementation-specific. PBS-Go uses hooks.host_execution_plan (snake_case), as defined in config/hooks.go. PBS-Java uses hooks.host-execution-plan (kebab-case), as documented in its docs/config-app.md and sample module configurations. The revised installation section intentionally shows a Go example and warns that Java has different configuration names.
| "groups": [{ | ||
| "timeout": 10, | ||
| "hook-sequence": [{ | ||
| "module-code": "rules-engine", |
There was a problem hiding this comment.
Isn't this supposed to be of the format vendor.module_name in which case "prebid.rules-engine"?
There was a problem hiding this comment.
AI assistant reply, posted on behalf of Patrick McCann (not written personally by Patrick):
For PBS-Go the module code is prebid.rulesengine (without a hyphen): the module registry exposes rulesengine under vendor prebid, and its hook execution plan uses the {vendor}.{module} form. PBS-Java is different: its PbRuleEngineModule.CODE is pb-rule-engine, and the hook implementation code is pb-rule-engine-processed-auction-request-hook. The revised Go installation example uses prebid.rulesengine.
✅ Deploy Preview for prebid-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🏷 Type of documentation
Documentation for the PBS Rules Engine module. See prebid/prebid-server#2541