Repository navigation
docs: complete the OIDC steps and fix the sourcemap check in the web example - #754
Conversation
…example Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR overviewNo security issues were found in this pull request. Reviews
|
posthog-flutter Compliance ReportDate: 2026-12-01T17:31:02.615368+00:00 ✅ All Tests Passed!232/232 tests passed Capture_V1 Tests✅ 105/105 tests passed View Details
Capture_Ai_V1 Tests✅ 110/110 tests passed View Details
Feature_Flags Tests✅ 17/17 tests passed View Details
|
| In GitHub Actions, install hog with the [PostHog/setup-hog](https://github.com/PostHog/setup-hog) action. The job can then upload with its OIDC token instead of a personal API key: | ||
|
|
||
| 1. Run `hog ci setup --scope error_tracking:write` once in the repository, and have an organization admin approve the request. | ||
| 2. Put the project ID that `hog ci setup` prints in `posthog.json` as `"projectId"`, or set `HOG_PROJECT_ID` (and `HOG_HOST` outside US Cloud) in the job. |
There was a problem hiding this comment.
Suggestion: Step 2 drops the host from the posthog.json route, so an EU Cloud job that follows it literally can't get a token.
In the job, hog takes the exchange host from HOG_HOST, or from a Cloud host in posthog.json, and otherwise uses https://us.posthog.com (hog/src/posthog/credentials.ts:300-313, hog/README.md:505, pinned by workload.test.ts:198-223). With only "projectId" in posthog.json, an EU job asks for an OIDC token for US Cloud and exchanges it there for an EU project, which fails. The HOG_HOST note in this step only covers the env-var route. hog ci setup prints both values, e.g. { "host": "https://eu.posthog.com", "projectId": 123 } (setup.ts:49-58, 209-221). hog's README (L499) and the migration guide (posthog.com/contents/docs/cli/migrating.mdx:213) both say to add both, and this was part of the earlier suggestion on #752 (#752 (comment)).
Consider:
| 2. Put the project ID that `hog ci setup` prints in `posthog.json` as `"projectId"`, or set `HOG_PROJECT_ID` (and `HOG_HOST` outside US Cloud) in the job. | |
| 2. Add the `host` and `projectId` that `hog ci setup` prints to `posthog.json`, or set `HOG_HOST` and `HOG_PROJECT_ID` in the job. A self-hosted PostHog needs `HOG_HOST` either way. |
(Checked against hog 1.0.0, PostHog/posthog@0441094.)
| # check the sourcemaps have chunk_id injected (*.js.map file). The release goes into the js file, not the map | ||
| # check the js file has _posthogChunkIds injected (*.js file) |
There was a problem hiding this comment.
Suggestion: Line 33 now says the release goes into the js file, but the js check below it still names only _posthogChunkIds. In event mode (the default, shared.ts:144-159), inject prepends a snippet that sets _posthogReleaseId next to _posthogChunkIds (hog/worker/src/constant.rs:7, pair.rs:447-457), while the map gets only chunk_id (pair.rs:376-378). Consider naming it, as suggested on #752 (#752 (comment)):
| # check the sourcemaps have chunk_id injected (*.js.map file). The release goes into the js file, not the map | |
| # check the js file has _posthogChunkIds injected (*.js file) | |
| # check the sourcemaps have chunk_id injected (*.js.map file). The release goes into the js file, not the map | |
| # check the js file has _posthogChunkIds and _posthogReleaseId injected (*.js file) |
💡 Motivation and Context
Follow-up to #752, from review comments that came in as it merged:
not_authenticated, because the OIDC setup was missing two steps.hog error-tracking injecttold contributors to look forrelease_idin the.mapfiles. hog's default event mode never writes it there, so the check looked like a failed inject.Changes
hog ci setupand have an admin approve it, put the project ID inposthog.jsonorHOG_PROJECT_ID, and give the jobid-token: write.chunk_idonly, and says the release goes into the js file.💚 How did you test it?
📝 Checklist
🤖 Generated with Claude Code