mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-12-04 16:31:04 +00:00
* ci: gate the integration CI long tail by diff scope `integration.yml` starts its long tail on every pull request: the three fuzz families, the chaos legs, the export/import E2E job and the two sqlness KvBackend legs. Most diffs cannot affect them, so a `scope` job now classifies the pull request and tells those jobs whether to start. The classifier is deterministic and fail-open. Forced modes (merge queue, `schedule`, `workflow_dispatch`, `ci:full`, `CI_SCOPE_FORCE_ALL`) and three floors -- always-run paths, an uncovered `src/` change, and a PromQL/flow filter -- can only widen the result; everything else is a glob match against the suite catalog. Every step of the job is `continue-on-error` and every gate reads `needs.scope.outputs.<key> != 'false'`, so a classifier crash runs the jobs instead of skipping them. The rules are checked out from the pull request base, so a pull request cannot relax its own gate. The policy is data: `.github/ci/scope-rules.toml` holds the path groups, the suite catalog and the always-run list, with a `reason` on every exclusion. `ci_scope_rules.py` loads it with the stdlib `tomllib` and validates the shape (unknown or cyclic `@group` references, a `family` that disagrees with the suite id, an empty reason) and that every glob's literal prefix still exists, so a renamed crate cannot leave a rule that matches nothing. `make check-ci-scope` runs that check locally; the `CI Scope Rules` job runs it on `ubuntu-slim`, the same image the classifier uses. `.github/ci/scope-cases.toml` holds golden cases that `test_ci_scope.py` replays through the real classifier. The PostgreSQL and MySQL sqlness legs move into their own `sqlness-kvbackend` job so they can be gated: a job-level `if:` cannot read the matrix, and gating them inside `sqlness` would skip required checks and block the merge. They run the same cases as the required Basic leg, so only the backend itself matters. The verdict is visible where triage looks: one log line per suite, the exact gate values, `::warning::` when a lookup fails and the gate widens, and a job summary that lists each suite with the rule that decided it and the changed files that matched. Measured on 200 merged and open pull requests: 27.5% always run, 41% decided by path rules, 31.5% skip every gated job; 995 of 2600 suite selections are skipped, with no selection that a path rule makes. The classifier itself runs in about ten seconds on a single-vCPU runner. Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(ci): let the scope job read pull requests The `scope` job declared `permissions: contents: read`, and an explicit block sets every unlisted permission to `none`. `GET /pulls/{n}` therefore answered 403, `build_plan` widened to a full run as designed, and every gate read an absent output as "run": the gate could never skip anything. - `pull-requests: read` on the `scope` job. - `tests/runner/**` joins `@kv-backend`: the runner implements `--setup-pg`/`--setup-mysql`, which only the KV-backend legs pass, so a change there must not skip the only job that exercises it. The `UNMAPPED_CRATES` excuse is gone with it. - The README no longer claims a queue failure blocks the merge: the gated jobs are not required checks. Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(ci): run every suite when the kind registry script changes The distributed and chaos fuzz jobs start their cluster through `.github/actions/setup-kind`, which runs `.github/scripts/kind-with-registry.sh`. `.github/actions/**` is in `ALWAYS_RUN` but the script is not, so a change confined to it selected no suite at all and every gate stayed `false`: the jobs that exercise the changed cluster setup were skipped. The script joins `ALWAYS_RUN`, consistent with the action that calls it, and a golden case pins it. Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(ci): widen the gate for the fuzz corpus seeding script `fuzz-test/action.yaml` runs `.github/scripts/prepare-fuzz-corpus.sh` before the cache restore in every fuzz job, but the script was not in `ALWAYS_RUN`. A change confined to it therefore selected no suite: `any_fuzz` stayed `false` and every fuzz job that runs it was skipped. The script joins `ALWAYS_RUN` next to the other scripts the fuzz jobs execute, with a golden case for it. Both misses so far (this one and `kind-with-registry.sh`) came through a composite action, which the workflow never names. `WorkflowContractTests` now resolves `uses: ./.github/actions/<name>` transitively for the gated jobs and fails when one of the scripts they run is not in `ALWAYS_RUN`. Signed-off-by: WenyXu <wenymedia@gmail.com> --------- Signed-off-by: WenyXu <wenymedia@gmail.com>
285 lines
7.7 KiB
TOML
285 lines
7.7 KiB
TOML
# Rules for the integration CI admission gate.
|
|
#
|
|
# Data only: `ci_scope_rules.py` loads this file with the stdlib `tomllib`, and
|
|
# `ci_scope.py` matches diffs against it. Edit this file, not the code, when a
|
|
# suite's paths change.
|
|
#
|
|
# Conventions
|
|
# -----------
|
|
# - `**` crosses directories, `*` does not; a trailing `/**` covers everything
|
|
# under a directory.
|
|
# - `@name` inside `suites.*.paths` expands `[groups].name`, and groups may
|
|
# reference other groups. Expansion is recursive.
|
|
# - A suite id is `<gate>/<matrix group id>`; `gate` is the `$GITHUB_OUTPUT`
|
|
# key that switches the job, and it must equal the id prefix with `-`
|
|
# replaced by `_`.
|
|
# - Everything here is a floor, never a filter: an unmatched `src/` path runs
|
|
# every suite, and a malformed file fails the classifier job, whose steps are
|
|
# `continue-on-error`, so the gated jobs run.
|
|
|
|
[matching]
|
|
# A changed file matching one of these runs every suite.
|
|
# Put here anything that changes what the suites build or how they start.
|
|
always_run = [
|
|
"Cargo.toml",
|
|
"Cargo.lock",
|
|
"rust-toolchain.toml",
|
|
".cargo/**",
|
|
"tests-fuzz/**",
|
|
"tests-integration/**",
|
|
"config/**",
|
|
"docker/**",
|
|
".github/ci/**",
|
|
".github/workflows/integration.yml",
|
|
".github/actions/**",
|
|
# Both run through a composite action, so neither appears in the workflow:
|
|
# `setup-kind` starts the cluster for the distributed and chaos jobs, and
|
|
# `fuzz-test` seeds the corpus every fuzz job starts from.
|
|
".github/scripts/kind-with-registry.sh",
|
|
".github/scripts/prepare-fuzz-corpus.sh",
|
|
".github/scripts/run-fuzz-targets.sh",
|
|
".github/scripts/collect-fuzz-target-artifacts.sh",
|
|
".github/scripts/wait-kafka-ready.sh",
|
|
".github/scripts/pull-test-deps-images.sh",
|
|
]
|
|
|
|
# A change under `src/` that no suite claims runs every suite: that is the net
|
|
# for a crate added, split or renamed after these rules were written.
|
|
src_tree = "src/"
|
|
|
|
# Paths outside the gate's remit. They select no suite, and they do not count as
|
|
# "no rule covers this" either, so they never widen the gate. Each needs a
|
|
# `reason`: what CI covers them instead.
|
|
[[matching.exempt]]
|
|
path = "src/promql/"
|
|
reason = "PromQL crate: rust.yml and the promql sqlness cases own it; the fuzz suites speak SQL."
|
|
|
|
[[matching.exempt]]
|
|
path = "src/query/src/promql/"
|
|
reason = "PromQL module inside `src/query`, which `@server` claims as `src/query/**`."
|
|
|
|
[[matching.exempt]]
|
|
path = "src/flow/"
|
|
reason = "Flow engine: rust.yml and the flow sqlness cases own it; no fuzz suite loads it."
|
|
|
|
# Which job each gate switches. The keys are `$GITHUB_OUTPUT` names; the values
|
|
# are job ids in `integration.yml`. The classifier cannot read YAML, so the
|
|
# mapping is data here, and a test proves both directions line up.
|
|
[gates]
|
|
fuzz_standalone = "fuzztest"
|
|
fuzz_unstable = "unstable-fuzztest"
|
|
fuzz_distributed = "distributed-fuzztest"
|
|
fuzz_chaos = "distributed-fuzztest-with-chaos"
|
|
export_import_v2 = "export-import-v2-e2e"
|
|
sqlness_kvbackend = "sqlness-kvbackend"
|
|
|
|
[groups]
|
|
server = [
|
|
"src/operator/**",
|
|
"src/sql/**",
|
|
"src/catalog/**",
|
|
"src/datatypes/**",
|
|
"src/table/**",
|
|
"src/store-api/**",
|
|
"src/session/**",
|
|
"src/api/**",
|
|
"src/servers/**",
|
|
"src/frontend/**",
|
|
# Also covers `src/query/src/promql/`, which is exempt (see
|
|
# `[[matching.exempt]]`): a PromQL-only change must not run the fuzz fleet.
|
|
"src/query/**",
|
|
"src/partition/**",
|
|
"src/index/**",
|
|
"src/object-store/**",
|
|
"src/cache/**",
|
|
"src/puffin/**",
|
|
"src/auth/**",
|
|
"src/client/**",
|
|
"src/log-query/**",
|
|
"src/pipeline/**",
|
|
"src/plugins/**",
|
|
"src/cmd/**",
|
|
"src/standalone/**",
|
|
"src/datanode/**",
|
|
"src/common/base/**",
|
|
"src/common/batcher/**",
|
|
"src/common/catalog/**",
|
|
"src/common/config/**",
|
|
"src/common/datasource/**",
|
|
"src/common/decimal/**",
|
|
"src/common/error/**",
|
|
"src/common/event-recorder/**",
|
|
"src/common/frontend/**",
|
|
"src/common/function/**",
|
|
"src/common/grpc/**",
|
|
"src/common/grpc-expr/**",
|
|
"src/common/greptimedb-telemetry/**",
|
|
"src/common/macro/**",
|
|
"src/common/mem-prof/**",
|
|
"src/common/memory-manager/**",
|
|
"src/common/options/**",
|
|
"src/common/plugins/**",
|
|
"src/common/pprof/**",
|
|
"src/common/query/**",
|
|
"src/common/recordbatch/**",
|
|
"src/common/runtime/**",
|
|
"src/common/session/**",
|
|
"src/common/sql/**",
|
|
"src/common/stat/**",
|
|
"src/common/substrait/**",
|
|
"src/common/telemetry/**",
|
|
"src/common/test-util/**",
|
|
"src/common/time/**",
|
|
"src/common/version/**",
|
|
"src/common/workload/**",
|
|
]
|
|
|
|
# Storage engines and WAL.
|
|
engine = [
|
|
"src/mito2/**",
|
|
"src/mito-codec/**",
|
|
"src/metric-engine/**",
|
|
"src/file-engine/**",
|
|
"src/log-store/**",
|
|
"src/common/wal/**",
|
|
]
|
|
|
|
# DDL and procedure code standalone executes in-process: it builds a
|
|
# `DdlManager` and runs `LocalProcedureExecutor` without any metasrv.
|
|
meta-core = [
|
|
"src/common/meta/**",
|
|
"src/common/procedure/**",
|
|
"src/common/procedure-test/**",
|
|
]
|
|
|
|
# Everything that sits on the KV backend the two sqlness KvBackend legs
|
|
# exercise: the backend implementations, the metadata service and the startup
|
|
# wiring that picks a backend.
|
|
kv-backend = [
|
|
# The runner implements `--setup-pg`/`--setup-mysql`, which only these legs pass.
|
|
"tests/runner/**",
|
|
"src/common/meta/**",
|
|
"src/meta-srv/**",
|
|
"src/meta-client/**",
|
|
"src/common/procedure/**",
|
|
"src/cmd/**",
|
|
"src/common/config/**",
|
|
"src/common/options/**",
|
|
]
|
|
|
|
# Adds the metasrv/meta-client crates on top of the in-process DDL code.
|
|
meta = [
|
|
"src/meta-srv/**",
|
|
"src/meta-client/**",
|
|
"@meta-core",
|
|
]
|
|
|
|
[suites."fuzz-standalone/database-and-regular-table"]
|
|
gate = "fuzz_standalone"
|
|
paths = [
|
|
"@server",
|
|
"@engine",
|
|
"@meta-core",
|
|
]
|
|
description = "Standalone-server black-box fuzz of CREATE DATABASE/TABLE, ALTER, INSERT over MySQL."
|
|
|
|
[suites."fuzz-standalone/logical-table"]
|
|
gate = "fuzz_standalone"
|
|
paths = [
|
|
"@server",
|
|
"@engine",
|
|
"@meta-core",
|
|
]
|
|
description = "Standalone logical-table DDL/INSERT fuzz (mito2 logical tables)."
|
|
|
|
[suites."fuzz-unstable/standalone"]
|
|
gate = "fuzz_unstable"
|
|
paths = [
|
|
"@server",
|
|
"@engine",
|
|
"@meta-core",
|
|
]
|
|
description = "Unstable standalone create-table fuzz (nix build feature)."
|
|
|
|
[suites."fuzz-distributed/database-and-regular-table"]
|
|
gate = "fuzz_distributed"
|
|
paths = [
|
|
"@server",
|
|
"@engine",
|
|
"@meta",
|
|
]
|
|
description = "Distributed (frontend/datanode/metasrv, remote WAL) DDL/DML fuzz."
|
|
|
|
[suites."fuzz-distributed/logical-table"]
|
|
gate = "fuzz_distributed"
|
|
paths = [
|
|
"@server",
|
|
"@engine",
|
|
"@meta",
|
|
]
|
|
description = "Distributed logical-table fuzz."
|
|
|
|
[suites."fuzz-distributed/repartition"]
|
|
gate = "fuzz_distributed"
|
|
paths = [
|
|
"@server",
|
|
"@engine",
|
|
"@meta",
|
|
]
|
|
description = "Distributed repartition ALTER TABLE + GC fuzz."
|
|
|
|
[suites."fuzz-distributed/logical-pruning"]
|
|
gate = "fuzz_distributed"
|
|
paths = [
|
|
"@engine",
|
|
"@meta",
|
|
]
|
|
description = "Remote-WAL logical table pruning of stale manifests."
|
|
|
|
[suites."fuzz-chaos/migration"]
|
|
gate = "fuzz_chaos"
|
|
paths = [
|
|
"@server",
|
|
"@engine",
|
|
"@meta",
|
|
]
|
|
description = "Region migration under Chaos Mesh, mito and metric engines."
|
|
|
|
[suites."fuzz-chaos/failover"]
|
|
gate = "fuzz_chaos"
|
|
paths = [
|
|
"@server",
|
|
"@engine",
|
|
"@meta",
|
|
]
|
|
description = "Region failover under Chaos Mesh, mito and metric engines."
|
|
|
|
[suites."fuzz-chaos/repartition"]
|
|
gate = "fuzz_chaos"
|
|
paths = [
|
|
"@server",
|
|
"@engine",
|
|
"@meta",
|
|
]
|
|
description = "Repartition + GC under Chaos Mesh."
|
|
|
|
[suites."export-import-v2"]
|
|
gate = "export_import_v2"
|
|
paths = [
|
|
"src/cli/**",
|
|
"@server",
|
|
"@engine",
|
|
"@meta-core",
|
|
]
|
|
description = "CLI COPY DATABASE export/import v2 end-to-end against S3."
|
|
|
|
[suites."sqlness-kvbackend/metasrv-postgres"]
|
|
gate = "sqlness_kvbackend"
|
|
paths = ["@kv-backend"]
|
|
description = "Sqlness with PostgreSQL as the metadata KV backend."
|
|
|
|
[suites."sqlness-kvbackend/metasrv-mysql"]
|
|
gate = "sqlness_kvbackend"
|
|
paths = ["@kv-backend"]
|
|
description = "Sqlness with MySQL as the metadata KV backend."
|