Skip to content

docs: complete the OIDC steps and fix the sourcemap check in the web example - #754

Merged
rafaeelaudibert merged 1 commit into
mainfrom
rafa/docs-hog-example-followup
Dec 1, 2026
Merged

rafaeelaudibert merged 1 commit into
mainfrom
rafa/docs-hog-example-followup

Conversation

@rafaeelaudibert

Copy link
Copy Markdown
Member

💡 Motivation and Context

Follow-up to #752, from review comments that came in as it merged:

  • Contributors who follow the GitHub Actions steps stop at not_authenticated, because the OIDC setup was missing two steps.
  • The check after hog error-tracking inject told contributors to look for release_id in the .map files. hog's default event mode never writes it there, so the check looked like a failed inject.

Changes

  • The GitHub Actions paragraph lists every OIDC step: run hog ci setup and have an admin approve it, put the project ID in posthog.json or HOG_PROJECT_ID, and give the job id-token: write.
  • The sourcemap check looks for chunk_id only, and says the release goes into the js file.

💚 How did you test it?

  • Docs only. The wording follows hog 1.0.0's OIDC exchange, which needs a project ID, and its event-mode inject.

📝 Checklist

  • All commits are signed (see Commit signing)
  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • I updated the docs if needed.
  • No breaking change or entry added to the changelog.

🤖 Generated with Claude Code

…example

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rafaeelaudibert
rafaeelaudibert requested a review from a team as a code owner December 1, 2026 17:22
@rafaeelaudibert rafaeelaudibert self-assigned this Dec 1, 2026
@veria-ai

veria-ai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

posthog-flutter Compliance Report

Date: 2026-12-01T17:31:02.615368+00:00
Duration: 371265ms

✅ All Tests Passed!

232/232 tests passed


Capture_V1 Tests

