Skip to content

Build a standalone validation tool for configuring creative opportunities #701

Description

@prk-Jr

Context

Current validation of creative-opportunities.toml is minimal:

  • Build-time only: slot ID charset check (^[A-Za-z0-9_-]+$) in build.rs
  • validate_slot_id() exists in creative_opportunities.rs but is not called at runtime
  • No CI check, no standalone tool, no auditor-facing feedback

This creates friction for ad ops and JS auditors (raised by Aram) who need to validate slot config changes without running a full Rust build.

Missing validations

  • Duplicate slot IDs
  • Pattern overlap / unreachable patterns (e.g. /* shadows /article/**)
  • Format size sanity (width > 0, height > 0)
  • floor_price >= 0
  • Bidder names against the [integrations.prebid].bidders list
  • APS slot_id presence when APS is enabled
  • PBS stored-request cross-check: does each slot ID have a corresponding entry in the configured PBS instance?

Proposed tool

A ts-validate CLI (or cargo xtask validate) that:

  1. Parses creative-opportunities.toml and runs all structural checks
  2. Optionally probes PBS for stored-request existence (requires PBS URL in config)
  3. Outputs a human-readable report suitable for ad ops review
  4. Exits non-zero on any error — runnable in CI without a full WASM build

Action

  • Define the full validation rule set
  • Implement as a standalone binary or xtask
  • Add to CI pipeline alongside cargo clippy and cargo test

Parent: #677

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions