mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-06 07:03:45 +09:00
## What The PR pipeline skips build, Talos and E2E only when every changed path is under `docs/` or one of the two CI-only Go tools. A PR that touches `README.md`, `GOVERNANCE.md`, an issue template or `LICENSE` still builds every image, boots a sandbox and runs the suite, for files nothing in that pipeline reads. This PR moves the classifier into `hack/code-changed.sh` and widens what counts as non-code: - `docs/` tree, Markdown outside `packages/`, `img/`, `LICENSE` (Markdown under `packages/` stays code: Go controller tests read chart READMEs) - `.github/ISSUE_TEMPLATE/`, `CODEOWNERS`, `PULL_REQUEST_TEMPLATE.md`, `labels.yml`, `renovate.json`, `.gemini/`, `.coderabbit.yaml`, `security-insights.yml` Both lanes read the same script: the in-tree `plan` job feeds it the `--no-renames` merge diff, and the fork `resolve` job feeds it the base-repo PR file list (`filename` + `previous_filename`, so a `packages/… -> docs/…` rename still reads as code). The fork lane checks out `hack/` from the base repository's default branch, never from the fork. The `push` triggers of `build-main`, `build-release` and CodeQL mirror the classifier with a `paths` filter (`**`, one `!` glob per non-code path, then `packages/**.md` re-included; `paths` rather than `paths-ignore` because only `paths` documents re-including after a negation), so a docs-only push to main no longer rebuilds it. `hack/code-changed_test.bats` keeps the three filters equal, checks that every `!` glob is non-code and every re-include is code for the script, so a push of real code can never skip its build, and pins CodeQL's `pull_request` trigger to having no path filter. ## What still checks non-code files - Markdown under `packages/` is code, so chart READMEs keep the full pipeline: `packages/system/flux-plunger/README.md` is checked by a Go test (`TestDocs_StateTheTimingsTheBinaryAndTheChartUse` in `internal/controller/fluxplunger/hook_contract_test.go`) that runs only on the code path, and all chart READMEs are regenerated by `make generate` under pre-commit. The Bats lane of `checks` runs for every path except the two CI-only tools (`cmd/backport-batch/`, `cmd/api-gate/`), so `labels.yml`, `CODEOWNERS`, `renovate.json`, the PR template and the Markdown outside `packages/` keep their `hack/*.bats` contract tests; they only skip build, Talos and E2E. - `labels.yml` has its own workflow; zizmor still runs on workflow changes. - CodeQL is a required check on `main`, so its `pull_request` trigger has no `paths-ignore`: a path-filtered required workflow would leave the PR on "Expected". Only the `push` trigger keeps the mirrored list, so a docs-only merge does not rerun it. ## Numbers Over the 200 merged PRs returned by `gh pr list --state merged --limit 200` on 2026-11-18 (merged 2026-10-14 to 2026-11-18; the list is ordered by creation, not merge date) the gate on main (`docs/` plus the two CI-only tools) skips 8, the new one 10. The extra two: #5168 and #5188. None of them touches Markdown under `packages/`, so keeping it as code costs nothing in this window. ## Not changed - `.gitignore`, `.dockerignore`, `packages/tests/` fixtures and `dashboards/*.json` stay code: the first two change what gets built, the fixtures feed helm-unittest (code lane only), the dashboards ship in charts. - `select-e2e.sh`'s `inert_config_pattern` is untouched; `docs/agents/e2e-testing.md` already says the `plan` gate is the place to widen. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **CI Improvements** * Main and maintained release-branch builds are skipped for changes limited to documentation, images, selected tooling, repository metadata, and Markdown outside `packages/`. Changes to Markdown files under `packages/` still trigger builds. * CodeQL is skipped on pushes to `main` for those non-code changes; pull requests targeting `main` remain subject to CodeQL checks. * End-to-end checks are skipped when all changed files are classified as non-code, including renames. Status messages clarify when checks are not required. * **Documentation** * Updated end-to-end testing guidance to distinguish the build gate from test-suite selection; dashboard-only changes still install dependencies but skip the Chainsaw suite. <!-- end of auto-generated comment: release notes by coderabbit.ai -->