✅ 105/105 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 242ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 130ms
Required Headers.Has Authorization Bearer Header ✅ 122ms
Required Headers.Has Content Type Json ✅ 126ms
Required Headers.Has Posthog Sdk Info Format ✅ 123ms
Required Headers.Has Posthog Attempt Header ✅ 119ms
Required Headers.Has Posthog Request Id ✅ 122ms
Required Headers.Has Posthog Request Timestamp ✅ 121ms
Required Headers.Has User Agent ✅ 122ms
Body Format.Body Has Created At And Batch ✅ 120ms
Body Format.No Api Key In Body ✅ 121ms
Body Format.No Sent At In Body ✅ 119ms
Event Format.Event Has Required Root Fields ✅ 118ms
Event Format.Event Uuid Is Valid ✅ 120ms
Event Format.Event Timestamp Is Rfc3339 ✅ 120ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 120ms
Event Format.Distinct Id Is String ✅ 122ms
Event Format.Distinct Id At Root Not Properties ✅ 120ms
Event Format.Custom Properties Preserved ✅ 120ms
Event Format.Set Properties Preserved ✅ 125ms
Event Format.Set Once Properties Preserved ✅ 119ms
Event Format.Groups Properties Preserved ✅ 119ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 119ms
Event Format.Event Has Required Root Fields Batch ✅ 126ms
Event Format.Event Uuid Is Valid Batch ✅ 126ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 126ms
Event Format.Distinct Id Is String Batch ✅ 126ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 124ms
Event Format.Custom Properties Preserved Batch ✅ 125ms
Event Format.Set Properties Preserved Batch ✅ 131ms
Event Format.Set Once Properties Preserved Batch ✅ 125ms
Event Format.Groups Properties Preserved Batch ✅ 126ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 126ms
Batch Behavior.Multiple Events In Single Batch ✅ 131ms
Batch Behavior.Batch Envelope Smoke ✅ 129ms
Batch Behavior.Flush With No Events Sends Nothing ✅ 110ms
Batch Behavior.Flush At Triggers Batch ✅ 1016ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 120ms
Deduplication.Generates Unique Uuids ✅ 128ms
Deduplication.Different Events Same Content Different Uuids ✅ 121ms
Deduplication.Preserves Uuid On Retry ✅ 5129ms
Deduplication.Preserves Timestamp On Retry ✅ 5127ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5128ms
Deduplication.No Duplicate Events In Batch ✅ 130ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 117ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 10128ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 5123ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 2232ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 5125ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 120ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 122ms
Response Format Validation.Success No Retry After When All Ok ✅ 121ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 122ms
Response Format Validation.Success No Retry After When Drop Only ✅ 122ms
Response Format Validation.Response Echoes Request Id ✅ 118ms
Retry Behavior.Retries On 408 ✅ 5123ms
Retry Behavior.Retries On 500 ✅ 5122ms
Retry Behavior.Retries On 503 ✅ 5123ms
Retry Behavior.Retries On 504 ✅ 5124ms
Retry Behavior.Retries On 404 ✅ 5125ms
Retry Behavior.Retries On 429 ✅ 5123ms
Retry Behavior.Retries On 502 ✅ 5123ms
Retry Behavior.Retryable Errors Have Retry After ✅ 2121ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 8127ms
Retry Behavior.Does Not Retry On 400 ✅ 2122ms
Retry Behavior.Does Not Retry On 401 ✅ 2120ms
Retry Behavior.Does Not Retry On 402 ✅ 2120ms
Retry Behavior.Does Not Retry On 413 ✅ 2121ms
Retry Behavior.Does Not Retry On 415 ✅ 2120ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 2121ms
Retry Behavior.Implements Backoff ✅ 12121ms
Partial Batch Handling.Handles 200 Full Success ✅ 2120ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3127ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3123ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3124ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 5125ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 5127ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 5128ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 5127ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 5125ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 5121ms
Partial Batch Handling.Respects Retry After On Partial ✅ 5125ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3124ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3129ms
Compression.Sends Gzip Content Encoding ✅ 121ms
Compression.No Content Encoding When Disabled ✅ 117ms
Compression.Compressed Body Is Decompressible ✅ 116ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 2119ms
Event Options.Cookieless Mode Override ✅ 118ms
Event Options.Disable Skew Correction Override ✅ 117ms
Event Options.Process Person Profile Override ✅ 115ms
Event Options.Product Tour Id Override ✅ 117ms
Event Options.Unset Options Omitted ✅ 117ms
Event Options.Options Override In Batch ✅ 121ms
Event Options.Unknown Option Passes Through ✅ 117ms
Event Options.Option Value Is Not Converted ✅ 117ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 116ms
Event Options.Option Wins Over Legacy Property ✅ 117ms
Event Options.Legacy Property Fills Unset Option ✅ 115ms
Event Options.Null Option Falls Back To Legacy Property ✅ 116ms
Property Layers.Caller Property Beats Registered Property ✅ 119ms
Property Layers.Before Send Runs Last ✅ 118ms
Fail Open.Empty Api Key Sends Nothing ✅ 1111ms
Fail Open.Personal Api Key Sends Nothing ✅ 1112ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 118ms

Capture_Ai_V1 Tests

✅ 110/110 tests passed

