Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ POSTHOG_PERSONAL_API_KEY=phx_...
# POSTHOG_REGION is optional, defaults to 'us'. Can also be passed via --region flag or workflow input.
# POSTHOG_REGION=us
POSTHOG_WIZARD_PROJECT_ID=123

# Optional: upload key for the source-maps e2e. Defaults to POSTHOG_PERSONAL_API_KEY (needs error_tracking:write).
# SOURCE_MAPS_CLI_KEY=phx...
2 changes: 2 additions & 0 deletions .github/workflows/wizard-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,8 @@ jobs:
POSTHOG_REGION: ${{ needs.discover.outputs.input_posthog_region }}
POSTHOG_PERSONAL_API_KEY: ${{ secrets.GH_APP_POSTHOG_WIZARD_CI_BOT_POSTHOG_PERSONAL_KEY }}
POSTHOG_WIZARD_PROJECT_ID: ${{ secrets.GH_APP_POSTHOG_WIZARD_CI_BOT_TARGET_PROJECT_ID }}
# The existing CI key, now with error_tracking:write, doubles as the source-maps upload key.
SOURCE_MAPS_CLI_KEY: ${{ secrets.GH_APP_POSTHOG_WIZARD_CI_BOT_POSTHOG_PERSONAL_KEY }}
WIZARD_PATH: ${{ env.WIZARD_PATH }}
CONTEXT_MILL_PATH: ${{ env.CONTEXT_MILL_PATH }}
WIZARD_REF: ${{ needs.discover.outputs.input_wizard_ref }}
Expand Down
2 changes: 1 addition & 1 deletion apps/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"dir": "error-tracking-upload-source-maps",
"label": "Upload Source Maps",
"description": "Wire up PostHog Error Tracking source-map upload",
"ciCapable": false
"ciCapable": true
}
]
}
12 changes: 8 additions & 4 deletions services/wizard-ci/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ export function runE2e(opts: E2eOptions): number {
for (const k of Object.keys(childEnv))
if (STRIP_HOST_AUTH.test(k)) delete childEnv[k];
childEnv.POSTHOG_PERSONAL_API_KEY = apiKey;
// The source-maps upload key defaults to the CI key (which has error_tracking:write); SOURCE_MAPS_CLI_KEY overrides it locally.
childEnv.SOURCE_MAPS_CLI_KEY = process.env.SOURCE_MAPS_CLI_KEY ?? apiKey;
childEnv.APP_DIR = appDir;
childEnv.PROJECT_ID = projectId;
childEnv.POSTHOG_REGION = region;
Expand All @@ -176,10 +178,12 @@ export function runE2e(opts: E2eOptions): number {
/* harness crashed before writing */
}

// The integration flow ends at keep-skills/skillsComplete; other programs
// (e.g. self-driving) end at their own outro, so assert against that instead.
const isIntegration = !opts.program || opts.program === "posthog-integration";
const programChecks: Array<[string, boolean]> = isIntegration
// Integration and source-maps end at keep-skills; terminal-outro programs (self-driving) assert the outro.
const endsAtKeepSkills =
!opts.program ||
opts.program === "posthog-integration" ||
opts.program === "error-tracking-upload-source-maps";
const programChecks: Array<[string, boolean]> = endsAtKeepSkills
? [
["full interactive flow reached keep-skills", !!result?.screenPath?.includes("keep-skills")],
["skillsComplete", result?.skillsComplete === true],
Expand Down