Skip to content

Commit c4ceb4c

Browse files
committed
Fixing Readme
1 parent 998f480 commit c4ceb4c

3 files changed

Lines changed: 42 additions & 15 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ name: Build and Test
22

33
on:
44
push:
5-
branches: [ main, gh-action ]
5+
branches:
6+
- main
67
pull_request:
7-
branches: [ main ]
8+
types:
9+
- opened
10+
- reopened
11+
- synchronize
12+
- ready_for_review
813

914
jobs:
1015
build-and-test:

MODULE.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ module(
77
bazel_dep(name = "rules_go", version = "0.57.0")
88
bazel_dep(name = "gazelle", version = "0.45.0")
99
bazel_dep(name = "rules_proto", version = "7.1.0")
10-
bazel_dep(name = "rules_java", version = "8.14.0")
1110

1211
GO_VERSION = "1.24.5"
1312

README.md

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ make run-gateway
2525
# Using Go directly
2626
go run examples/server/gateway/main.go
2727

28-
# Using Bazel wrapper directly
28+
# Using Bazel (with direnv)
29+
bazel run //examples/server/gateway:gateway
30+
31+
# Or without direnv
2932
./tools/bazel run //examples/server/gateway:gateway
3033
```
3134

@@ -54,9 +57,26 @@ See [docs/architecture/STRUCTURE.md](docs/architecture/STRUCTURE.md) for a detai
5457
- **Go 1.24 or later** (optional, Bazel manages its own Go toolchain)
5558
- **protoc** and Go plugins (optional, only needed if modifying proto files)
5659
- **grpcurl** (optional, for manual testing)
60+
- **direnv** (recommended, to automatically load `.envrc`)
5761

5862
**Note**: The project includes `./tools/bazel` (bazelisk wrapper) and `.bazelversion`, so you don't need to install Bazel or Bazelisk separately.
5963

64+
#### Using direnv (Recommended)
65+
66+
Install direnv and allow the `.envrc` file:
67+
```bash
68+
# macOS
69+
brew install direnv
70+
71+
# Add to your shell profile (~/.zshrc or ~/.bashrc)
72+
eval "$(direnv hook zsh)" # or bash, fish, etc.
73+
74+
# In the project directory
75+
direnv allow
76+
```
77+
78+
With direnv enabled, you can use `bazel` directly instead of `./tools/bazel`.
79+
6080
Install optional tools:
6181
```bash
6282
# macOS
@@ -128,23 +148,26 @@ go build -o bin/speculator_client ./examples/client/speculator/
128148

129149
The project uses **Bzlmod** (not WORKSPACE) for dependency management. Bazel version is pinned at 8.4.1 in `.bazelversion`.
130150

131-
The project includes `./tools/bazel` which automatically downloads the correct Bazel version.
151+
The project includes `./tools/bazel` which automatically downloads the correct Bazel version. If you're using `direnv`, you can simply use `bazel` instead of `./tools/bazel`.
132152

133153
```bash
134-
# Build everything (using the wrapper)
154+
# Build everything (with direnv)
155+
bazel build //...
156+
157+
# Or without direnv
135158
./tools/bazel build //...
136159

137160
# Build specific components
138-
./tools/bazel build //gateway/protopb
139-
./tools/bazel build //gateway:gateway
140-
./tools/bazel build //examples/server/gateway:gateway
141-
./tools/bazel build //examples/client/gateway:gateway
161+
bazel build //gateway/protopb
162+
bazel build //gateway:gateway
163+
bazel build //examples/server/gateway:gateway
164+
bazel build //examples/client/gateway:gateway
142165

143166
# Run a server
144-
./tools/bazel run //examples/server/gateway:gateway
167+
bazel run //examples/server/gateway:gateway
145168

146169
# Run a client
147-
./tools/bazel run //examples/client/gateway:gateway -- -message "hello"
170+
bazel run //examples/client/gateway:gateway -- -message "hello"
148171

149172
# Or use the Makefile (recommended)
150173
make build
@@ -154,7 +177,7 @@ make run-gateway
154177
**Note**:
155178
- The repository uses Bzlmod for modern dependency management
156179
- All generated proto files are committed to the repository
157-
- Use `./tools/bazel` instead of `bazel` to ensure correct version
180+
- With `direnv` enabled, use `bazel` directly; otherwise use `./tools/bazel`
158181

159182
### Running Services
160183

@@ -336,6 +359,6 @@ bazel clean
336359

337360
**Bazel build issues:**
338361
- Bazel version is pinned to 8.4.1 in `.bazelversion`
339-
- Always use `./tools/bazel` wrapper (not `bazel` directly)
340-
- Try `./tools/bazel shutdown` and rebuild
362+
- With `direnv`, you can use `bazel` directly; otherwise use `./tools/bazel`
363+
- Try `bazel shutdown` (or `./tools/bazel shutdown`) and rebuild
341364
- The wrapper automatically downloads the correct Bazel version

0 commit comments

Comments
 (0)