View Details
Test Status Duration
Endpoint And Method.Targets V1 Endpoint ✅ 118ms
Endpoint And Method.Does Not Use Legacy Endpoints ✅ 116ms
Endpoint And Method.Capture Does Not Reroute Ai Named Events ✅ 116ms
Endpoint And Method.Capture Ai Does Not Reroute Non Ai Events ✅ 116ms
Lane Isolation.Failing Ai Lane Does Not Delay Analytics ✅ 5137ms
Required Headers.Has Authorization Bearer Header ✅ 117ms
Required Headers.Has Content Type Json ✅ 116ms
Required Headers.Has Posthog Sdk Info Format ✅ 116ms
Required Headers.Has Posthog Attempt Header ✅ 116ms
Required Headers.Has Posthog Request Id ✅ 116ms
Required Headers.Has Posthog Request Timestamp ✅ 116ms
Required Headers.Has User Agent ✅ 116ms
Body Format.Body Has Created At And Batch ✅ 115ms
Body Format.No Api Key In Body ✅ 116ms
Body Format.No Sent At In Body ✅ 116ms
Event Format.Event Has Required Root Fields ✅ 116ms
Event Format.Event Uuid Is Valid ✅ 116ms
Event Format.Event Timestamp Is Rfc3339 ✅ 116ms
Event Format.Non Utc Event Timestamp Is Converted To Utc ✅ 117ms
Event Format.Distinct Id Is String ✅ 116ms
Event Format.Distinct Id At Root Not Properties ✅ 116ms
Event Format.Custom Properties Preserved ✅ 116ms
Event Format.Set Properties Preserved ✅ 116ms
Event Format.Set Once Properties Preserved ✅ 116ms
Event Format.Groups Properties Preserved ✅ 116ms
Event Format.Sdk Generates Uuid If Not Provided ✅ 116ms
Event Format.Event Has Required Root Fields Batch ✅ 122ms
Event Format.Event Uuid Is Valid Batch ✅ 121ms
Event Format.Event Timestamp Is Rfc3339 Batch ✅ 120ms
Event Format.Distinct Id Is String Batch ✅ 121ms
Event Format.Distinct Id At Root Not Properties Batch ✅ 121ms
Event Format.Custom Properties Preserved Batch ✅ 120ms
Event Format.Set Properties Preserved Batch ✅ 121ms
Event Format.Set Once Properties Preserved Batch ✅ 122ms
Event Format.Groups Properties Preserved Batch ✅ 122ms
Event Format.Sdk Generates Uuid If Not Provided Batch ✅ 123ms
Batch Behavior.Multiple Events In Single Batch ✅ 126ms
Batch Behavior.Batch Envelope Smoke ✅ 123ms
Batch Behavior.Flush At Triggers Batch ✅ 1015ms
Batch Behavior.Created At Reflects Batch Creation Time ✅ 117ms
Deduplication.Generates Unique Uuids ✅ 127ms
Deduplication.Different Events Same Content Different Uuids ✅ 120ms
Deduplication.Preserves Uuid On Retry ✅ 5124ms
Deduplication.Preserves Timestamp On Retry ✅ 5123ms
Deduplication.Preserves Uuid And Timestamp On Batch Retry ✅ 5128ms
Deduplication.No Duplicate Events In Batch ✅ 126ms
Header Behavior On Retry.Attempt Header Starts At One ✅ 118ms
Header Behavior On Retry.Attempt Header Increments On Retry ✅ 10126ms
Header Behavior On Retry.Request Id Preserved On Retry ✅ 5122ms
Header Behavior On Retry.Different Requests Have Different Request Ids ✅ 2229ms
Header Behavior On Retry.Request Timestamp Changes On Retry ✅ 5122ms
Response Format Validation.Success Response Has Uuid Keyed Results ✅ 116ms
Response Format Validation.Success Response Has Ok For Each Event ✅ 120ms
Response Format Validation.Success No Retry After When All Ok ✅ 119ms
Response Format Validation.Success Retry After Present When Retry Events ✅ 119ms
Response Format Validation.Success No Retry After When Drop Only ✅ 119ms
Response Format Validation.Response Echoes Request Id ✅ 115ms
Retry Behavior.Retries On 408 ✅ 5121ms
Retry Behavior.Retries On 500 ✅ 5118ms
Retry Behavior.Retries On 503 ✅ 5123ms
Retry Behavior.Retries On 504 ✅ 5122ms
Retry Behavior.Retries On 404 ✅ 5122ms
Retry Behavior.Retries On 429 ✅ 5121ms
Retry Behavior.Retries On 502 ✅ 5123ms
Retry Behavior.Retryable Errors Have Retry After ✅ 2119ms
Retry Behavior.Respects Retry After On Retryable Error ✅ 8124ms
Retry Behavior.Does Not Retry On 400 ✅ 2119ms
Retry Behavior.Does Not Retry On 401 ✅ 2123ms
Retry Behavior.Does Not Retry On 402 ✅ 2118ms
Retry Behavior.Does Not Retry On 413 ✅ 2119ms
Retry Behavior.Does Not Retry On 415 ✅ 2119ms
Retry Behavior.Non Retryable Errors Have No Retry After ✅ 2119ms
Retry Behavior.Implements Backoff ✅ 12126ms
Partial Batch Handling.Handles 200 Full Success ✅ 2119ms
Partial Batch Handling.Handles 200 With All Ok ✅ 3124ms
Partial Batch Handling.Does Not Retry Dropped Events ✅ 3122ms
Partial Batch Handling.Does Not Retry Warning Events ✅ 3122ms
Partial Batch Handling.Prunes Ok Events On Partial Retry ✅ 5124ms
Partial Batch Handling.Prunes Dropped Events On Partial Retry ✅ 5125ms
Partial Batch Handling.Retries Only Retry Events From Partial ✅ 5127ms
Partial Batch Handling.Partial Retry Preserves Uuids ✅ 5124ms
Partial Batch Handling.Partial Retry Attempt Header Increments ✅ 5125ms
Partial Batch Handling.Partial Retry Request Id Preserved ✅ 5126ms
Partial Batch Handling.Respects Retry After On Partial ✅ 5124ms
Partial Batch Handling.Unknown Result Treated As Terminal ✅ 3123ms
Partial Batch Handling.Mixed Ok Drop Warning No Retry ✅ 3127ms
Compression.Sends Gzip Content Encoding ✅ 116ms
Compression.No Content Encoding When Disabled ✅ 115ms
Compression.Compressed Body Is Decompressible ✅ 115ms
Error Handling.Does Not Retry On Unknown 4Xx ✅ 2118ms
Event Options.Cookieless Mode Override ✅ 117ms
Event Options.Disable Skew Correction Override ✅ 115ms
Event Options.Process Person Profile Override ✅ 116ms
Event Options.Product Tour Id Override ✅ 116ms
Event Options.Unset Options Omitted ✅ 115ms
Event Options.Options Override In Batch ✅ 120ms
Event Options.Unknown Option Passes Through ✅ 115ms
Event Options.Option Value Is Not Converted ✅ 116ms
Event Options.Lenient Bool Option Values Are Not Converted ✅ 116ms
Event Options.Option Wins Over Legacy Property ✅ 116ms
Event Options.Legacy Property Fills Unset Option ✅ 115ms
Event Options.Null Option Falls Back To Legacy Property ✅ 116ms
Event Size.Event Over Ceiling Is Not Sent ✅ 4238ms
Event Size.Over Ceiling Drop Is Reported Or Logged Without Content ✅ 2193ms
Event Size.Batches Close Before Byte Target ✅ 6314ms
Geoip And Historical Migration.Historical Migration Absent By Default ✅ 118ms
Property Layers.Caller Property Beats Registered Property ✅ 115ms
Property Layers.Before Send Runs Last ✅ 116ms
Fail Open.Empty Api Key Sends Nothing ✅ 1111ms
Fail Open.Personal Api Key Sends Nothing ✅ 1112ms

