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): keep product skill markdown off the frontend lanes (#77018)

Georges-Antoine Assif5624161d5e1
diff --git a/.github/scripts/trunk-impacted-targets.js b/.github/scripts/trunk-impacted-targets.js
index 5941005421ab..313801c52792 100644
--- a/.github/scripts/trunk-impacted-targets.js
+++ b/.github/scripts/trunk-impacted-targets.js
@@ -1258,8 +1258,14 @@ function computeTargets(changedFiles, context) {
// is still backend: the workspace says the directory holds a JS
// package, not that Python cannot be checked into it.
const isWorkspaceOnly = !isBackend && !isFrontend && isInProductWorkspace(product, file, productWorkspaces)
-
- if (isFrontend || (!isBackend && !isFrontend)) {
+ // Markdown reaches this branch only as a product skill, which the
+ // prose rule exempts above because the skill build and the
+ // product's own backend read those files. Both readers are Python,
+ // so it takes the backend half of the "neither" default below and
+ // not the frontend one: no frontend suite reads a skill.
+ const isMarkdown = /\.mdx?$/.test(file)
+
+ if (isFrontend || (!isBackend && !isFrontend && !isMarkdown)) {
targets.add(feProduct(product))
}
if (isBackend || (!isBackend && !isFrontend && !isWorkspaceOnly)) {
diff --git a/.github/scripts/trunk-impacted-targets.test.js b/.github/scripts/trunk-impacted-targets.test.js
index 9d8ffe558c47..b534aeff7451 100644
--- a/.github/scripts/trunk-impacted-targets.test.js
+++ b/.github/scripts/trunk-impacted-targets.test.js
@@ -850,11 +850,21 @@ test('markdown alongside code contributes no lane of its own', () => {
// hogli build:skills zips products/*/skills/*, and ci-agent-skills.yml gates on
// those paths and on .agents/, so this markdown is a build input, not prose.
+// Skill markdown is a build input for the Python skill build (and sometimes the product backend).
+// No frontend suite reads these files, so they should claim the backend lane but not the frontend lane.
test('skill markdown keeps the lane of the tree that builds it', () => {
assert.deepEqual(computeTargets(['.agents/skills/merging-prs/SKILL.md'], CONTEXT), ['agents'])
const productSkill = computeTargets(['products/beta/skills/creating-experiments/SKILL.md'], CONTEXT)
assert.equal(productSkill.includes('py:product:beta'), true)
- assert.equal(productSkill.includes('fe:product:beta'), true)
+ assert.equal(productSkill.includes('fe:product:beta'), false)
+})
+
+// The carve-out is for markdown, not for everything under skills/. A non-prose
+// file there is as unclassifiable as before and keeps both halves.
+test('a non-markdown skill file still claims both halves', () => {
+ const script = computeTargets(['products/beta/skills/creating-experiments/scripts/run.sh'], CONTEXT)
+ assert.equal(script.includes('py:product:beta'), true)
+ assert.equal(script.includes('fe:product:beta'), true)
})
// docs/onboarding is the @posthog/docs-onboarding workspace package that