Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bc6b1f9
docs(gtm): spec + plan for analytics-foundation-1a (dashboards-as-code)
blove May 13, 2026
ce2e07c
chore(gtm): decompose analytics-foundation into 1a-1d sub-specs
blove May 13, 2026
799b27d
chore(deps): add openapi-fetch, openapi-typescript, zod for posthog-t…
blove May 13, 2026
b0cf9c6
feat(posthog-tools): scaffold Nx project with sync/report/test targets
blove May 13, 2026
c55482c
feat(posthog-tools): add OpenAPI type generation + initial types
blove May 14, 2026
d22b8b0
feat(posthog-tools): env.ts with zod-validated POSTHOG_* parsing
blove May 14, 2026
f56e7dc
feat(posthog-tools): zod schemas for dashboard/insight/cohort JSON
blove May 14, 2026
2bae6ca
feat(posthog-tools): openapi-fetch client with 429/503 backoff
blove May 14, 2026
d18d6e8
feat(posthog-tools): computePlan() for sync engine
blove May 14, 2026
5ea30de
feat(posthog-tools): applyPlan() with writeback + slug resolution
blove May 14, 2026
2536c73
feat(posthog-tools): sync.ts CLI entry + openapi-fetch adapter
blove May 14, 2026
7590fb6
fix(posthog-tools): writeback hint filter excludes failed items
blove May 14, 2026
e69c0d8
feat(posthog-tools): report.ts pure functions (sparkline, delta, render)
blove May 14, 2026
afa20a5
feat(posthog-tools): report.ts main flow + 7-day bucket extraction
blove May 14, 2026
f65affe
feat(posthog-tools): developer-funnel sample dashboard + 4 insights
blove May 14, 2026
e1674d3
test(posthog-tools): permanent taxonomy guard
blove May 14, 2026
c35029f
feat(posthog-tools): root scripts + .env.example
blove May 14, 2026
23e4460
ci(posthog-tools): add Nx-affected gated sync plan check
blove May 14, 2026
a4de87b
docs(posthog-tools): align README with Spec 1A implementation
blove May 14, 2026
4dd9112
fix(posthog-tools): Node 20 compat + report fails loud on HTTP errors
blove May 14, 2026
21e999c
chore(posthog): writeback ids for developer-funnel and 4 insights
blove May 14, 2026
f25e601
fix(posthog-tools): wire insights to dashboards via PATCH
blove May 14, 2026
ea031bd
fix(posthog-tools): map InsightLocal/DashboardLocal to PostHog body s…
blove May 14, 2026
c7da1f4
fix(posthog-tools): migrate mapper to PostHog modern query schema
blove May 14, 2026
3d73fba
chore: gitignore tools/posthog tsbuildinfo
blove May 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

# PostHog dashboards-as-code (tools/posthog/)
# Generate a Personal API Key at https://us.posthog.com/me/settings#personal-api-keys
# Required scopes: dashboard:write, insight:write, cohort:write, project:read
POSTHOG_PERSONAL_API_KEY=
POSTHOG_HOST=https://us.i.posthog.com
POSTHOG_PROJECT_ID=
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,40 @@ jobs:
BASE_URL: https://cockpit.cacheplane.ai
EXAMPLES_URL: https://examples.cacheplane.ai
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

posthog-sync-plan:
name: PostHog — dashboards-as-code drift check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- name: Detect affected
id: affected
run: |
base_sha=$(git merge-base origin/main HEAD)
head_sha=$(git rev-parse HEAD)
affected="$(npx nx show projects --affected --base=$base_sha --head=$head_sha)"
if printf '%s\n' "$affected" | grep -Fx 'posthog-tools' >/dev/null; then
echo "is_affected=yes" >> "$GITHUB_OUTPUT"
else
echo "is_affected=no" >> "$GITHUB_OUTPUT"
echo "::notice::posthog-tools not in affected projects — skipping drift check."
fi
- name: posthog:sync --plan
if: steps.affected.outputs.is_affected == 'yes'
env:
POSTHOG_PERSONAL_API_KEY: ${{ secrets.POSTHOG_PERSONAL_API_KEY }}
POSTHOG_HOST: https://us.i.posthog.com
POSTHOG_PROJECT_ID: ${{ secrets.POSTHOG_PROJECT_ID }}
run: |
if [ -z "$POSTHOG_PERSONAL_API_KEY" ]; then
echo "::notice::POSTHOG_PERSONAL_API_KEY not set — soft skip for contributor PRs."
exit 0
fi
npx nx run posthog-tools:sync:plan
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ libs/licensing/src/lib/license-public-key.generated.ts

# superpowers brainstorming output
.superpowers/
tools/posthog/tsconfig.tsbuildinfo
Loading
Loading