Skip to content

feat(data-warehouse): implement fireworks_ai import source - #70717

Merged
talyn-app[bot] merged 3 commits into
masterfrom
posthog-code/fireworks-ai-warehouse-source
Jul 15, 2026
Merged

feat(data-warehouse): implement fireworks_ai import source#70717
talyn-app[bot] merged 3 commits into
masterfrom
posthog-code/fireworks-ai-warehouse-source

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

Fireworks AI is a widely used inference and fine-tuning platform for open models, but its fireworks_ai warehouse source was only a scaffolded stub (unreleasedSource=True, no fields, no sync logic). Teams running training and inference on Fireworks can't join that platform data (training runs, dataset inventory, deployment fleet state) with their product data in PostHog.

Why: fill in the scaffolded Fireworks AI connector end-to-end so the source can sync real data, following the warehouse-source architecture contract.

Changes

Implements the source per the implementing-warehouse-sources skill, split into the standard three files:

  • settings.py – declarative endpoint catalog for 10 tables: models, datasets, deployments, deployed_models, supervised_fine_tuning_jobs, reinforcement_fine_tuning_jobs, batch_inference_jobs, evaluation_jobs, evaluators, users. Primary key is the AIP resource name (globally unique full path), partition key is the stable createTime (never updateTime).
  • fireworks_ai.py – transport over the control-plane REST API (https://api.fireworks.ai/v1/accounts/{account_id}/...), Bearer auth via make_tracked_session(), pageToken/nextPageToken pagination (pageSize 200), tenacity retries for 429/5xx, and sanitized HTTP errors (no query strings or response bodies in stored error state). Account ID input is normalized so a pasted accounts/my-account prefix doesn't break the path.
  • source.pyResumableSource wiring: page-token resume state saved after each yielded page, validate_credentials (invalid-account-id short-circuit, 200/401/403/404 mapping, 403 accepted at source-create per skill guidance), get_non_retryable_errors for 401/403/404, static get_schemas with lists_tables_without_credentials = True.

Supporting pieces:

  • canonical_descriptions.py for all 10 tables, sourced from the official API reference.
  • Icon at frontend/public/services/fireworks_ai.svg (official brand SVG from fireworks.ai).
  • FireworksAISourceConfig regenerated (api_key, account_id).
  • SOURCES.md: moved fireworks_ai from Scaffolded to Implemented (HTTP / requests / tracked ✅).
  • User-facing doc following the documenting-warehouse-sources template, kept at products/.../fireworks_ai/docs/fireworks-ai.mdx because no posthog.com checkout was available in this environment – it needs to move to posthog.com/contents/docs/cdp/sources/fireworks-ai.mdx (the docsUrl already points there).

Deliberate scope decisions:

Note

  • Full refresh only. The API documents an AIP-160 filter param but doesn't enumerate filterable fields, and server-side timestamp filtering couldn't be verified without live credentials, so no table advertises incremental sync (noted in code comments).
  • apiKeys excluded. The collection is nested per user and its schema carries key material – it must not land in a warehouse table.
  • Stays behind unreleasedSource=True with releaseStatus=ALPHA until it's validated against a live account.

No Django migration needed – the FireworksAI enum value and its migration already landed with the scaffold; makemigrations --check is clean.

How did you test this code?

  • pytest products/warehouse_sources/.../fireworks_ai/tests/ – 57 tests pass. test_fireworks_ai.py covers the regressions no existing test catches: paginator dropping or looping the page token, resume state saved before yield (data loss on crash), pasted accounts/ prefix doubling the URL path, sanitized errors leaking pagination tokens, and unstable partition keys. test_fireworks_ai_source.py covers credential status-code mapping (incl. account-not-found), non-retryable error matching, and pipeline plumbing.
  • pytest .../sources/tests/ (1551 cross-source guard tests incl. source categories) – pass.
  • hogli ci:preflight --fix – 0 failures.
  • Endpoint paths, envelopes (nextPageToken, camelCase collection keys), and auth behavior verified against the Fireworks API reference plus unauthenticated probes of the live API (all list endpoints return 401 without a valid key). I could not run a live sync – no Fireworks credentials were available in this environment.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

Doc added in-repo at products/warehouse_sources/backend/temporal/data_imports/sources/fireworks_ai/docs/fireworks-ai.mdx; needs to land in the posthog.com repo (see Changes).

🤖 Agent context

Autonomy: Fully autonomous

Authored with Claude Code (PostHog Code cloud task). Skills invoked: implementing-warehouse-sources, documenting-warehouse-sources, writing-tests. Modeled on the together_ai and anthropic sources (closest analogs: Bearer-auth AI platform APIs; anthropic for the resumable page-token pattern). Chose a hand-rolled tracked-session transport over rest_source.RESTClient because the AIP page-token flow is a dozen lines and keeps resume checkpointing explicit. Ran generate_source_configs and kept only the FireworksAI hunk – the generator also emitted unrelated env-dependent drift (Stripe config, formatting) that was reverted to keep the diff minimal.


Created with PostHog Code

@github-actions

Copy link
Copy Markdown
Contributor

Hey @Gilbert09! 👋

It looks like your git author email on this PR isn't your @posthog.com address (owerstom@gmail.com). Since you're on the PostHog team, it's worth pointing your local git author email at your @posthog.com address. Why it matters:

  • Consistent work identity in git history — internal tooling that attributes commits to team members keys off your @posthog.com address.
  • Keeps team contributions easy to tell apart from external community ones when scanning history.

You can fix it for this repo with:

git config user.email "you@posthog.com"

Or set it globally with git config --global user.email "you@posthog.com". No need to redo this PR — just a nudge for next time. 🙂

@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🦔 Hogbox preview · ✅ ready

▶ Open the preview

🔑 Login test@posthog.com / 12345678 (demo data)
🧩 Running this PR's backend and frontend, on the PostHog :master base
🔗 Link stable across rebuilds — a re-push swaps the box underneath, the URL stays
🔒 Access tailnet only (PostHog VPN)
🛠️ Admin inspect & debug state in hogland
💤 Idle sleeps after ~30 min idle (snapshot to S3, zero node cost) and wakes on your next visit in ~30s, behind a brief "waking up" screen

commit ba3fa5c · box box-68001e419e07 · ready in 1941s (push → usable) · build log · rebuilds on every push, torn down on close

@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team July 14, 2026 13:07
@github-actions

github-actions Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

Bundle size — no change

Uncompressed size of every built .js bundle, compared against the base branch.

Total: 64.77 MiB · no change

No file changed by more than 1000 B.

Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report

Eager graph — within budget

How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.

Root Eager (shipped) Δ vs base Budget
entry (logged-out pages, app bootstrap)
src/index.tsx
1.22 MiB · 22 files no change ███░░░░░░░ 28.4% of 4.29 MiB
authenticated shell (every logged-in page)
src/scenes/AuthenticatedShell.tsx
8.13 MiB · 2,978 files no change █████████░ 87.9% of 9.25 MiB

🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 [object Object] stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx
🟢 [object Object] stays out of src/scenes/AuthenticatedShell.tsx

Largest files eagerly shipped from src/index.tsx
Size File
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
24.6 KiB ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js
6.3 KiB ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js
4.5 KiB ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js
3.9 KiB ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js
1.4 KiB ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js
1.3 KiB src/RootErrorBoundary.tsx
912 B ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js
789 B src/scenes/ChunkLoadErrorBoundary.tsx
762 B src/index.tsx
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
Size File
281.3 KiB ../node_modules/.pnpm/posthog-js@1.402.2/node_modules/posthog-js/dist/rrweb.js
267.7 KiB ../node_modules/.pnpm/@posthog+icons@0.38.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
235.5 KiB src/taxonomy/core-filter-definitions-by-group.json
222.9 KiB ../node_modules/.pnpm/posthog-js@1.402.2/node_modules/posthog-js/dist/module.js
164.0 KiB src/queries/validators.js
154.3 KiB ../node_modules/.pnpm/re2js@0.4.1/node_modules/re2js/build/index.esm.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
105.8 KiB src/lib/api.ts
93.3 KiB ../node_modules/.pnpm/prosemirror-view@1.40.1/node_modules/prosemirror-view/dist/index.js
92.7 KiB ../packages/quill/packages/quill/dist/index.js

Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479

Dist folder size — 🔺 +805 B (+0.0%)

Total size of the built frontend/dist folder (all assets), compared against the base branch.

Total: 1312.45 MiB · 🔺 +805 B (+0.0%)

Playwright — all passed

All tests passed.

View test results →

@veria-ai

veria-ai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

PR overview

All previously flagged issues have been addressed. No open security concerns remain on this pull request.

Security review

No open security issues remain on this pull request.

Fixed/addressed: 1 · PR risk: 0/10

@trunk-io

trunk-io Bot commented Jul 14, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@danielcarletti danielcarletti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Implements the Fireworks AI warehouse source as a ResumableSource over the
Fireworks control-plane REST API (Google AIP-style, pageToken pagination),
syncing models, datasets, deployments, deployed models, fine-tuning jobs,
batch inference jobs, evaluation jobs, evaluators, and users. Full refresh
only; page-token resume state saved after each yielded page. Includes
canonical descriptions, icon, tests, SOURCES.md entry, and the user-facing
doc (pending move to posthog.com).

Generated-By: PostHog Code
Task-Id: b73336b1-98a5-4bac-9551-6acbf0b9f083
…t_id changes

Register account_id in connection_host_fields so the update serializer forces
re-entering the API key when the target Fireworks account changes, matching the
convention used by other account-scoped sources (e.g. callrail).

Generated-By: PostHog Code
Task-Id: b73336b1-98a5-4bac-9551-6acbf0b9f083
Remove unreleasedSource=True so the finished source is visible in the
connector catalog, and drop any test asserting the hidden state.
@Gilbert09
Gilbert09 force-pushed the posthog-code/fireworks-ai-warehouse-source branch from 110da41 to ba3fa5c Compare July 15, 2026 21:32
@talyn-app
talyn-app Bot merged commit fb97048 into master Jul 15, 2026
255 checks passed
@talyn-app
talyn-app Bot deleted the posthog-code/fireworks-ai-warehouse-source branch July 15, 2026 22:55
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 15, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-15 23:30 UTC Run
prod-us ✅ Deployed 2026-07-15 23:48 UTC Run
prod-eu ✅ Deployed 2026-07-15 23:48 UTC Run

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.

2 participants