Skip to main content

verify

Run verification before committing or creating a PR, including dependency and bootstrap behavior when build or test prerequisites change.

소스 정보

저장소
RediSearch/RediSearch
최근 소스 활동
2026년 10월 13일 14:34
감지된 SKILL.md 언어
영어
스타
6,244
포크
600

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
verify
description
Run verification before committing or creating a PR, including dependency and bootstrap behavior when build or test prerequisites change.
# Verify Skill Run full verification before committing or creating a PR. ## Usage Use this skill to run comprehensive checks before finalizing changes. ## Instructions Determine which code was modified (C, Rust, or both) and run the appropriate checks. If dependencies, `.install/`, bootstrap targets, toolchain versions, or CI provisioning changed, first follow [Bootstrap and Dependency Changes](../build/SKILL.md#bootstrap-and-dependency-changes). ### If C code was modified Run the following checks in order: #### 1. Build ```bash ./build.sh ``` Ensure the full project compiles without warnings promoted to errors. #### 2. C/C++ Unit Tests ```bash ./build.sh RUN_UNIT_TESTS ENABLE_ASSERT=1 ``` All unit tests must pass. Use [/run-c-unit-tests](../run-c-unit-tests/SKILL.md) for details on running specific tests. #### 3. Behavioral Tests ```bash ./build.sh RUN_PYTEST ENABLE_ASSERT=1 ``` Required for changes to command handlers, query execution, indexing pipeline, or RDB serialization. #### 4. AddressSanitizer (recommended for memory-related changes) ```bash ./build.sh RUN_UNIT_TESTS SAN=address ``` If the change claims to fix a memory-safety bug, also follow *Memory-safety fixes (either language)* below. #### 5. Coordinator Tests (if `coord/` code was modified) Changes to the coordinator (`src/coord/`), distributed hybrid (`src/coord/hybrid/`), or the Map-Reduce layer (`src/coord/rmr/`) must be tested in a clustered environment: ```bash ./build.sh RUN_PYTEST ENABLE_ASSERT=1 REDIS_STANDALONE=0 SHARDS=3 ``` This spins up a 3-shard cluster and runs the full test suite against it. ### If Rust code was modified #### 1. Format Check ```bash make fmt CHECK=1 ``` If it fails, run `make fmt` to fix formatting. #### 2. Lint Check ```bash make lint ``` Fix any clippy warnings or errors. #### 3. Build ```bash ./build.sh ``` Ensure the full project compiles. #### 4. Rust Tests ```bash cargo nextest run --manifest-path src/redisearch_rs/Cargo.toml ``` All Rust tests must pass. If the change claims to fix a memory-safety bug, also follow *Memory-safety fixes (either language)* below. ### If both C and Rust were modified Run all checks from both sections above. ### Memory-safety fixes (either language) When the change claims to fix a memory-safety bug (out-of-bounds access, use-after-free), demonstrate the bug once on the pre-fix code with an *executed* sanitizer repro — a predicted report is not verification. Expect the sanitizer report on the pre-fix code and a clean run on the fixed one. For C, the cheap form needs no ASan build tree: extract the affected file at the pre-fix revision and compile a standalone repro against it, e.g. ```bash git show HEAD:src/<file>.c > /tmp/before_fix.c # fix not yet committed (the usual case) git show <fix-commit>^:src/<file>.c > /tmp/before_fix.c # fix already committed clang -fsanitize=address -g -O0 <repro.c> /tmp/before_fix.c -o repro && ./repro ``` Most `src/` files won't compile standalone as-is: expect to add `-I` paths and stub out heavyweight includes (`rm_malloc`, `RS_ABORT`, module headers) with minimal definitions in the repro's own directory. That stubbing is usually minutes of work, not hours. The repro must build against a consistent pre-fix baseline. If the fix also touches a header, macro, or inline helper the extracted file depends on, extract those at the same pre-fix revision — compiling a pre-fix `.c` against post-fix headers tests a mixed program that can hide the bug or fail for an unrelated reason. When the dependency set grows past a few files, a worktree checked out at the pre-fix revision is simpler. For Rust, run the failing case on the pre-fix code under Miri (`cargo +nightly miri test --manifest-path src/redisearch_rs/Cargo.toml -p <crate>`); for bugs Miri cannot reach (FFI, foreign memory), use an ASan build of the affected test. Single-file extraction does not work here — cargo builds the whole crate — and the current checkout already contains the fix, so a Miri run in it only shows the *fixed* code is clean. Check out a pre-fix tree first: ```bash git worktree add --detach /tmp/prefix_tree HEAD # fix not yet committed (the usual case) git worktree add --detach /tmp/prefix_tree <fix-commit>^ # fix already committed ``` If the failing test was added alongside the fix, copy the test (and only the test) into that tree. Run Miri or ASan with `--manifest-path` pointing at the worktree, expect the failure there and a clean run in the fixed checkout, then clean up with `git worktree remove --force /tmp/prefix_tree`. ### Behavioral Tests (for significant changes in either language) ```bash ./build.sh RUN_PYTEST ENABLE_ASSERT=1 ``` ### Showing behavior on a live server Test suites prove what they assert. To show a user-visible change working on a real redis-server, or to reproduce a report by hand, follow [/drive-redisearch](../drive-redisearch/SKILL.md). ## Quick Verification For minor Rust-only changes (subshell keeps the chain readable — one cwd hop, three commands): ```bash (cd src/redisearch_rs && cargo fmt --check && cargo clippy --all-targets && cargo nextest run) ``` For minor C-only changes: ```bash ./build.sh && ./build.sh RUN_UNIT_TESTS ENABLE_ASSERT=1 ```
GitHub에서 보기