Download page and docs: ship the skinny analytics events JSON Schema with builds that include genericAnalyticsSkinnyEvents

Đang mở
#6,967 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 4 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, json
Lĩnh vực
devtools, documentation

Hướng nghiên cứu

Start with assets/js/download.js and assets/js/prebidBundler.js to see how the download page saves disclosure files, then check how selected modules and versioned jsDelivr assets are handled. Read dev-docs/modules/genericAnalyticsSkinnyEvents.md and genericAnalyticsAdapter.md for the documentation changes. Done when selected builds include the matching schema when available, and both module pages explain the contract and link to its validation guidance.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

🤖 This issue was written by an AI agent (Claude Code) on behalf of @patmmccann.

Problem

The skinny preset of the Generic Analytics Adapter, provided by the genericAnalyticsSkinnyEvents module, comes with a public payload contract. prebid/Prebid.js#15953 publishes it as a JSON Schema generated from the TypeScript wire types, at dist/schema/genericAnalyticsSkinnyEvents.schema.json in the npm package. The schema's $id is its jsDelivr URL in the release that introduced it, and it changes only when the contract changes. Collectors validate events against it, and pin the $id to notice when the contract changes.

Publishers who use the download page don't get it. With the module selected, the page saves prebid<version>.js, prebid-config.json and <bundle>_disclosures.json, but nothing that tells the team running the collector what the payloads look like or which contract version that build sends. They would have to know to look in the npm package or on jsDelivr, and to pick the schema that matches their version.

Proposal

  1. Download page: when genericAnalyticsSkinnyEvents is among the selected modules, also save the event schema for the chosen version, the same way _disclosures.json is saved today (assets/js/download.js, using assets/js/prebidBundler.js).
    • Fetch https://cdn.jsdelivr.net/npm/prebid.js@<version>/dist/schema/genericAnalyticsSkinnyEvents.schema.json. Releases before the schema was published return 404; skip the file quietly for those.
    • Save the file as fetched, so its $id is unchanged. Its $id names the release that introduced this contract, which can be older than the version downloaded; that is intended.
    • The schema $refs the OpenRTB request and imp schemas. Either save those too (resolve each $ref against the event schema's $id, since reused schemas keep their original $id), or link to them, and say they can be stubbed out as described in the module docs.
    • Ideally, generalize this to any schema a selected module publishes under dist/schema/, not just this one module.
  2. Module page (dev-docs/modules/genericAnalyticsSkinnyEvents.md): add a "Payload contract" section. It should cover:
    • where the schema is: in the npm package, on jsDelivr, and in download-page builds;
    • that the $id is the contract version and changes only when the contract does;
    • that every event sets additionalProperties: false, so an added field is a contract change;
    • how to validate with Ajv, including allowUnionTypes and stubbing the OpenRTB schemas.
  3. Generic Analytics Adapter page (dev-docs/modules/genericAnalyticsAdapter.md): link to that section from the skinny preset description.

Depends on

prebid/Prebid.js#15953 (not merged yet). The download-page part can land any time, because it skips versions without the schema, but nothing will be downloaded until a release includes #15953.

Ngôn ngữ chính
HTML
Star
85
Fork
1.4k
Merge trung bình
6 ngày 14 giờ
Pull request đã merge (30 ngày)
95

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của prebid/prebid.github.io

Tất cả issue của prebid/prebid.github.io

Issue tương tự

Thêm issue về DevTools

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.