Feature_Flags Tests

✅ 17/17 tests passed

View Details
Test Status Duration
Request Payload.Request With Person Properties Device Id ✅ 24ms
Request Payload.Flags Request Uses V2 Query Param ✅ 19ms
Request Payload.Flags Request Hits Flags Path Not Decide ✅ 13ms
Request Payload.Flags Request Omits Authorization Header ✅ 13ms
Request Payload.Token In Flags Body Matches Init ✅ 14ms
Request Payload.Groups Round Trip ✅ 13ms
Request Payload.Groups Default To Empty Object ✅ 14ms
Request Payload.Disable Geoip False Propagates As Geoip Disable False ✅ 13ms
Request Payload.Disable Geoip Omitted Defaults To False ✅ 13ms
Request Payload.Flag Keys To Evaluate Contains Only Requested Key ✅ 15ms
Request Lifecycle.No Flags Request On Init Alone ✅ 5ms
Request Lifecycle.No Flags Request On Normal Capture ✅ 116ms
Request Lifecycle.Two Flag Calls Produce Two Remote Requests ✅ 21ms
Request Lifecycle.Mock Response Value Is Returned To Caller ✅ 15ms
Retry Behavior.Retries Flags On 502 ✅ 322ms
Retry Behavior.Retries Flags On 504 ✅ 319ms
Side Effect Events.Get Feature Flag Captures Feature Flag Called Event ✅ 123ms

@rafaeelaudibert
rafaeelaudibert enabled auto-merge (squash) December 1, 2026 18:23

@dustinbyrne dustinbyrne 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.

Thanks for following up on #752. The OIDC steps and the map check now match hog 1.0.0. Two small suggestions inline finish the #752 suggestions.

AI-assisted review.

Comment thread example/README.md
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.

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.

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:

Suggested change
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.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤖 Thanks! #754 merged before this landed, so it's in #755.

Comment thread example/README.md
Comment on lines +33 to 34
# 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)

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.

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)):

Suggested change
# 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)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤖 Thanks! #754 merged before this landed, so it's in #755.

@rafaeelaudibert
rafaeelaudibert merged commit 13d5cbb into main Dec 1, 2026
31 of 32 checks passed
@rafaeelaudibert
rafaeelaudibert deleted the rafa/docs-hog-example-followup branch December 1, 2026 19:27
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