Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(ci): fold the remaining bot comments into the CI report (#68078)

Paul D'Ambra16e25433fd39
diff --git a/.github/actions/commit-snapshots/action.yml b/.github/actions/commit-snapshots/action.yml
index d9fbf70c657d..dda8509736f9 100644
--- a/.github/actions/commit-snapshots/action.yml
+++ b/.github/actions/commit-snapshots/action.yml
@@ -157,26 +157,32 @@ runs:
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
- - name: Post snapshot comment
+ - name: Post snapshot section to CI report comment
if: steps.commit.outputs.committed == 'true'
shell: bash
env:
- GH_TOKEN: ${{ inputs.github-token }}
+ # Deliberately the workflow token, NOT inputs.github-token (an app token):
+ # the report engine only recognizes comments authored by github-actions[bot],
+ # so a section posted under an app identity would be invisible to its own
+ # verify pass and spawn duplicate report comments.
+ GITHUB_TOKEN: ${{ github.token }}
SNAPSHOT_SHA: ${{ steps.ghcommit.outputs.commit-hash }}
- PR_NUMBER: ${{ inputs.pr-number }}
COMMIT_SHA: ${{ inputs.commit-sha }}
WORKFLOW_TYPE: ${{ inputs.workflow-type }}
CHANGES: ${{ steps.commit.outputs.changes }}
REPOSITORY: ${{ inputs.repository }}
run: |
- .github/scripts/post-snapshot-comment.js \
- "$WORKFLOW_TYPE" \
- "update" \
- "$CHANGES" \
- "$PR_NUMBER" \
- "$REPOSITORY" \
- "$COMMIT_SHA" \
- "$SNAPSHOT_SHA"
+ if [ -f .github/scripts/post-snapshot-section.mjs ]; then
+ node .github/scripts/post-snapshot-section.mjs \
+ "$WORKFLOW_TYPE" \
+ "update" \
+ "$CHANGES" \
+ "$REPOSITORY" \
+ "$COMMIT_SHA" \
+ "$SNAPSHOT_SHA"
+ else
+ echo "Skipping snapshot section — script not present on this checkout"
+ fi
- name: Fail workflow to signal snapshot changes
if: steps.commit.outputs.committed == 'true'
diff --git a/.github/scripts/post-ch-migration-section.mjs b/.github/scripts/post-ch-migration-section.mjs
new file mode 100644
index 000000000000..bf8570586ab8
--- /dev/null
+++ b/.github/scripts/post-ch-migration-section.mjs
@@ -0,0 +1,49 @@
+#!/usr/bin/env node
+import fs from 'node:fs'
+
+import { clearSectionIfPresent, postSection } from '../../frontend/bin/ci-report/update-ci-report.mjs'
+
+const MARKER_LINE = '<!-- ch-migration-sql -->'
+// The section shares one comment (GitHub caps bodies at 65536 chars) with every other
+// section plus marker/meta overhead — a body sized for a standalone comment would make
+// the shared PATCH fail and freeze the whole report until the SQL shrinks.
+const LIMIT = 30000
+
+const hasChanges = process.env.HAS_CHANGES === 'true'
+
+if (!hasChanges) {
+ // Migrations were added then removed in a later push — mark the section resolved.
+ await clearSectionIfPresent({
+ id: 'ch-migration-sql',
+ summary: 'none',
+ body: 'No ClickHouse migrations in the latest push.',
+ })
+ process.exit(0)
+}
+
+if (!fs.existsSync('ch_migration_sql_comment.md')) {
+ console.info('No ch_migration_sql_comment.md found — nothing to post.')
+ process.exit(0)
+}
+
+const raw = fs.readFileSync('ch_migration_sql_comment.md', 'utf8')
+let body = raw
+ .split('\n')
+ .filter((line) => line.trim() !== MARKER_LINE)
+ .join('\n')
+ .trim()
+
+if (body.length > LIMIT) {
+ const runUrl = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`
+ body = body.slice(0, LIMIT - 400) + `\n\n_…truncated. See the full SQL in the [workflow logs](${runUrl})._`
+}
+
+const count = Number.parseInt(process.env.CH_MIGRATION_COUNT || '', 10)
+const summary = Number.isFinite(count) && count > 0 ? `${count} migration(s)` : 'migration SQL rendered'
+
+await postSection({
+ id: 'ch-migration-sql',
+ status: 'info',
+ summary,
+ body,
+})
diff --git a/.github/scripts/post-eval-section.mjs b/.github/scripts/post-eval-section.mjs
new file mode 100644
index 000000000000..11a8df767b68
--- /dev/null
+++ b/.github/scripts/post-eval-section.mjs
@@ -0,0 +1,132 @@
+#!/usr/bin/env node
+import fs from 'node:fs'
+
+import { postSection } from '../../frontend/bin/ci-report/update-ci-report.mjs'
+
+const DIFF_THRESHOLD = 0.02
+
+if (!fs.existsSync('eval_results.jsonl')) {
+ console.info('No eval_results.jsonl found — nothing to post.')
+ process.exit(0)
+}
+
+const evalResults = fs
+ .readFileSync('eval_results.jsonl', 'utf8')
+ .trim()
+ .split('\n')
+ .filter((line) => line.trim().length > 0)
+ .map((line) => JSON.parse(line))
+
+if (evalResults.length === 0) {
+ console.info('No eval results found — nothing to post.')
+ process.exit(0)
+}
+
+const experimentsWithMaxDiff = evalResults.map((result) => {
+ const scores = result.scores || {}
+ const diffs = Object.values(scores)
+ .map((v) => v.diff)
+ .filter((d) => typeof d === 'number')
+ const minDiff = diffs.length > 0 ? Math.min(...diffs) : 0
+ const maxDiff = diffs.length > 0 ? Math.max(...diffs) : 0
+ const category = minDiff < -DIFF_THRESHOLD ? 'regression' : maxDiff > DIFF_THRESHOLD ? 'improvement' : 'neutral'
+
+ return {
+ result,
+ category,
+ maxDiffInCategoryAbs:
+ category === 'regression'
+ ? -minDiff
+ : category === 'improvement'
+ ? maxDiff
+ : Math.max(Math.abs(minDiff), Math.abs(maxDiff)),
+ }
+})
+
+experimentsWithMaxDiff.sort((a, b) => {
+ if (a.category === b.category) {
+ return b.maxDiffInCategoryAbs - a.maxDiffInCategoryAbs
+ }
+ const order = { regression: 0, improvement: 1, neutral: 2 }
+ return order[a.category] - order[b.category]
+})
+
+const experimentSummaries = experimentsWithMaxDiff.map(({ result }) => {
+ const scoresList = Object.entries(result.scores || {})
+ .map(([key, value]) => {
+ const score = typeof value.score === 'number' ? `${(value.score * 100).toFixed(2)}%` : value.score
+ let baselineComparison = null
+ const diffHighlight = Math.abs(value.diff) > DIFF_THRESHOLD ? '**' : ''
+ let diffEmoji = '🆕'
+ if (result.comparison_experiment_name?.startsWith('master-')) {
+ baselineComparison = `${diffHighlight}${value.diff > 0 ? '+' : value.diff < 0 ? '' : '±'}${(
+ value.diff * 100
+ ).toFixed(2)}%${diffHighlight} (improvements: ${value.improvements}, regressions: ${value.regressions})`
+ diffEmoji = value.diff > DIFF_THRESHOLD ? '🟢' : value.diff < -DIFF_THRESHOLD ? '🔴' : '🔵'
+ }
+ return `${diffEmoji} **${key}**: **${score}**${baselineComparison ? `, ${baselineComparison}` : ''}`
+ })
+ .join('\n')
+
+ const metrics = result.metrics || {}
+ const duration = metrics.duration ? `⏱️ ${metrics.duration.metric.toFixed(2)} s` : null
+ const totalTokens = metrics.total_tokens ? `🔢 ${Math.floor(metrics.total_tokens.metric)} tokens` : null
+ const cost = metrics.estimated_cost ? `💵 $${metrics.estimated_cost.metric.toFixed(4)} in tokens` : null
+ const metricsText = [duration, totalTokens, cost].filter(Boolean).join(', ')
+ const baselineLink = `[${result.comparison_experiment_name}](${result.project_url}/experiments/${result.comparison_experiment_name})`
+
+ const experimentName = result.project_name.replace(/^max-ai-/, '')
+
+ return [
+ `### [${experimentName}](${result.experiment_url})`,
+ scoresList,
+ `Baseline: ${baselineLink} • Avg. case performance: ${metricsText}`,
+ ].join('\n\n')
+})
+
+const regressions = []
+const improvements = []
+const neutral = []
+experimentsWithMaxDiff.forEach(({ category }, idx) => {
+ if (category === 'regression') {
+ regressions.push(experimentSummaries[idx])
+ } else if (category === 'improvement') {
+ improvements.push(experimentSummaries[idx])
+ } else {
+ neutral.push(experimentSummaries[idx])
+ }
+})
+
+const totalExperiments = evalResults.length
+const totalMetrics = evalResults.reduce((acc, result) => acc + Object.keys(result.scores || {}).length, 0)
+
+const bodyParts = [
+ `Evaluated **${totalExperiments}** experiments, comprising **${totalMetrics}** metrics. Showing experiments with largest regressions first.`,
+]
+
+bodyParts.push(...regressions)
+bodyParts.push(...improvements)
+if (neutral.length > 0) {
+ bodyParts.push(
+ `<details><summary>${neutral.length} ${neutral.length === 1 ? 'experiment' : 'experiments'} with no significant changes</summary>\n\n${neutral.join('\n\n')}\n\n</details>`
+ )
+}
+
+const body = bodyParts.join('\n\n')
+
+const status = regressions.length > 0 ? 'warn' : 'ok'
+const parts = []
+if (regressions.length > 0) {
+ parts.push(`${regressions.length} regression${regressions.length === 1 ? '' : 's'}`)
+}
+if (improvements.length > 0) {
+ parts.push(`${improvements.length} improvement${improvements.length === 1 ? '' : 's'}`)
+}
+const summary = `${totalExperiments} experiment${totalExperiments === 1 ? '' : 's'}${parts.length ? `: ${parts.join(', ')}` : ''}`
+
+await postSection({
+ id: 'ai-evals',
+ status,
+ summary,
+ body,
+})
diff --git a/.github/scripts/post-eval-summary.js b/.github/scripts/post-eval-summary.js
deleted file mode 100644
index 53000acedce3..000000000000
--- a/.github/scripts/post-eval-summary.js
+++ /dev/null
@@ -1,133 +0,0 @@
-// Export for use with actions/github-script
-
-const DIFF_THRESHOLD = 0.02
-
-module.exports = ({ github, context, fs }) => {
- // Read the eval results
- const evalResults = fs
- .readFileSync('eval_results.jsonl', 'utf8')
- .trim()
- .split('\n')
- .filter((line) => line.trim().length > 0)
- .map((line) => JSON.parse(line))
-
- if (evalResults.length === 0) {
- console.warn('No eval results found')
- return
- }
-
- // Calculate max diff for each experiment and categorize
- const experimentsWithMaxDiff = evalResults.map((result) => {
- const scores = result.scores || {}
- const diffs = Object.values(scores)
- .map((v) => v.diff)
- .filter((d) => typeof d === 'number')
- const minDiff = diffs.length > 0 ? Math.min(...diffs) : 0
- const maxDiff = diffs.length > 0 ? Math.max(...diffs) : 0
- const category = minDiff < -DIFF_THRESHOLD ? 'regression' : maxDiff > DIFF_THRESHOLD ? 'improvement' : 'neutral'
-
- return {
- result,
- category,
- maxDiffInCategoryAbs:
- category === 'regression'
- ? -minDiff
- : category === 'improvement'
- ? maxDiff
- : Math.max(Math.abs(minDiff), Math.abs(maxDiff)),
- }
- })
-
- // Sort: regressions first (most negative to least), then improvements (most positive to least), then neutral
- experimentsWithMaxDiff.sort((a, b) => {
- if (a.category === b.category) {
- return b.maxDiffInCategoryAbs - a.maxDiffInCategoryAbs
- }
- const order = { regression: 0, improvement: 1, neutral: 2 }
- return order[a.category] - order[b.category]
- })
-
- // Generate experiment summaries
- const experimentSummaries = experimentsWithMaxDiff.map(({ result }) => {
- // Format scores as bullet points with improvements/regressions and baseline comparison
- const scoresList = Object.entries(result.scores || {})
- .map(([key, value]) => {
- const score = typeof value.score === 'number' ? `${(value.score * 100).toFixed(2)}%` : value.score
- let baselineComparison = null
- const diffHighlight = Math.abs(value.diff) > DIFF_THRESHOLD ? '**' : ''
- let diffEmoji = '🆕'
- if (result.comparison_experiment_name?.startsWith('master-')) {
- baselineComparison = `${diffHighlight}${value.diff > 0 ? '+' : value.diff < 0 ? '' : '±'}${(
- value.diff * 100
- ).toFixed(
- 2
- )}%${diffHighlight} (improvements: ${value.improvements}, regressions: ${value.regressions})`
- diffEmoji = value.diff > DIFF_THRESHOLD ? '🟢' : value.diff < -DIFF_THRESHOLD ? '🔴' : '🔵'
- }
- return `${diffEmoji} **${key}**: **${score}**${baselineComparison ? `, ${baselineComparison}` : ''}`
- })
- .join('\n')
-
- // Format key metrics concisely
- const metrics = result.metrics || {}
- const duration = metrics.duration ? `⏱️ ${metrics.duration.metric.toFixed(2)} s` : null
- const totalTokens = metrics.total_tokens ? `🔢 ${Math.floor(metrics.total_tokens.metric)} tokens` : null
- const cost = metrics.estimated_cost ? `💵 $${metrics.estimated_cost.metric.toFixed(4)} in tokens` : null
- const metricsText = [duration, totalTokens, cost].filter(Boolean).join(', ')
- const baselineLink = `[${result.comparison_experiment_name}](${result.project_url}/experiments/${result.comparison_experiment_name})`
-
- // Create concise experiment summary with header only showing experiment name
- const experimentName = result.project_name.replace(/^max-ai-/, '')
-
- return [
- `### [${experimentName}](${result.experiment_url})`,
- scoresList,
- `Baseline: ${baselineLink} • Avg. case performance: ${metricsText}`,
- ].join('\n\n')
- })
-
- // Split summaries by category
- const regressions = []
- const improvements = []
- const neutral = []
- experimentsWithMaxDiff.forEach(({ category }, idx) => {
- if (category === 'regression') regressions.push(experimentSummaries[idx])
- else if (category === 'improvement') improvements.push(experimentSummaries[idx])
- else neutral.push(experimentSummaries[idx])
- })
-
- const totalExperiments = evalResults.length
- const totalMetrics = evalResults.reduce((acc, result) => acc + Object.keys(result.scores || {}).length, 0)
-
- const bodyParts = [
- `## 🧠 AI eval results`,
- `Evaluated **${totalExperiments}** experiments, comprising **${totalMetrics}** metrics. Showing experiments with largest regressions first.`,
- ]
-
- bodyParts.push(...regressions)
- bodyParts.push(...improvements)
- if (neutral.length > 0) {
- bodyParts.push(
- `<details><summary>${neutral.length} ${neutral.length === 1 ? 'experiment' : 'experiments'} with no significant changes</summary>\n\n${neutral.join('\n\n')}\n\n</details>`
- )
- }
-
- bodyParts.push(
- `_Triggered by [this commit](https://github.com/${context.repo.owner}/${context.repo.repo}/pull/${context.payload.pull_request.number}/commits/${context.payload.pull_request.head.sha})._`
- )
-
- const body = bodyParts.join('\n\n')
-
- // Post comment on PR
- if (context.payload.pull_request) {
- github.rest.issues.createComment({
- issue_number: context.issue.number,
- owner: context.repo.owner,
- repo: context.repo.repo,
- body: body,
- })
- } else {
- // Just log the summary if this is a push to master
- console.info(body)
- }
-}
diff --git a/.github/scripts/post-playwright-section.mjs b/.github/scripts/post-playwright-section.mjs
new file mode 100644
index 000000000000..4d7384d93484
--- /dev/null
+++ b/.github/scripts/post-playwright-section.mjs
@@ -0,0 +1,88 @@
+#!/usr/bin/env node
+import fs from 'node:fs'
+
+import { postSection } from '../../frontend/bin/ci-report/update-ci-report.mjs'
+
+const reportUrl = process.env.DEPLOYMENT_URL
+
+let failed = []
+let flaky = []
+let resultsRead = false
+try {
+ const results = JSON.parse(fs.readFileSync('playwright/results.json', 'utf8'))
+ resultsRead = true
+ const collect = (suites) => {
+ for (const suite of suites || []) {
+ for (const spec of suite.specs || []) {
+ for (const test of spec.tests || []) {
+ if (test.status === 'unexpected') {
+ failed.push(`- ${spec.title} (${test.projectName})`)
+ } else if (test.status === 'flaky') {
+ flaky.push(`- ${spec.title} (${test.projectName})`)
+ }
+ }
+ }
+ collect(suite.suites)
+ }
+ }
+ collect(results.suites)
+} catch {
+ // results.json is absent on setup failure/cancellation — handled below.
+}
+
+let flakeVerificationLines = ''
+try {
+ const flakeResults = JSON.parse(fs.readFileSync('playwright/flake-verification-results.json', 'utf8'))
+ if (flakeResults.status === 'failed') {
+ const fileList = flakeResults.files.map((f) => `- \`${f}\``).join('\n')
+ const flakeReportLink = reportUrl ? ` [View report →](${reportUrl})` : ''
+ flakeVerificationLines = `\n\n🔁 **Flake verification failed** (--repeat-each=${flakeResults.repeat_count}):\n${fileList}\n\nThe report only shows the tests under verification.${flakeReportLink} Fix these before merging.`
+ }
+} catch {
+ // No flake-verification-results.json — nothing to add.
+}
+
+// No results and no flake-verification verdict means the run never got as far as
+// testing (setup failure, cancellation) — leave the existing section untouched
+// rather than overwrite a previous run's real failures with "all passed".
+if (!resultsRead && !flakeVerificationLines) {
+ console.info('No Playwright results found — leaving the existing section untouched.')
+ process.exit(0)
+}
+
+const reportLink = reportUrl ? ` · [View test results →](${reportUrl})` : ''
+const footer =
+ '\n\n\n*These issues are not necessarily caused by your changes.*\n*Annoyed by this section? Help fix flakies and failures and it will go green!*'
+
+let bodyLines = ''
+if (failed.length > 0) {
+ bodyLines += `\n\n❌ **${failed.length} failed test${failed.length > 1 ? 's' : ''}:**\n${failed.join('\n')}`
+}
+if (flaky.length > 0) {
+ bodyLines += `\n\n⚠️ **${flaky.length} flaky test${flaky.length > 1 ? 's' : ''}:**\n${flaky.join('\n')}`
+}
+bodyLines += flakeVerificationLines
+
+const hasProblems = bodyLines.length > 0
+const body = hasProblems
+ ? `🎭 Playwright report${reportLink}${bodyLines}${footer}`
+ : `All tests passed.${reportLink ? `\n\n[View test results →](${reportUrl})` : ''}`
+
+const summaryParts = []
+if (failed.length > 0) {
+ summaryParts.push(`${failed.length} failed`)
+}
+if (flaky.length > 0) {
+ summaryParts.push(`${flaky.length} flaky`)
+}
+if (flakeVerificationLines) {
+ summaryParts.push('flake verification failed')
+}
+const summary = summaryParts.length ? summaryParts.join(', ') : 'all passed'
+
+await postSection({
+ id: 'playwright',
+ status: hasProblems ? 'warn' : 'ok',
+ summary,
+ body,
+})
diff --git a/.github/scripts/post-reminder-section.mjs b/.github/scripts/post-reminder-section.mjs
new file mode 100644
index 000000000000..c18bb47a70c2
--- /dev/null
+++ b/.github/scripts/post-reminder-section.mjs
@@ -0,0 +1,30 @@
+#!/usr/bin/env node
+// Generic one-shot reminder poster. Usage:
+// BODY="<markdown>" node post-reminder-section.mjs <section-id> <status> [<summary>]
+// node post-reminder-section.mjs <section-id> --clear [<summary>]
+// The section id must be registered in SECTIONS in update-ci-report.mjs.
+//
+import { clearSectionIfPresent, postSection } from '../../frontend/bin/ci-report/update-ci-report.mjs'
+
+const [id, status, summary] = process.argv.slice(2)
+if (!id || !status) {
+ console.error('Usage: BODY="<markdown>" node post-reminder-section.mjs <id> <status|--clear> [<summary>]')
+ process.exit(1)
+}
+
+if (status === '--clear') {
+ await clearSectionIfPresent({
+ id,
+ summary: summary ?? 'resolved',
+ body: process.env.BODY || 'Resolved in the latest push.',
+ })
+ process.exit(0)
+}
+
+const body = process.env.BODY
+if (!body) {
+ console.error('BODY env var is required')
+ process.exit(1)
+}
+
+await postSection({ id, status, summary: summary ?? '', body })
diff --git a/.github/scripts/post-snapshot-comment.js b/.github/scripts/post-snapshot-comment.js
deleted file mode 100755
index 3da8bb256dce..000000000000
--- a/.github/scripts/post-snapshot-comment.js
+++ /dev/null
@@ -1,94 +0,0 @@
-#!/usr/bin/env node
-
-const { execSync } = require('child_process')
-
-// Parse command-line arguments
-const [workflowType, mode, changesJson, prNumber, repo, commitSha, snapshotSha] = process.argv.slice(2)
-
-if (process.argv.length !== 8 && process.argv.length !== 9) {
- console.error(
- 'Usage: post-snapshot-comment.js <workflow_type> <mode> <changes_json> <pr_number> <repo> <commit_sha> [snapshot_sha]'
- )
- process.exit(1)
-}
-
-// Parse changes JSON
-const changes = JSON.parse(changesJson)
-const { total, added, modified, deleted } = changes
-
-// Set workflow-specific labels
-const config =
- workflowType === 'storybook'
- ? {
- label: 'Storybook',
- type: 'UI snapshots',
- filesFilter: 'frontend/__snapshots__/',
- localCmd: '`pnpm storybook`',
- }
- : workflowType === 'backend'
- ? {
- label: 'Backend',
- type: 'query snapshots',
- filesFilter: '**/*.ambr',
- localCmd: '`pytest <test_file> --snapshot-update`',
- }
- : {
- label: 'Playwright E2E',
- type: 'E2E screenshots',
- filesFilter: 'playwright/',
- localCmd: '`pnpm --filter=@posthog/playwright exec playwright test --ui`',
- }
-
-// UPDATE mode: snapshots were updated
-if (mode !== 'update') {
- console.error(`Error: Unknown mode: ${mode}`)
- process.exit(1)
-}
-
-if (total === 0) {
- console.error('No snapshot changes, skipping comment')
- process.exit(0)
-}
-
-const headerPrefix = workflowType === 'backend' ? 'Query snapshots' : 'Visual regression'
-
-const whatThisMeans =
- workflowType === 'backend'
- ? `- Query snapshots have been automatically updated to match current output
-- These changes reflect modifications to database queries or schema`
- : `- Snapshots have been automatically updated to match current rendering
-- Next CI run will switch to CHECK mode to verify stability
-- If snapshots change again, CHECK mode will fail (indicates flapping)`
-
-const nextSteps =
- workflowType === 'backend'
- ? `- Review the query changes to ensure they're intentional
-- If unexpected, investigate what caused the query to change`
- : `- Review the changes to ensure they're intentional
-- Approve if changes match your expectations
-- If unexpected, investigate component rendering`
-
-const comment = `### ${headerPrefix}: ${config.label} ${config.type} updated
-
-**Changes:** ${total} snapshots (${modified} modified, ${added} added, ${deleted} deleted)
-
-**What this means:**
-${whatThisMeans}
-
-**Next steps:**
-${nextSteps}
-
-[Review snapshot changes →](https://github.com/${repo}/commit/${snapshotSha || commitSha})`
-
-// Post comment using gh CLI
-try {
- execSync(`gh pr comment ${prNumber} --repo ${repo} --body-file -`, {
- input: comment,
- encoding: 'utf-8',
- stdio: ['pipe', 'inherit', 'inherit'],
- })
- console.error(`Posted comment to PR #${prNumber}`)
-} catch (error) {
- console.error(`Failed to post comment: ${error.message}`)
- process.exit(1)
-}
diff --git a/.github/scripts/post-snapshot-section.mjs b/.github/scripts/post-snapshot-section.mjs
new file mode 100644
index 000000000000..cc57d9934a9f
--- /dev/null
+++ b/.github/scripts/post-snapshot-section.mjs
@@ -0,0 +1,100 @@
+#!/usr/bin/env node
+import { postSection } from '../../frontend/bin/ci-report/update-ci-report.mjs'
+
+const [workflowType, mode, changesJson, repo, commitSha, snapshotSha] = process.argv.slice(2)
+
+if (process.argv.length !== 7 && process.argv.length !== 8) {
+ console.error(
+ 'Usage: post-snapshot-section.mjs <workflow_type> <mode> <changes_json> <repo> <commit_sha> [snapshot_sha]'
+ )
+ process.exit(0)
+}
+
+if (mode !== 'update') {
+ console.error(`Unknown mode: ${mode} — skipping snapshot section.`)
+ process.exit(0)
+}
+
+const changes = JSON.parse(changesJson)
+const { total, added, modified, deleted } = changes
+
+if (total === 0) {
+ console.info('No snapshot changes — nothing to post.')
+ process.exit(0)
+}
+
+const CONFIGS = {
+ storybook: {
+ id: 'storybook-snapshots',
+ label: 'Storybook',
+ type: 'UI snapshots',
+ headerPrefix: 'Visual regression',
+ whatThisMeans: `- Snapshots have been automatically updated to match current rendering
+- Next CI run will switch to CHECK mode to verify stability
+- If snapshots change again, CHECK mode will fail (indicates flapping)`,
+ nextSteps: `- Review the changes to ensure they're intentional
+- Approve if changes match your expectations
+- If unexpected, investigate component rendering`,
+ },
+ backend: {
+ id: 'backend-snapshots',
+ label: 'Backend',
+ type: 'query snapshots',
+ headerPrefix: 'Query snapshots',
+ whatThisMeans: `- Query snapshots have been automatically updated to match current output
+- These changes reflect modifications to database queries or schema`,
+ nextSteps: `- Review the query changes to ensure they're intentional
+- If unexpected, investigate what caused the query to change`,
+ },
+ // MCP unit-test snapshots need their own section: ci-mcp and ci-backend can both
+ // update snapshots on one PR, and a shared id would let the later writer clobber
+ // the earlier one's review link.
+ mcp: {
+ id: 'mcp-snapshots',
+ label: 'MCP',
+ type: 'unit test snapshots',
+ headerPrefix: 'Snapshots',
+ whatThisMeans: `- Snapshots have been automatically updated to match current output`,
+ nextSteps: `- Review the changes to ensure they're intentional
+- If unexpected, investigate what caused the output to change`,
+ },
+ playwright: {
+ id: 'playwright-snapshots',
+ label: 'Playwright E2E',
+ type: 'E2E screenshots',
+ headerPrefix: 'Visual regression',
+ whatThisMeans: `- Snapshots have been automatically updated to match current rendering
+- Next CI run will switch to CHECK mode to verify stability
+- If snapshots change again, CHECK mode will fail (indicates flapping)`,
+ nextSteps: `- Review the changes to ensure they're intentional
+- Approve if changes match your expectations
+- If unexpected, investigate component rendering`,
+ },
+}
+
+const config = CONFIGS[workflowType]
+if (!config) {
+ console.error(`Unknown workflow type: ${workflowType} — skipping snapshot section.`)
+ process.exit(0)
+}
+
+const body = `### ${config.headerPrefix}: ${config.label} ${config.type} updated
+
+**Changes:** ${total} snapshots (${modified} modified, ${added} added, ${deleted} deleted)
+
+**What this means:**
+${config.whatThisMeans}
+
+**Next steps:**
+${config.nextSteps}
+
+[Review snapshot changes →](https://github.com/${repo}/commit/${snapshotSha || commitSha})`
+
+const summary = `${total} updated (${modified} modified, ${added} added, ${deleted} deleted)`
+
+await postSection({
+ id: config.id,
+ status: 'warn',
+ summary,
+ body,
+})
diff --git a/.github/workflows/build-hogql-parser-npm.yml b/.github/workflows/build-hogql-parser-npm.yml
index 2d49a487a144..944391e2dd7d 100644
--- a/.github/workflows/build-hogql-parser-npm.yml
+++ b/.github/workflows/build-hogql-parser-npm.yml
@@ -56,12 +56,21 @@ jobs:
if [[ "$IS_FORK" == 'true' ]]; then
message_body+=$'\n'"This needs to be performed on a branch created on the PostHog/posthog repo itself. A PostHog team member will assist with this."
fi
- # Post once, then edit in place on subsequent pushes
- existing=$(gh api "repos/${{ github.repository }}/issues/$PR_NUMBER/comments" --jq '.[] | select(.user.login == "github-actions[bot]") | select(.body | test("hogql-parser.*npm.*version stayed the same")) | .id' | tail -1)
- if [[ -n "$existing" ]]; then
- gh api "repos/${{ github.repository }}/issues/comments/$existing" -X PATCH -f body="$message_body"
+ if [ -f .github/scripts/post-reminder-section.mjs ]; then
+ BODY="$message_body" GITHUB_TOKEN="$GH_TOKEN" node .github/scripts/post-reminder-section.mjs hogql-parser-npm warn "version bump needed"
else
- gh pr comment "$PR_NUMBER" --body "$message_body"
+ echo "Skipping hogql-parser-npm section — script not present on this checkout"
+ fi
+
+ # Version was bumped — mark any reminder from an earlier push resolved.
+ - name: Clear version reminder
+ if: steps.changed-files.outputs.parser_any_changed == 'true' && steps.check-package-version.outputs.is-new-version == 'true'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ NEW_VERSION: ${{ steps.check-package-version.outputs.committed-version }}
+ run: |
+ if [ -f .github/scripts/post-reminder-section.mjs ]; then
+ node .github/scripts/post-reminder-section.mjs hogql-parser-npm --clear "version bumped to $NEW_VERSION"
fi
build-wasm:
diff --git a/.github/workflows/build-hogql-parser-rs.yml b/.github/workflows/build-hogql-parser-rs.yml
index 4019f34b3483..45e4bee40b74 100644
--- a/.github/workflows/build-hogql-parser-rs.yml
+++ b/.github/workflows/build-hogql-parser-rs.yml
@@ -57,17 +57,20 @@ jobs:
http_code=$(curl -o /dev/null -sSL -w '%{http_code}' "https://pypi.org/pypi/hogql-parser-rs/$local/json")
if [[ "$http_code" == '404' ]]; then
parser_release_needed='true'
+ # Version was bumped — mark any reminder from an earlier push resolved.
+ if [ -f .github/scripts/post-reminder-section.mjs ]; then
+ GITHUB_TOKEN="$GH_TOKEN" node .github/scripts/post-reminder-section.mjs hogql-parser-rs --clear "version bumped to $local"
+ fi
elif [[ "$http_code" == '200' ]]; then
message_body="It looks like the code of \`hogql-parser-rs\` changed in this PR, but its version stayed the same at $local. 👀"
message_body+=$'\n'"Bump the version in \`rust/hogql/parser/Cargo.toml\` AND \`rust/hogql/parser/pyproject.toml\` (the two must match) before merging."
if [[ "$IS_FORK" == 'true' ]]; then
message_body+=$'\n'"This needs to be performed on a branch created on the PostHog/posthog repo itself. A PostHog team member can assist with this."
fi
- existing=$(gh api "repos/${{ github.repository }}/issues/$PR_NUMBER/comments" --jq '.[] | select(.user.login == "github-actions[bot]") | select(.body | test("hogql-parser-rs.*version stayed the same.*👀")) | .id' | tail -1)
- if [[ -n "$existing" ]]; then
- gh api "repos/${{ github.repository }}/issues/comments/$existing" -X PATCH -f body="$message_body"
+ if [ -f .github/scripts/post-reminder-section.mjs ]; then
+ BODY="$message_body" GITHUB_TOKEN="$GH_TOKEN" node .github/scripts/post-reminder-section.mjs hogql-parser-rs warn "version bump needed"
else
- gh pr comment "$PR_NUMBER" --body "$message_body"
+ echo "Skipping hogql-parser-rs section — script not present on this checkout"
fi
else
echo "::warning::Unexpected HTTP $http_code from PyPI for hogql-parser-rs $local; assuming not yet published."
diff --git a/.github/workflows/build-hogql-parser.yml b/.github/workflows/build-hogql-parser.yml
index 647a7cac0663..ce23b1342991 100644
--- a/.github/workflows/build-hogql-parser.yml
+++ b/.github/workflows/build-hogql-parser.yml
@@ -55,18 +55,20 @@ jobs:
http_code=$(curl -o /dev/null -sSL -w '%{http_code}' "https://pypi.org/pypi/hogql-parser/$local/json")
if [[ "$http_code" == '404' ]]; then
parser_release_needed='true'
+ # Version was bumped — mark any reminder from an earlier push resolved.
+ if [ -f .github/scripts/post-reminder-section.mjs ]; then
+ GITHUB_TOKEN="$GH_TOKEN" node .github/scripts/post-reminder-section.mjs hogql-parser-py --clear "version bumped to $local"
+ fi
elif [[ "$http_code" == '200' ]]; then
message_body="It looks like the code of \`hogql-parser\` changed in this PR, but its version stayed the same at $local. 👀"
message_body+=$'\n'"Make sure to resolve this in \`common/hogql_parser/setup.py\` before merging!"
if [[ "$IS_FORK" == 'true' ]]; then
message_body+=$'\n'"This needs to be performed on a branch created on the PostHog/posthog repo itself. A PostHog team member can assist with this."
fi
- # Post once, then edit in place on subsequent pushes
- existing=$(gh api "repos/${{ github.repository }}/issues/$PR_NUMBER/comments" --jq '.[] | select(.user.login == "github-actions[bot]") | select(.body | test("hogql-parser.*version stayed the same.*👀")) | .id' | tail -1)
- if [[ -n "$existing" ]]; then
- gh api "repos/${{ github.repository }}/issues/comments/$existing" -X PATCH -f body="$message_body"
+ if [ -f .github/scripts/post-reminder-section.mjs ]; then
+ BODY="$message_body" GITHUB_TOKEN="$GH_TOKEN" node .github/scripts/post-reminder-section.mjs hogql-parser-py warn "version bump needed"
else
- gh pr comment "$PR_NUMBER" --body "$message_body"
+ echo "Skipping hogql-parser-py section — script not present on this checkout"
fi
else
echo "::warning::Unexpected HTTP $http_code from PyPI for hogql-parser $local; assuming not yet published."
diff --git a/.github/workflows/ci-ai.yml b/.github/workflows/ci-ai.yml
index 90f2bac60799..e1b06bc511a1 100644
--- a/.github/workflows/ci-ai.yml
+++ b/.github/workflows/ci-ai.yml
@@ -157,7 +157,9 @@ jobs:
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
- sparse-checkout: .github/scripts
+ sparse-checkout: |
+ .github/scripts
+ frontend/bin/ci-report
- name: Download all eval results
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
@@ -176,15 +178,18 @@ jobs:
wc -l eval_results.jsonl
fi
- - name: Post eval summary to PR
+ - name: Post eval summary to CI report comment
# always() because we want to post even if some eval groups errored
if: always() && github.event_name == 'pull_request'
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
- with:
- script: |
- const fs = require("fs")
- const script = require('.github/scripts/post-eval-summary.js')
- script({ github, context, fs })
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ run: |
+ if [ -f .github/scripts/post-eval-section.mjs ]; then
+ node .github/scripts/post-eval-section.mjs
+ node frontend/bin/ci-report/delete-legacy-comments.mjs
+ else
+ echo "Skipping eval section — script not present on this checkout"
+ fi
- name: Upload merged test results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml
index 1fd2d59d0f17..71d3a81bf368 100644
--- a/.github/workflows/ci-backend.yml
+++ b/.github/workflows/ci-backend.yml
@@ -1618,6 +1618,7 @@ jobs:
exit 0
fi
echo "has_changes=true" >> "$GITHUB_OUTPUT"
+ echo "migration_count=$(echo "$CHANGED" | grep -c .)" >> "$GITHUB_OUTPUT"
{
echo '<!-- ch-migration-sql -->'
echo '## ClickHouse migration SQL per cloud environment'
@@ -1667,58 +1668,21 @@ jobs:
done
fi
- - name: Post CH migration SQL PR comment
- # Sticky comment: find the marker and update in place so pushes don't spam the PR.
+ - name: Post CH migration SQL to CI report comment
+ # Sticky section in the shared CI report comment so pushes don't spam the PR.
# GITHUB_TOKEN is read-only for fork PRs, so only comment on same-repo PRs.
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
env:
HAS_CHANGES: ${{ steps.render_ch_sql.outputs.has_changes }}
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const fs = require('fs');
- const marker = '<!-- ch-migration-sql -->';
- const hasChanges = process.env.HAS_CHANGES === 'true';
- const { data: comments } = await github.rest.issues.listComments({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- });
- const existing = comments.find((c) => c.body.includes(marker));
- if (!hasChanges) {
- // No migrations changed — clean up a stale sticky comment if one exists
- // (e.g. migrations were added then removed in a later push), otherwise no-op.
- if (existing) {
- await github.rest.issues.deleteComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: existing.id,
- });
- }
- return;
- }
- let body = fs.readFileSync('ch_migration_sql_comment.md', 'utf8');
- const LIMIT = 65000; // GitHub caps comment bodies at 65536 chars
- if (body.length > LIMIT) {
- const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
- body = body.slice(0, LIMIT - 400) + `\n\n_…truncated. See the full SQL in the [workflow logs](${runUrl})._`;
- }
- if (existing) {
- await github.rest.issues.updateComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: existing.id,
- body,
- });
- } else {
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- body,
- });
- }
+ CH_MIGRATION_COUNT: ${{ steps.render_ch_sql.outputs.migration_count }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ if [ -f .github/scripts/post-ch-migration-section.mjs ]; then
+ node .github/scripts/post-ch-migration-section.mjs
+ node frontend/bin/ci-report/delete-legacy-comments.mjs
+ else
+ echo "Skipping CH migration section — script not present on this checkout"
+ fi
check-openapi-types:
needs: [changes]
diff --git a/.github/workflows/ci-docs-check.yml b/.github/workflows/ci-docs-check.yml
index bc2d826495ba..019b6fa4373d 100644
--- a/.github/workflows/ci-docs-check.yml
+++ b/.github/workflows/ci-docs-check.yml
@@ -84,20 +84,12 @@ jobs:
- name: Post reminder comment
if: steps.docs-check.outputs.outdated == 'true'
env:
- GH_TOKEN: ${{ github.token }}
- PR_NUMBER: ${{ github.event.pull_request.number }}
+ GITHUB_TOKEN: ${{ github.token }}
SOURCE_FILE: ${{ inputs.source_file }}
BUILD_COMMAND: ${{ inputs.build_command }}
OUTPUT_FILE: ${{ inputs.output_file }}
run: |
- # Check if reminder comment already exists
- if gh pr view "$PR_NUMBER" --json comments \
- --jq '.comments[].body' | grep -q 'Generated Docs Update Required'; then
- echo "Comment already exists, skipping"
- exit 0
- fi
-
- gh pr comment "$PR_NUMBER" --body "### 📄 Generated Docs Update Required
+ message_body="### Generated docs update required
You updated \`${SOURCE_FILE}\` but the generated docs are out of date.
@@ -108,6 +100,25 @@ jobs:
Then commit the updated \`${OUTPUT_FILE}\` file."
+ # All callers of this reusable workflow share the one generated-docs section —
+ # if a second caller ever runs on the same PR, they will clobber and false-clear
+ # each other; give the section id an input (registered in SECTIONS) at that point.
+ if [ -f .github/scripts/post-reminder-section.mjs ]; then
+ BODY="$message_body" node .github/scripts/post-reminder-section.mjs generated-docs warn "regeneration needed"
+ else
+ echo "Skipping generated-docs section — script not present on this checkout"
+ fi
+
+ # Docs are current again — mark any reminder from an earlier push resolved.
+ - name: Clear docs reminder
+ if: steps.docs-check.outputs.outdated == 'false'
+ env:
+ GITHUB_TOKEN: ${{ github.token }}
+ run: |
+ if [ -f .github/scripts/post-reminder-section.mjs ]; then
+ node .github/scripts/post-reminder-section.mjs generated-docs --clear "docs regenerated"
+ fi
+
- name: Fail if docs outdated
if: steps.docs-check.outputs.outdated == 'true' && inputs.fail_on_outdated
env:
diff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.yml
index 29a4564f6034..62943423cc32 100644
--- a/.github/workflows/ci-e2e-playwright.yml
+++ b/.github/workflows/ci-e2e-playwright.yml
@@ -254,8 +254,8 @@ jobs:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
clean: false
# PR-controlled code runs in this job (pnpm installs, Playwright tests). Don't leave
- # GITHUB_TOKEN in .git/config where that code could read it — the comment step
- # below receives the token explicitly via its `github-token:` input instead.
+ # GITHUB_TOKEN in .git/config where that code could read it — the report step
+ # below receives the token explicitly via its GITHUB_TOKEN env instead.
persist-credentials: false
- name: Clean up data directories with container permissions
run: |
@@ -722,104 +722,19 @@ jobs:
echo "- Commit: \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "- Run: [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
- - name: Upsert report URL comment on PR
+ - name: Post Playwright section to CI report comment
if: always() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
continue-on-error: true
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
DEPLOYMENT_URL: ${{ steps.cf-deploy.outputs.deployment-url }}
- with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- script: |
- const fs = require('fs');
- const marker = '<!-- playwright-report-comment -->';
- const reportUrl = process.env.DEPLOYMENT_URL;
- const jobPassed = '${{ job.status }}' === 'success';
-
- // Collect failed and flaky tests from JSON report — only populated when
- // results.json exists (i.e. tests actually ran). If the file is missing
- // (setup failure, cancelled, etc.) extraLines stays empty and we treat
- // it the same as "no failures found", so we don't delete an existing
- // comment that may have relevant info from a previous run.
- let extraLines = '';
- let resultsRead = false;
- let failed = [];
- try {
- const results = JSON.parse(fs.readFileSync('playwright/results.json', 'utf8'));
- resultsRead = true;
- const flaky = [];
- function collect(suites) {
- for (const suite of suites || []) {
- for (const spec of suite.specs || []) {
- for (const test of spec.tests || []) {
- if (test.status === 'unexpected') {
- failed.push(`- ${spec.title} (${test.projectName})`);
- } else if (test.status === 'flaky') {
- flaky.push(`- ${spec.title} (${test.projectName})`);
- }
- }
- }
- collect(suite.suites);
- }
- }
- collect(results.suites);
- if (failed.length > 0) {
- extraLines += `\n\n❌ **${failed.length} failed test${failed.length > 1 ? 's' : ''}:**\n${failed.join('\n')}`;
- }
- if (flaky.length > 0) {
- extraLines += `\n\n⚠️ **${flaky.length} flaky test${flaky.length > 1 ? 's' : ''}:**\n${flaky.join('\n')}`;
- }
- } catch {}
-
- // Flake verification results for changed test files
- try {
- const flakeResults = JSON.parse(fs.readFileSync('playwright/flake-verification-results.json', 'utf8'));
- if (flakeResults.status === 'failed') {
- const fileList = flakeResults.files.map(f => `- \`${f}\``).join('\n');
- const flakeReportLink = reportUrl ? ` [View report →](${reportUrl})` : '';
- extraLines += `\n\n🔁 **Flake verification failed** (--repeat-each=${flakeResults.repeat_count}):\n${fileList}\n\nThe report only shows the tests under verification.${flakeReportLink} Fix these before merging.`;
- }
- } catch {}
-
- const { data: comments } = await github.rest.issues.listComments({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- });
- const existing = comments.find(c => c.body.includes(marker));
-
- // No failures or flakies — nothing to comment about
- if (!extraLines) {
- // Clean up any existing comment, but only when we know tests actually ran and passed
- if (resultsRead && existing) {
- await github.rest.issues.deleteComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: existing.id,
- });
- }
- return;
- }
-
- const reportLink = reportUrl ? ` · [View test results →](${reportUrl})` : '';
- const footer = '\n\n\n*These issues are not necessarily caused by your changes.*\n*Annoyed by this comment? Help fix flakies and failures and it\'ll disappear!*';
- const body = `${marker}\n🎭 Playwright report${reportLink}${extraLines}${footer}`;
-
- if (existing) {
- await github.rest.issues.updateComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- comment_id: existing.id,
- body,
- });
- } else {
- await github.rest.issues.createComment({
- owner: context.repo.owner,
- repo: context.repo.repo,
- issue_number: context.issue.number,
- body,
- });
- }
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ if [ -f .github/scripts/post-playwright-section.mjs ]; then
+ node .github/scripts/post-playwright-section.mjs
+ node frontend/bin/ci-report/delete-legacy-comments.mjs
+ else
+ echo "Skipping Playwright section — script not present on this checkout"
+ fi
capture-run-time:
name: Capture run time
diff --git a/.github/workflows/ci-mcp.yml b/.github/workflows/ci-mcp.yml
index 8533ad5a1092..4673ccc555cb 100644
--- a/.github/workflows/ci-mcp.yml
+++ b/.github/workflows/ci-mcp.yml
@@ -630,7 +630,7 @@ jobs:
if: steps.check-patches.outputs.has-patches == 'true'
uses: ./.github/actions/commit-snapshots
with:
- workflow-type: backend
+ workflow-type: mcp
patch-path: /tmp/snapshot-patches
snapshot-path: 'services/mcp/tests/unit/'
commit-message: 'test(mcp): update unit test snapshots'
diff --git a/.github/workflows/ci-survey-sdk-check.yml b/.github/workflows/ci-survey-sdk-check.yml
index f4a89f47488d..ffe4a6028ad6 100644
--- a/.github/workflows/ci-survey-sdk-check.yml
+++ b/.github/workflows/ci-survey-sdk-check.yml
@@ -34,26 +34,33 @@ jobs:
echo "found=true" >> $GITHUB_OUTPUT
fi
+ - name: Checkout for CI report poster
+ if: steps.sdk-check.outputs.found == 'true'
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ sparse-checkout: |
+ .github/scripts
+ frontend/bin/ci-report
+
- name: Post reminder comment
if: steps.sdk-check.outputs.found == 'true'
env:
- GH_TOKEN: ${{ github.token }}
+ GITHUB_TOKEN: ${{ github.token }}
run: |
- # Check if reminder comment already exists
- if gh pr view ${{ github.event.pull_request.number }} --json comments \
- --jq '.comments[].body' | grep -q 'SDK Version Check Reminder'; then
- echo "Comment already exists, skipping"
- exit 0
- fi
-
- gh pr comment ${{ github.event.pull_request.number }} --body '### 📦 Surveys SDK Version Check Reminder
+ message_body='### Surveys SDK version check reminder
This PR modifies survey code and may include SDK-dependent features.
**If adding a feature that requires a minimum SDK version**, please update:
`frontend/src/scenes/surveys/surveyVersionRequirements.ts`
- This ensures users see warnings when launching surveys their SDK doesn'\''t support.'
+ This ensures users see warnings when launching surveys their SDK does not support.'
+
+ if [ -f .github/scripts/post-reminder-section.mjs ]; then
+ BODY="$message_body" node .github/scripts/post-reminder-section.mjs survey-sdk info "check SDK version requirements"
+ else
+ echo "Skipping survey-sdk section — script not present on this checkout"
+ fi
check-docs-generated:
name: Check SDK docs are up to date
diff --git a/frontend/bin/ci-report/delete-legacy-comments.mjs b/frontend/bin/ci-report/delete-legacy-comments.mjs
index 676fb9376b75..a17c2bcaf233 100644
--- a/frontend/bin/ci-report/delete-legacy-comments.mjs
+++ b/frontend/bin/ci-report/delete-legacy-comments.mjs
@@ -4,11 +4,18 @@ import { gh, listPrComments, resolvePrContext } from './update-ci-report.mjs'
// The CI checks used to each post their own PR comment. They now share one
// ci-report comment, so delete any leftover standalone comments once, on the first
// consolidated run, to stop a PR from showing both. Transitional — safe to remove
-// after all open PRs have re-run.
+// after all open PRs have re-run. Matching is bot-author + body prefix, so the
+// unmarked comments are identified by the fixed text they always started with.
const LEGACY_MARKERS = [
'<!-- posthog-eager-graph-check -->',
'<!-- posthog-bundle-size-check -->',
'<!-- mcp-ui-apps-size-report -->',
+ '<!-- playwright-report-comment -->',
+ '<!-- ch-migration-sql -->',
+ '## 🧠 AI eval results',
+ 'It looks like the code of ',
+ '### 📄 Generated Docs Update Required',
+ '### 📦 Surveys SDK Version Check Reminder',
]
const context = resolvePrContext('cleanup')
diff --git a/frontend/bin/ci-report/update-ci-report.mjs b/frontend/bin/ci-report/update-ci-report.mjs
index 03a820a4160c..0c629adef0fd 100644
--- a/frontend/bin/ci-report/update-ci-report.mjs
+++ b/frontend/bin/ci-report/update-ci-report.mjs
@@ -18,6 +18,18 @@ export const SECTIONS = [
{ id: 'eager-graph', title: 'Eager graph' },
{ id: 'dist-size', title: 'Dist folder size' },
{ id: 'mcp-ui-apps', title: 'MCP UI apps size' },
+ { id: 'playwright', title: 'Playwright' },
+ { id: 'storybook-snapshots', title: 'Storybook snapshots' },
+ { id: 'playwright-snapshots', title: 'Playwright snapshots' },
+ { id: 'backend-snapshots', title: 'Backend snapshots' },
+ { id: 'mcp-snapshots', title: 'MCP snapshots' },
+ { id: 'ai-evals', title: 'AI evals' },
+ { id: 'ch-migration-sql', title: 'ClickHouse migration SQL' },
+ { id: 'hogql-parser-py', title: 'hogql-parser version' },
+ { id: 'hogql-parser-npm', title: '@posthog/hogql-parser version' },
+ { id: 'hogql-parser-rs', title: 'hogql-parser-rs version' },
+ { id: 'generated-docs', title: 'Generated docs' },
+ { id: 'survey-sdk', title: 'Survey SDK reminder' },
]
export const STATUS_EMOJI = { ok: '✅', warn: '⚠️', fail: '❌', info: 'ℹ️' }
@@ -184,7 +196,7 @@ function sectionEquals(a, b) {
// comments we do not own. The login is the identity behind the `github.token` the
// posting workflow steps pass — moving them to a custom app token changes the login and
// would orphan every existing report comment, so handle that transition here too.
-function isReportComment(comment) {
+export function isReportComment(comment) {
return comment.user?.login === 'github-actions[bot]' && comment.body?.startsWith(MARKER)
}
@@ -196,6 +208,28 @@ function isWriteConflict(err) {
return err.status === 404
}
+// Mark a section resolved (status ok), but only when the report already carries it —
+// a check whose condition passes on every PR must not add a section saying so, while
+// a warning that was real on one push must not linger after a later push fixes it.
+export async function clearSectionIfPresent({ id, summary, body }) {
+ const context = resolvePrContext(`clearing "${id}"`)
+ if (!context) {
+ return
+ }
+ let reportComment
+ try {
+ reportComment = (await listPrComments(context)).find(isReportComment)
+ } catch (err) {
+ console.warn(`Could not read PR comments: ${err.message}`)
+ return
+ }
+ if (!reportComment || !parseSections(reportComment.body).has(id)) {
+ console.info(`No existing "${id}" section — nothing to clear.`)
+ return
+ }
+ await postSection({ id, status: 'ok', summary, body })
+}
+
// Post or update this run's section into the shared comment. Fork PRs run with a
// read-only token, so a failure to read or write is warned and swallowed — the comment
// is a nicety, never worth a red job.
diff --git a/pyproject.toml b/pyproject.toml
index 6a3288fcfc73..d82e93459b97 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -67,7 +67,7 @@ dependencies = [
"grpcio~=1.71.0",
"gspread==6.2.1",
"hogql-parser==1.3.75",
- "hogql-parser-rs==1.3.104", # built from rust/hogql/parser via the build-hogql-parser-rs workflow + published to PyPI; rebuild locally with `uv pip install -e rust/hogql/parser` when iterating
+ "hogql-parser-rs==1.3.105", # built from rust/hogql/parser via the build-hogql-parser-rs workflow + published to PyPI; rebuild locally with `uv pip install -e rust/hogql/parser` when iterating
"humanize~=4.12.3",
"infi-clickhouse-orm",
"jsonref==1.1.0",
diff --git a/uv.lock b/uv.lock
index c9def98f945a..c305e6977b1c 100644
--- a/uv.lock
+++ b/uv.lock
@@ -3148,16 +3148,16 @@ wheels = [
[[package]]
name = "hogql-parser-rs"
-version = "1.3.104"
+version = "1.3.105"
source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/41/e7/c8a0fb39e0bc66c0ab877683bfb75055252911ef6b774ec73c7803499943/hogql_parser_rs-1.3.104.tar.gz", hash = "sha256:838dbac97b9ed948697de3ce80ba7cd0ecf5cfec95f8f11922cc0c6c3afc01f0", size = 301109, upload-time = "2026-06-26T16:21:40.298Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/43/27/ef723addbc55f9c81bdaf9455391dc7154f77c0f5feb589e97c9e071dc52/hogql_parser_rs-1.3.105.tar.gz", hash = "sha256:41a745b54bca32565e54d6ec6541e5c59de04e1eb17b47c76493c5e55bae7bbc", size = 301124, upload-time = "2026-06-29T10:55:36.446Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/e8/26/6809a725eb3c7202dc6ba1580a368e4d38dd8d80f4b598851ce83966f4e3/hogql_parser_rs-1.3.104-cp312-abi3-macosx_10_12_x86_64.whl", hash = "sha256:8dc7861d65c6b3cb89cb89144fcfea7e2c4c4f4e396977adc18bb33552f43fad", size = 741269, upload-time = "2026-06-26T16:21:31.534Z" },
- { url = "https://files.pythonhosted.org/packages/30/6a/09525f13d929b7ce90f427a9619944f825dffc5c8cbb62c23433c4b9cd56/hogql_parser_rs-1.3.104-cp312-abi3-macosx_11_0_arm64.whl", hash = "sha256:9363210d6f8b45e812c46ae798b6fcaaf656e416b86c91b4fe62c42ec09a987c", size = 698617, upload-time = "2026-06-26T16:21:33.263Z" },
- { url = "https://files.pythonhosted.org/packages/88/be/bd91222d719e99ba9b410f1bbae6f3efc8293d5e1d1339c8f7877a421c4b/hogql_parser_rs-1.3.104-cp312-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:33d05cdb34b3ac5c38ff32ef722c1a9677d04d038d77e547ee18efaad8c29540", size = 2500855, upload-time = "2026-06-26T16:21:34.623Z" },
- { url = "https://files.pythonhosted.org/packages/28/fe/7e082d94e0917870edbe16d7f6653aba14199b2879e33160e30b95d3eae8/hogql_parser_rs-1.3.104-cp312-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3ecf1bfde158efaa89365761c70c7759f24707acd6b4b5d1dfd08109021d9728", size = 2763723, upload-time = "2026-06-26T16:21:36.025Z" },
- { url = "https://files.pythonhosted.org/packages/15/51/22c973ec0493b9f4030b5d244020921d851abb987efe8a9bcbcfaf22c75e/hogql_parser_rs-1.3.104-cp312-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:ab6b23a788b8d7d416c74404d517e7c47e946d32c4a9d74c844b19b16138f0e2", size = 2675311, upload-time = "2026-06-26T16:21:37.493Z" },
- { url = "https://files.pythonhosted.org/packages/db/63/660cbfdc58bce5b7567e144d6fd055603989d7772031ddb19b39fb450932/hogql_parser_rs-1.3.104-cp312-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:2e403e1771cb3e36021877d512c5d8e5053401adc5b66a9b1a54254916257db8", size = 2724715, upload-time = "2026-06-26T16:21:38.974Z" },
+ { url = "https://files.pythonhosted.org/packages/7d/94/5a5301586b065d5ae9d6054976ef9c27da843008049836bb89fb05afccd4/hogql_parser_rs-1.3.105-cp312-abi3-macosx_10_12_x86_64.whl", hash = "sha256:1ff2dd8b1d60b15f07bb0bea0472c5fd4454d89fd303058846c9d74d9f1047d3", size = 741340, upload-time = "2026-06-29T10:55:26.884Z" },
+ { url = "https://files.pythonhosted.org/packages/54/92/fc83c3d568ee78b89e7398fcbc4725e63764ba883486e30d74385bdf2384/hogql_parser_rs-1.3.105-cp312-abi3-macosx_11_0_arm64.whl", hash = "sha256:318df3ed2d5366273d7e5c996d39497e9518734d3f5f6b0367b51cff08a4dde8", size = 698428, upload-time = "2026-06-29T10:55:28.454Z" },
+ { url = "https://files.pythonhosted.org/packages/bd/a5/dfd6e096d15064f69d5e0a14223b1ee73791e7612073c8f2463be2e07d4c/hogql_parser_rs-1.3.105-cp312-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:f961e1e544cbf1702338de138a060248821bc76a3fed48a2de50e611356fbb42", size = 2500951, upload-time = "2026-06-29T10:55:29.996Z" },
+ { url = "https://files.pythonhosted.org/packages/ab/84/eddc51cd966ab86cd173a5c54bb93092595c76b450e0155ae13d11bf38a2/hogql_parser_rs-1.3.105-cp312-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:571c8ae48ba1968a2645f48d32187c380ad9128b7943c2d8b917517852f6361d", size = 2763150, upload-time = "2026-06-29T10:55:31.587Z" },
+ { url = "https://files.pythonhosted.org/packages/87/71/e2f398268b368ad09413c8bc6dde0945d66a51660d2b977f2473a110ef33/hogql_parser_rs-1.3.105-cp312-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:2d7121ca4c30fc8e66c3b7cab38d0d916f0788ccc85cd067cf8eb59a708020dd", size = 2675570, upload-time = "2026-06-29T10:55:33.259Z" },
+ { url = "https://files.pythonhosted.org/packages/b9/76/fd785f06e799861a3695c57848c42ac0a2345fd00979ab6f6622a09663dd/hogql_parser_rs-1.3.105-cp312-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:e8d4d092d4a38713a98193ce11555f32ca0669cdc9f4125654eb0bc17c4743e2", size = 2724538, upload-time = "2026-06-29T10:55:34.682Z" },
]
[[package]]
@@ -5881,7 +5881,7 @@ requires-dist = [
{ name = "grpcio", specifier = "~=1.71.0" },
{ name = "gspread", specifier = "==6.2.1" },
{ name = "hogql-parser", specifier = "==1.3.75" },
- { name = "hogql-parser-rs", specifier = "==1.3.104" },
+ { name = "hogql-parser-rs", specifier = "==1.3.105" },
{ name = "humanize", specifier = "~=4.12.3" },
{ name = "infi-clickhouse-orm", git = "https://github.com/PostHog/infi.clickhouse_orm?rev=4e3996becf66bf5c26580aff12a80425d9d56fe5" },
{ name = "jsonref", specifier = "==1.1.0" },