Detect drift between StarRocks configuration code (the source of truth) and its documentation — wrong documented defaults, wrong mutability, missing defaults, and stale/undocumented parameters.
A documented default that contradicts the code (e.g. slow_query_analyze_threshold
documented as 5 when the code sets 5000) silently misconfigures clusters and
generates support load. This tool finds those, repeatably, every release.
Extraction is deterministic on both sides — no LLM. A finding is never hallucinated; every one is a literal, reproducible diff between two files. Use an LLM only downstream, to draft the doc edits this tool proposes.
Single file, standard library only (drift_audit.py), so it can be vendored
into any repo — public OSS or private — with nothing to install.
| Source of truth | Docs |
|---|---|
FE: fe/.../common/Config.java (@ConfField) |
docs/en/administration/management/FE_parameters/*.md |
BE: be/src/common/config.h (CONF_[m]Type(name,"default")) |
docs/en/administration/management/BE_parameters/*.md |
| Finding | Meaning | Action |
|---|---|---|
default_mismatch |
Documented default contradicts code | Fix docs (or code, if code is wrong) |
mutable_mismatch |
Documented "Is mutable" contradicts code | Fix docs |
doc_missing_default |
Doc block has no/empty Default: |
Fill it in |
stale_in_docs |
Documented, not in code | Remove or mark deprecated |
undocumented |
In code, not in docs | Triage (many are intentionally internal) |
# Audit a local StarRocks checkout
python3 drift_audit.py --component fe --repo /path/to/starrocks
python3 drift_audit.py --component be --repo /path/to/starrocks --format markdown
# CI: report only params this PR touched
python3 drift_audit.py --component be --repo . --changed-since origin/main
# Split-repo: code from StarRocks, docs from another repo (e.g. commercial docs)
python3 drift_audit.py --component fe \
--code-file /path/to/starrocks/fe/.../Config.java \
--docs-dir /path/to/celerdata-docs/.../FE_parameters--format is text (default), json, or markdown. Exit code is non-zero when
authoritative drift exists (tune with --fail-on), so it works directly as a gate.
Consuming repos call the reusable workflow. Same-repo case (code + docs together):
# .github/workflows/doc-drift.yml in StarRocks/starrocks
on: [pull_request]
jobs:
drift:
uses: StarRocks/doc-config-drift/.github/workflows/reusable-drift-check.yml@main
with:
components: "fe be"
changed-since: ${{ github.event.pull_request.base.sha }}Split-repo case (docs repo, code lives in StarRocks/starrocks) — pass code-repo;
see .github/workflows/reusable-drift-check.yml for all inputs. Results are written
to the job's Step Summary.
- StarRocks/starrocks — see note below.
- CelerData commercial docs (
celerdata-cloud-docs,phoenixdata-docs, …) — run against the StarRocks codebase (which they build on) with their own--docs-dir.
That in-repo tool detects new undocumented params (by name) and drafts AI descriptions for the "Docs needed:" issues. It historically did not compare documented values. Two integration options (project decision):
- Vendor this engine's value-drift logic into that tool (single file, no external dependency — friendliest for public OSS), keeping this repo the canonical source that commercial docs also use.
- Call this repo's reusable workflow from StarRocks CI directly.
These caused false findings during development and must never regress:
- Rendered vs source Markdown bullets:
* Default:vs- Default:— both accepted. - Semicolons inside
@ConfField(comment="…;…")— findpublic staticfirst, then the terminating;. CONF_Alias(primary, alias)is not a declaration and has no string default — excluded, so it can't clobber the real default.CONF_Strings/CONF_String_enumare real declarations — included.- Full-width colon
:(from CJK input) in doc bullets — tolerated. - Arithmetic /
Lsuffixes /_separators — evaluated, so2 * 3600==7200L. Single-element array notation (query=={"query"}) is not flagged.
python3 -m pytest tests/ -q