Skip to content

Return every Meta ad field and stabilize live CI - #5

Merged
promisingcoder merged 9 commits into
mainfrom
claude/full-meta-fields-and-ci
Oct 22, 2026
Merged

promisingcoder merged 9 commits into
mainfrom
claude/full-meta-fields-and-ci

Conversation

@promisingcoder

@promisingcoder promisingcoder commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • All Meta fields: adds get_ad_insights() (sync + async), the Ad Library "See ad details" GraphQL query (AdLibraryV3AdDetailsQuery). get_ad_details() / enrich_ad() / --enrich now attach its payload as ad_details: EU/UK/BR transparency (age, gender, location audience, total reach, per-country age/gender reach breakdown), US political demographic and regional insights, payer/beneficiary data, advertiser page info (verification, category, Instagram handle, about, cover photo), page spend by disclaimer, verified-voice context and violation types.
  • Normalizes every field the search rows return today (page categories, impression bucket text/index, extra creative variants, watermarked media, page like count and deletion flag) via new Ad, AdCreative and PageInfo fields; api_fields stays lossless.
  • One shared CSV schema (meta_ads_collector.exports) for the CLI and both collectors, with the most useful new scalar columns.
  • CI: the live preflight and surface checks get a bounded retry budget; the local test gateways retry one stalled upstream attempt inside a single client request; every actual Meta pytest invocation runs with pytest-rerunfailures (--reruns 2, 15 s apart) restricted by --only-rerun to transport-class errors (curl timeouts, upstream CONNECT 590, resets, DNS, rate limits), so data and behaviour assertions still fail on the first attempt. GitHub Actions move to their Node 24 majors. Builds on the per-family proxy session isolation from codex/ci-socks-diagnostics.
  • Version 1.7.0, changelog, API reference and README updates.

Verification

  • Unit suite: 959 passed locally on 3.12 and on a local 3.9 environment (ruff, mypy clean); MCP suite 126 passed; isolated wheel suite passed.
  • Full live suite directly against Meta (no proxy): 102 passed, 1 skipped, including the new get_ad_insights sync/async live checks and enrichment of a sparse ad.
  • CI on the last two commits: all 21 jobs green, including live-proxy, live-connectivity, live-meta (102 passed through the private proxy; the head run needed one rerun of a media download case) and mcp-live. Earlier runs on the branch failed on three different proxy-leg transients (a stalled search, bootstrap connect timeouts, CDN CONNECT 590), which is what the gateway retry and the rerun allowlist address.

🤖 Generated with Claude Code

promisingcoder and others added 9 commits October 6, 2026 15:17
… richer models

Add MetaAdsClient.get_ad_insights() and the async twin, running the Ad
Library "See ad details" GraphQL document (AdLibraryV3AdDetailsQuery).
get_ad_details() and enrich_ad() attach that payload as ad_details, so
enriched ads carry EU/UK/BR transparency (audience, total reach,
per-country age/gender breakdown), US political demographic and regional
insights, payer/beneficiary data, advertiser page info and page spend.

Normalize every field the search rows currently return (page categories,
impression bucket text and index, extra creative variants, watermarked
media, page like count and deletion flag) and expose the detail payload
through new Ad, AdCreative and PageInfo fields while keeping api_fields
lossless.

Share one CSV schema (meta_ads_collector.exports) across the CLI and both
collectors, adding the most useful new scalar columns.

Fixture, unit, enrichment, client and live tests cover the new query.
Version 1.7.0 with changelog and API reference updates.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… majors

The bounded live connectivity check failed on a single 20 s bootstrap
timeout through the residential CI proxy. Allow three attempts with a
30 s timeout; the job stays blocking and bounded by its 5 minute limit.

Pin actions/checkout, setup-python, upload-artifact and download-artifact
to their current majors so runs stop forcing deprecated Node 20 actions
onto Node 24.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Calling asyncio.run from sync tests leaves no current event loop, and on
Python 3.9 curl_cffi's AsyncSession needs one at construction time, so
later constructor tests failed in CI.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
One 20 s request stall through the residential CI proxy failed the
country parameter case while the other 101 live tests passed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The residential CI proxy occasionally stalls for more than the client's
whole retry budget while opening its leg to Meta, failing a random live
proxy case per run. The local gateways now give each upstream attempt
14 s and retry once, keeping both attempts inside one 30 s client
request. Direct tunnels are unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Three consecutive live-meta runs each failed on a different transient on the
residential proxy path: one stalled GraphQL search, one async bootstrap
connect timeout, and CDN CONNECT tunnels answered with 590 during media
downloads. Run every actual Meta pytest invocation with pytest-rerunfailures
(--reruns 2, 15 s apart) restricted by --only-rerun to transport-class errors,
so data and behaviour assertions still fail on the first attempt. A contract
test keeps the core and MCP allowlists identical and checks representative
messages.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Meta serves the same signed media path from any *.fbcdn.net host (verified
live: identical bytes from five edges). The residential CI exit repeatedly
failed to reach one regional edge for a whole run, exhausting the download
retries even across reruns. Odd-numbered attempts now use
scontent.xx.fbcdn.net or video.xx.fbcdn.net within the existing retry
budget; non-Meta URLs and expired (403) URLs behave as before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@promisingcoder
promisingcoder merged commit 2b5e65f into main Oct 22, 2026
40 checks passed
@promisingcoder
promisingcoder deleted the claude/full-meta-fields-and-ci branch October 22, 2026 10:03
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.

1 participant