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): narrow the openapi codegen checkout (#126852)

posthog[bot]6e39a36a5029
diff --git a/.github/workflows/ci-openapi-codegen.yml b/.github/workflows/ci-openapi-codegen.yml
index 65c8c03272d3..ca7c6087e2d3 100644
--- a/.github/workflows/ci-openapi-codegen.yml
+++ b/.github/workflows/ci-openapi-codegen.yml
@@ -25,6 +25,18 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ sparse-checkout: |
+ /*
+ !/*/
+ **/package.json
+ /.github/actions/pnpm-install/
+ /.github/actions/setup-pnpm/
+ /.husky/
+ /bin/fix-rdkafka-paths
+ /patches/
+ /tools/openapi-codegen/
+ sparse-checkout-cone-mode: false
- name: Install pnpm dependencies
uses: ./.github/actions/pnpm-install
diff --git a/docs/internal/ci-things-already-tried.md b/docs/internal/ci-things-already-tried.md
index 350e4187b9ff..5f33135cc456 100644
--- a/docs/internal/ci-things-already-tried.md
+++ b/docs/internal/ci-things-already-tried.md
@@ -469,6 +469,8 @@ The Dagster path validator also uses a sparse checkout of every internal Python
`ci-rust.yml` also uses it on the build and test jobs, but that came before this PR.
The large Python and frontend test jobs do not use it. Their checkout is complete.
+OpenAPI codegen tests keep root files, every package manifest, patches, the pnpm setup actions, Husky hooks, the Linux-safe postinstall script, and `tools/openapi-codegen/`. The package manifests preserve workspace discovery during the frozen filtered install. Check both cold and warm installs, test discovery, and failure detection when changing these inputs.
+
If you propose this again, name the jobs and prove that each one reads only the included paths. A test job can read more of the tree than an exclusion list expects.
Storybook's `select-stories` job checks out only `.nvmrc` from the PR head. It keeps the bounded blobless history for changed-path detection, downloads the module graph, and runs the selector from a separate trusted base checkout. Source files do not need to exist in the PR worktree for this job.