-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: add first-party Tinybird analytics #2003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 4 commits
Commits
Show all changes
151 commits
Select commit
Hold shift + click to select a range
c87f74e
feat: add shared product analytics contract
richiemcilroy ca35887
feat: add first-party web analytics
richiemcilroy 2e481d6
feat: add first-party desktop analytics
richiemcilroy a2b4a01
feat: add Tinybird analytics infrastructure
richiemcilroy 9d7b695
fix: secure product analytics ingestion
richiemcilroy 557abd1
fix: harden analytics deployment tooling
richiemcilroy 5540c9e
fix: require trusted analytics origins
richiemcilroy ac73bd8
fix: mount Tinybird CLI config safely
richiemcilroy ce87b26
fix: require browser fetch metadata
richiemcilroy 6355ec7
fix: give Tinybird resources unique names
richiemcilroy e08bc0a
fix: sign anonymous analytics requests
richiemcilroy f8820d9
fix: make analytics TTL compatible
richiemcilroy 9fa6e12
fix: type analytics health parameters
richiemcilroy dc25da4
fix: align analytics health fixture
richiemcilroy 552b9e0
fix: contain anonymous analytics ingestion
richiemcilroy fee7c3a
fix: parse Tinybird workspace identity
richiemcilroy 8c94da0
Merge remote-tracking branch 'origin/main' into codex/first-party-ana…
richiemcilroy bd2039a
refactor: remove PostHog analytics
richiemcilroy bd28a25
fix: restore devtools effect import
richiemcilroy 5aefe3d
Merge main into first-party analytics
richiemcilroy d986b6c
fix(mobile): align React Native with Expo
richiemcilroy 28e2967
fix: parse Tinybird workspace table
richiemcilroy 5e0dc42
fix: support scoped Tinybird deploy tokens
richiemcilroy 1938917
fix: allow current Vercel preview analytics
richiemcilroy 84b6b3b
fix: normalize Tinybird health query timestamps
richiemcilroy b445429
feat: enforce typed first-party analytics events
richiemcilroy f8a610f
feat: make critical analytics delivery durable
richiemcilroy e030c95
feat: add exact analytics decision views
richiemcilroy fc802e4
ci: prove analytics in isolated staging
richiemcilroy 729f28c
fix: avoid nested Tinybird aggregate aliases
richiemcilroy c4a3b9c
fix: disambiguate traffic engagement aggregates
richiemcilroy 094f838
fix: use supported Tinybird copy commands
richiemcilroy 3852628
fix: prove exact analytics decisions
richiemcilroy 4ff7e41
fix: reconcile authoritative analytics facts
richiemcilroy 7d85e4f
fix: fail closed on analytics privacy boundaries
richiemcilroy 1b257a0
fix: harden analytics collectors and outbox
richiemcilroy 93e488f
fix: verify copied Tinybird endpoints locally
richiemcilroy d43593d
fix: bound browser analytics activity
richiemcilroy 835a60d
fix: fail closed in analytics staging
richiemcilroy 11c8261
fix: reject sensitive analytics payloads
richiemcilroy a6cb613
fix: use scoped Tinybird local tokens
richiemcilroy 4fd055c
fix: reconcile Stripe analytics events
richiemcilroy b54c723
fix: verify bounded analytics helpers
richiemcilroy 364c888
fix: authenticate Tinybird local token discovery
richiemcilroy 5739a36
feat: harden analytics delivery and business facts
richiemcilroy 89d3e7b
feat: materialize analytics decision views
richiemcilroy 2715d98
ci: prove exact-sha analytics staging
richiemcilroy 178e2f8
test: type analytics performance scheduler
richiemcilroy 6b2a979
chore: format analytics recovery tests
richiemcilroy 298f9d9
test: isolate Tinybird local fixtures
richiemcilroy 42e7fef
fix: preserve analytics delivery recovery
richiemcilroy a1895a1
ci: retire legacy staging analytics resources
richiemcilroy 56d0e8b
fix: keep analytics recovery durable
richiemcilroy 0054d58
fix: evolve exact analytics aggregates safely
richiemcilroy 0b74725
fix: close analytics recovery abuse gaps
richiemcilroy 7b1f97a
test: bound Tinybird local copy threads
richiemcilroy ad881ea
fix: keep analytics keys in the OS keyring
richiemcilroy 2f915b4
ci: install dependencies for staging assertions
richiemcilroy c5a464f
fix: migrate durable analytics outbox keys
richiemcilroy 20ff135
ci: scope analytics staging operators
richiemcilroy e561dfb
fix: adopt concurrent analytics outbox keys
richiemcilroy 47a75d6
fix: bound analytics privacy scans
richiemcilroy b02f04b
ci: discard failed staging before cleanup
richiemcilroy fc31804
ci: accept exact no-op Tinybird deployments
richiemcilroy da61fb7
ci: require explicit Tinybird no-op proof
richiemcilroy 3437e9f
ci: run Tinybird copies with scoped API
richiemcilroy b3a5956
ci: target live Tinybird copies directly
richiemcilroy be8cdd3
fix: bind analytics limits to trusted networks
richiemcilroy 59397b9
ci: poll Tinybird copies with staging deploy token
richiemcilroy 32c9b38
ci: prove Tinybird copies from aggregate state
richiemcilroy b58f419
ci: preserve analytics candidate through cleanup
richiemcilroy ac90129
ci: clean partial analytics seeds
richiemcilroy 4570483
ci: reconcile interrupted analytics runs
richiemcilroy c32fd9b
fix: inline analytics copy assertion parameter
richiemcilroy 62e6dbf
ci: bind analytics staging lifecycle to deployment
richiemcilroy 794a23f
ci: authorize candidate analytics copies
richiemcilroy 600bbcd
feat: harden analytics contracts and business events
richiemcilroy 1723c7e
fix: make analytics delivery and erasure durable
richiemcilroy d351872
feat: add exact Tinybird decision aggregates
richiemcilroy d2a45c6
ci: prove analytics against exact staging deployments
richiemcilroy 8039996
ci: compile desktop analytics before staging
richiemcilroy 26217fd
ci: prepare native deps for analytics Rust gate
richiemcilroy af3a0cb
feat: enforce typed analytics delivery contracts
richiemcilroy 5b45cd1
feat: make analytics delivery and erasure durable
richiemcilroy d7d80a9
feat: harden analytics decision aggregates
richiemcilroy c6101c8
ci: prove analytics staging at the exact SHA
richiemcilroy 409d18a
fix: use a valid analytics workflow path glob
richiemcilroy 340e03e
fix: keep analytics workflow runtime portable
richiemcilroy c707ffc
fix: prevent Tinybird resource node collisions
richiemcilroy 23e6ae9
fix: harden analytics event admission
richiemcilroy c3788de
fix: expose durable analytics health
richiemcilroy 1dd669f
ci: harden Tinybird staging lifecycle
richiemcilroy a183e23
docs: tighten analytics rollout contract
richiemcilroy 131b29b
fix: make Tinybird staging aggregates executable
richiemcilroy ea74b61
ci: authorize protected analytics previews
richiemcilroy 9be8862
fix: attest branch-scoped analytics previews
richiemcilroy cde2ccc
fix: restrict staging analytics by preview host
richiemcilroy f357201
fix: trust scoped analytics preview marker
richiemcilroy f55226b
fix: accept Vercel deployment routing host
richiemcilroy d8c622c
fix: gate staging analytics by branch marker
richiemcilroy 224c011
fix: sign staging analytics requests
richiemcilroy 8838813
fix: bootstrap protected analytics preview
richiemcilroy 217a95d
fix: route analytics staging subpaths
richiemcilroy c9e8b67
improve: report staging credential drift
richiemcilroy 65a968e
fix: harden analytics staging recovery
richiemcilroy e560be9
fix: seed analytics after staging promotion
richiemcilroy 7a2b9e2
fix: attest analytics copy jobs before erasure
richiemcilroy 078f69e
fix: harden Tinybird staging token boundaries
richiemcilroy 8001bc9
fix: mint scoped JWT for local analytics checks
richiemcilroy 3c92e69
fix: isolate local analytics read token
richiemcilroy ebdb814
fix: scope Tinybird Local verification at build
richiemcilroy 5389076
fix: retire superseded Tinybird staging deployments
richiemcilroy ff64788
fix: harden staging analytics identity cleanup
richiemcilroy aaaf7d4
fix: keep analytics fixtures in completed UTC days
richiemcilroy ae2b835
fix: deliver initial analytics page views reliably
richiemcilroy 8613612
fix: isolate analytics copy generations
richiemcilroy c362483
fix: make analytics staging recovery fail closed
richiemcilroy df69a61
fix: invoke analytics timers safely
richiemcilroy 768cd08
test: prove browser delivery by event id
richiemcilroy 766b051
test: isolate analytics main-thread cost
richiemcilroy 5fe625a
test: isolate fresh browser retry
richiemcilroy addf90f
improve: classify analytics request rejections
richiemcilroy 97759a4
test: report deployed analytics acknowledgements
richiemcilroy 7fed64b
fix: accept generated analytics identifiers
richiemcilroy 67ac7cc
docs: pin analytics firewall semantics
richiemcilroy 7a90111
fix: exercise durable analytics retry
richiemcilroy 884a7a1
fix: deduplicate analytics cleanup scopes
richiemcilroy 41e64c1
fix: version analytics client event contracts
richiemcilroy 3eba5ad
fix: preserve analytics retry and sign-in evidence
richiemcilroy bcb1c59
fix: emit first views for legacy shares
richiemcilroy 1dbe76f
fix: erase organization analytics identity state
richiemcilroy 73c90e8
fix: make analytics staging fail closed
richiemcilroy 2fec91b
fix: contain failed analytics staging run
richiemcilroy c55b311
fix: attest analytics recovery alias
richiemcilroy af3109f
fix: resume scoped analytics containment
richiemcilroy fa9374c
fix: harden analytics staging recovery
richiemcilroy 08efb0d
docs: update analytics recovery contract
richiemcilroy 9558544
fix: make analytics recovery alias-safe
richiemcilroy f72ba4d
fix: stabilize analytics preview evidence
richiemcilroy f36805a
fix: align analytics staging fixture assertions
richiemcilroy 8fc6cdc
fix: model analytics endpoint scale correctly
richiemcilroy 7003bb2
fix: count typed experiment outcomes
richiemcilroy 7723d2c
fix: measure analytics visibility boundaries
richiemcilroy 3439443
fix: preserve preview delivery cardinality
richiemcilroy 1ce06e1
fix: scope analytics health proof by test run
richiemcilroy 840ad5a
fix: recover scoped analytics erasure retries
richiemcilroy 761c7cb
fix: clear synthetic erasure fence before browser proof
richiemcilroy 3f3ad8f
fix: retire stale analytics erasure requests
richiemcilroy 04ac9b5
fix: expose safe analytics erasure phases
richiemcilroy 56e82cc
fix: request JSON for analytics erasure queries
richiemcilroy 921f653
fix: verify shared-browser analytics erasure
richiemcilroy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| name: Analytics | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - ".github/workflows/analytics.yml" | ||
| - "package.json" | ||
| - "pnpm-lock.yaml" | ||
| - "packages/local-docker/**" | ||
| - "packages/analytics/**" | ||
| - "packages/env/server.ts" | ||
| - "packages/web-backend/src/ProductAnalytics/**" | ||
| - "apps/web/actions/analytics/**" | ||
| - "apps/web/actions/organization/**" | ||
| - "apps/web/__tests__/unit/*analytics*.test.ts" | ||
| - "apps/web/__tests__/unit/developer-credits-webhook.test.ts" | ||
| - "apps/web/app/Layout/*Analytics*.tsx" | ||
| - "apps/web/app/api/events/**" | ||
| - "apps/web/app/api/invite/accept/route.ts" | ||
| - "apps/web/app/api/settings/billing/**" | ||
| - "apps/web/app/api/webhooks/stripe/route.ts" | ||
| - "apps/web/app/utils/analytics.ts" | ||
| - "apps/web/app/utils/product-analytics.ts" | ||
| - "apps/web/lib/analytics/**" | ||
| - "apps/web/lib/rate-limit.ts" | ||
| - "apps/desktop/src-tauri/src/lib.rs" | ||
| - "apps/desktop/src/utils/analytics.ts" | ||
| - "apps/desktop/src/utils/product-analytics.ts" | ||
| - "apps/desktop/src/utils/*analytics*.test.ts" | ||
| - "apps/desktop/src-tauri/src/posthog.rs" | ||
| - "scripts/analytics/**" | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - ".github/workflows/analytics.yml" | ||
| - "package.json" | ||
| - "pnpm-lock.yaml" | ||
| - "packages/local-docker/**" | ||
| - "packages/analytics/**" | ||
| - "packages/env/server.ts" | ||
| - "packages/web-backend/src/ProductAnalytics/**" | ||
| - "apps/web/actions/analytics/**" | ||
| - "apps/web/actions/organization/**" | ||
| - "apps/web/__tests__/unit/*analytics*.test.ts" | ||
| - "apps/web/__tests__/unit/developer-credits-webhook.test.ts" | ||
| - "apps/web/app/Layout/*Analytics*.tsx" | ||
| - "apps/web/app/api/events/**" | ||
| - "apps/web/app/api/invite/accept/route.ts" | ||
| - "apps/web/app/api/settings/billing/**" | ||
| - "apps/web/app/api/webhooks/stripe/route.ts" | ||
| - "apps/web/app/utils/analytics.ts" | ||
| - "apps/web/app/utils/product-analytics.ts" | ||
| - "apps/web/lib/analytics/**" | ||
| - "apps/web/lib/rate-limit.ts" | ||
| - "apps/desktop/src-tauri/src/lib.rs" | ||
| - "apps/desktop/src/utils/analytics.ts" | ||
| - "apps/desktop/src/utils/product-analytics.ts" | ||
| - "apps/desktop/src/utils/*analytics*.test.ts" | ||
| - "apps/desktop/src-tauri/src/posthog.rs" | ||
| - "scripts/analytics/**" | ||
| workflow_dispatch: | ||
| inputs: | ||
| deploy: | ||
| description: Deploy the checked Tinybird project to production | ||
| required: true | ||
| default: false | ||
| type: boolean | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| validate: | ||
| name: Validate and test analytics | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: ./.github/actions/setup-js | ||
| - name: Run analytics regression suites | ||
| run: pnpm analytics:test | ||
| - name: Validate Docker Compose | ||
| run: node scripts/analytics/analytics-cli.js compose-check | ||
| - name: Build and test with Tinybird Local | ||
| run: node scripts/analytics/analytics-cli.js local | ||
| - name: Stop Tinybird Local | ||
| if: always() | ||
| run: node scripts/analytics/analytics-cli.js local-stop | ||
|
|
||
| deploy: | ||
| name: Deploy analytics | ||
| needs: validate | ||
| if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || inputs.deploy == true) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| concurrency: | ||
| group: analytics-production | ||
| cancel-in-progress: false | ||
| environment: production | ||
| env: | ||
| TINYBIRD_DEPLOY_TOKEN: ${{ secrets.TINYBIRD_DEPLOY_TOKEN }} | ||
| TINYBIRD_URL: ${{ secrets.TINYBIRD_URL }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| - name: Check and deploy Tinybird project | ||
| run: node scripts/analytics/analytics-cli.js cloud-deploy | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.