Skip to content

Commit fcd1825

Browse files
committed
CLAUDE: add details and adjust directions for dev workflow
- Linting takes a while, so stop recommending it before every commit. - Add information on optimizer and schemachanger packages. - Mention bazel file generation. Release note: None
1 parent c42b2c7 commit fcd1825

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

CLAUDE.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ CockroachDB is a distributed SQL database written in Go, built with Bazel and ma
2929
./dev test pkg/sql --stress # Run repeatedly until failure
3030
./dev testlogic # Run all SQL logic tests
3131
./dev testlogic ccl # Run enterprise logic tests
32-
./dev testlogic --files='prepare|fk' # Run specific test files
32+
./dev testlogic base --config=local --files='prepare|fk' # Run specific test files under a specific configuration
3333
```
3434

3535
Note that when filtering tests via `-f` to include the `-v` flag which
@@ -40,8 +40,10 @@ for `testing: warning: no tests to run` in the output.
4040
```bash
4141
./dev generate # Generate all code (protobuf, parsers, etc.)
4242
./dev generate go # Generate Go code only
43-
./dev lint # Run all linters
44-
./dev lint --short # Run fast subset of linters
43+
./dev generate bazel # Update BUILD.bazel files when dependencies change
44+
./dev generate protobuf # Generate files based on protocol buffer definitions
45+
./dev lint # Run all linters (only run this when requested)
46+
./dev lint --short # Run fast subset of linters (only run this when requested)
4547
```
4648

4749
### Architecture Overview
@@ -67,20 +69,21 @@ SQL Layer (pkg/sql/) → Distributed KV (pkg/kv/) → Storage (pkg/storage/)
6769

6870
### Development Workflow
6971

70-
1. **Environment Setup**: Run `./dev doctor` to ensure all dependencies are installed
71-
2. **Building**: Use `./dev build short` for iterative development, `./dev build cockroach` for full builds
72-
3. **Testing**: Run package-specific tests with `./dev test pkg/[package]`
73-
4. **Code Generation**: After schema/proto changes, run `./dev generate go`
74-
5. **Quality Checks**: Run `./dev lint` before committing
72+
1. **Environment Setup**: Run `./dev doctor` to ensure all dependencies are installed.
73+
2. **Building**: Use `./dev build short` for iterative development, `./dev build cockroach` for full builds.
74+
3. **Testing**: Run package-specific tests with `./dev test pkg/[package]`.
75+
4. **Code Generation**: After schema/proto changes, run `./dev generate go`.
76+
5. **Linting**: Run with `./dev lint` or `./dev lint --short`. This takes a while, so no need to run it regularly.
7577

7678
### Testing Strategy
7779

7880
CockroachDB has comprehensive testing infrastructure:
79-
- **Unit Tests**: Standard Go tests throughout `/pkg/` packages
80-
- **Logic Tests**: SQL correctness tests using `./dev testlogic`
81-
- **Roachtests**: Distributed system integration tests
82-
- **Acceptance Tests**: End-to-end testing in `/pkg/acceptance/`
83-
- **Stress Testing**: Continuous testing with `--stress` flag
81+
- **Unit Tests**: Standard Go tests throughout `/pkg/` packages.
82+
- **Logic Tests**: SQL correctness tests using `./dev testlogic`.
83+
- **Roachtests**: Distributed system integration tests.
84+
- **Acceptance Tests**: End-to-end testing in `/pkg/acceptance/`.
85+
- **Stress Testing**: Continuous testing with `--stress` flag.
86+
8487

8588
### Build System
8689

@@ -93,6 +96,8 @@ CockroachDB has comprehensive testing infrastructure:
9396

9497
**Package Structure:**
9598
- `/pkg/sql/` - SQL layer (parser, optimizer, executor)
99+
- `/pkg/sql/opt` - Query optimizer and planner
100+
- `/pkg/sql/schemachanger` - Declarative schema changer
96101
- `/pkg/kv/` - Key-value layer and transaction management
97102
- `/pkg/storage/` - Storage engine interface
98103
- `/pkg/server/` - Node and cluster management

0 commit comments

Comments
 (0)