: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(ci): show Trunk lane name in CI report (#85242)
Paul D'Ambra3ff20b16ad54
diff --git a/.github/scripts/post-ci-sections.test.mjs b/.github/scripts/post-ci-sections.test.mjsindex d49d2e4066ea..ba1515b51727 100644--- a/.github/scripts/post-ci-sections.test.mjs+++ b/.github/scripts/post-ci-sections.test.mjs@@ -42,23 +42,35 @@ describe('CI report section builders', () => {for (const testCase of [{- name: 'marks the universal lane red',+ name: 'describes the universal lane',input: { impactedTargets: ['py:core', 'fe:core'], isUniversal: true },- expectedStatus: 'fail',+ expected: {+ status: 'alert',+ summary: 'universal lane',+ body: 'This PR is assigned to the universal lane. It cannot merge in parallel with other PRs, so it can take longer to merge. Ask dev-ex if you think this is wrong.',+ },},{- name: 'marks a backend Python lane yellow',- input: { impactedTargets: ['py:product:surveys'], isUniversal: false },- expectedStatus: 'warn',+ name: 'describes the backend Python lane',+ input: { impactedTargets: ['py:product:surveys', 'fe:product:<script>'], isUniversal: false },+ expected: {+ status: 'warn',+ summary: 'backend Python lane',+ body: 'This PR is assigned to the backend Python lane. It runs backend Python tests and may merge in parallel with PRs in other lanes.',+ },},{- name: 'marks other lanes green',+ name: 'describes a non-backend lane',input: { impactedTargets: ['fe:core'], isUniversal: false },- expectedStatus: 'ok',+ expected: {+ status: 'ok',+ summary: 'non-backend lane',+ body: 'This PR is assigned to the non-backend lane. It does not run backend Python tests and may merge in parallel with PRs in other lanes.',+ },},]) {it(testCase.name, () => {- assert.equal(buildTrunkLaneSection(testCase.input).status, testCase.expectedStatus)+ assert.deepEqual(buildTrunkLaneSection(testCase.input), testCase.expected)})}diff --git a/.github/scripts/post-trunk-lane-section.mjs b/.github/scripts/post-trunk-lane-section.mjsindex 889a254e0867..30883c1eeaab 100644--- a/.github/scripts/post-trunk-lane-section.mjs+++ b/.github/scripts/post-trunk-lane-section.mjs@@ -10,24 +10,19 @@ export function buildTrunkLaneSection({ impactedTargets, isUniversal }) {!impactedTargets.every((target) => typeof target === 'string')) {return {- status: 'fail',+ status: 'alert',summary: 'universal lane',- body: 'This PR is assigned to the universal lane. Trunk will merge it on its own.',+ body: 'This PR is assigned to the universal lane. It cannot merge in parallel with other PRs, so it can take longer to merge. Ask dev-ex if you think this is wrong.',}}- if (impactedTargets.some((target) => target.startsWith('py:'))) {- return {- status: 'warn',- summary: 'runs backend Python tests',- body: 'This PR is assigned to a lane that runs backend Python tests.',- }- }+ const runsBackendPythonTests = impactedTargets.some((target) => target.startsWith('py:'))+ const summary = runsBackendPythonTests ? 'backend Python lane' : 'non-backend lane'return {- status: 'ok',- summary: 'does not run backend Python tests',- body: 'This PR is assigned to a lane that does not run backend Python tests.',+ status: runsBackendPythonTests ? 'warn' : 'ok',+ summary,+ body: `This PR is assigned to the ${summary}. It ${runsBackendPythonTests ? 'runs' : 'does not run'} backend Python tests and may merge in parallel with PRs in other lanes.`,}}diff --git a/frontend/bin/ci-report/update-ci-report.mjs b/frontend/bin/ci-report/update-ci-report.mjsindex 6b3177c9a66f..78ec2ea07071 100644--- a/frontend/bin/ci-report/update-ci-report.mjs+++ b/frontend/bin/ci-report/update-ci-report.mjs@@ -40,7 +40,7 @@ export const SECTIONS = [{ id: 'survey-sdk', title: 'Survey SDK reminder' },]-export const STATUS_EMOJI = { ok: '✅', warn: '⚠️', fail: '❌', info: 'ℹ️' }+export const STATUS_EMOJI = { ok: '✅', warn: '⚠️', alert: '🚨', fail: '❌', info: 'ℹ️' }function emojiFor(status) {return STATUS_EMOJI[status] ?? STATUS_EMOJI.infodiff --git a/frontend/bin/ci-report/update-ci-report.test.ts b/frontend/bin/ci-report/update-ci-report.test.tsindex b524d679b1a6..206a71b80229 100644--- a/frontend/bin/ci-report/update-ci-report.test.ts+++ b/frontend/bin/ci-report/update-ci-report.test.ts@@ -150,6 +150,7 @@ describe('ci-report section helper', () => {it.each([['ok', STATUS_EMOJI.ok],['warn', STATUS_EMOJI.warn],+ ['alert', STATUS_EMOJI.alert],['fail', STATUS_EMOJI.fail],['info', STATUS_EMOJI.info],['unknown-status', STATUS_EMOJI.info],