Skip to content

Commit 301d75d

Browse files
Merge pull request #1: production readiness fixes
2 parents 5b073db + 863bbc3 commit 301d75d

93 files changed

Lines changed: 25187 additions & 2233 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ jobs:
6969
7070
- name: Run tests
7171
run: |
72-
go test -v -race -coverprofile=coverage.out -covermode=atomic ./pkg/...
72+
# The whole module: ./pkg/... alone skips the LangGraph conformance
73+
# suite and the Studio end-to-end suite under ./test/....
74+
go test -v -race -timeout 15m \
75+
-coverpkg=./pkg/... -coverprofile=coverage.out -covermode=atomic \
76+
./...
7377
env:
7478
POSTGRES_HOST: localhost
7579
POSTGRES_PORT: 5432
@@ -79,6 +83,28 @@ jobs:
7983
REDIS_HOST: localhost
8084
REDIS_PORT: 6379
8185

86+
- name: Fuzz smoke test
87+
run: |
88+
# A short run of each target: enough to catch a regression that makes a
89+
# fuzz target crash immediately, without lengthening CI.
90+
set -e
91+
for pkg_target in \
92+
"./pkg/core FuzzStateJSONRoundTrip" \
93+
"./pkg/core FuzzStateMarshalUnmarshal" \
94+
"./pkg/core FuzzDeepCopy" \
95+
"./pkg/core FuzzGraphRouting" \
96+
"./pkg/core FuzzGraphConstruction" \
97+
"./pkg/tools FuzzToolArguments" \
98+
"./pkg/tools FuzzPathResolution" \
99+
"./pkg/tools FuzzCommandPolicy" \
100+
"./pkg/tools FuzzURLPolicy" \
101+
"./pkg/server FuzzAPIRequestBodies" \
102+
"./pkg/server FuzzAPIPaths" ; do
103+
set -- $pkg_target
104+
echo "fuzzing $2 in $1"
105+
go test -run '^$' -fuzz "^$2$" -fuzztime=20s "$1"
106+
done
107+
82108
- name: Upload coverage to Codecov
83109
uses: codecov/codecov-action@v4
84110
with:
@@ -245,7 +271,7 @@ jobs:
245271

246272
- name: Run integration tests
247273
run: |
248-
go test -v -tags=integration ./test/e2e/...
274+
go test -v -race -timeout 15m ./test/e2e/...
249275
env:
250276
POSTGRES_HOST: localhost
251277
POSTGRES_PORT: 5432

‎.gitignore‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ bin/
66
*.so
77
*.dylib
88

9+
# Compiled example binaries. These were previously committed, adding ~100 MB of
10+
# platform-specific artifacts to every clone that could silently drift from the
11+
# source they were built from. Build them with `go build ./...` in the example.
12+
/examples/*/[0-9][0-9]-*
13+
!/examples/*/[0-9][0-9]-*/
14+
/examples/01-basic-chat/basic-chat
15+
/examples/02-react-agent/react-agent
16+
/examples/07-tools-integration/tools-integration
17+
/examples/08-production-ready/production-ready
18+
/examples/09-workflow-graph/workflow-graph
19+
/examples/streaming-demo/streaming-demo
20+
921
# Test binary, built with `go test -c`
1022
*.test
1123

‎.pre-commit-config.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ repos:
2626
name: Go Build
2727
description: Run go build on Go source files
2828
args: ["-buildvcs=false", "./pkg/..."]
29+
pass_filenames: false
2930
# Disabled due to PATH issues - using custom hook instead
3031
# - id: golangci-lint
3132
# name: golangci-lint

‎.secrets.baseline‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Dockerfile‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,14 @@ USER golanggraph
4747
# Expose port (adjust as needed)
4848
EXPOSE 8080
4949

50-
# Health check
51-
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
52-
CMD ./golanggraph health || exit 1
50+
# Health check.
51+
#
52+
# Probes the server's own endpoint rather than running a local dependency
53+
# scan: the container is healthy when it is serving. A plain "health" run
54+
# reports on dependencies, which is a different question and would mark a
55+
# perfectly serving container unhealthy whenever an optional one is absent.
56+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
57+
CMD ["./golanggraph", "health", "--server", "http://127.0.0.1:8080"]
5358

5459
# Run the binary
5560
ENTRYPOINT ["./golanggraph"]

‎Dockerfile.agent‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ WORKDIR /app
3737
# Copy the binary from builder stage
3838
COPY --from=builder /app/golanggraph-agent .
3939

40-
# Copy configuration files
41-
COPY configs/ ./configs/
42-
COPY static/ ./static/
43-
44-
# Create necessary directories and change ownership to non-root user
45-
RUN mkdir -p ./logs ./data && \
40+
# Create the directories the server may use. These were previously COPY'd from
41+
# configs/ and static/, which do not exist in the repository, so this image
42+
# could not be built at all. Mount or bake in real configuration as needed.
43+
RUN mkdir -p ./configs ./static ./logs ./data && \
4644
chown -R golanggraph:golanggraph /app
4745

4846
# Switch to non-root user
@@ -51,9 +49,13 @@ USER golanggraph
5149
# Expose port
5250
EXPOSE 8080
5351

54-
# Health check
55-
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
56-
CMD ./golanggraph-agent health || exit 1
52+
# Health check.
53+
#
54+
# Probes the server's own endpoint: the container is healthy when it is
55+
# serving. A local dependency scan is a different question and would mark a
56+
# perfectly serving container unhealthy whenever an optional service is absent.
57+
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
58+
CMD ["./golanggraph-agent", "health", "--server", "http://127.0.0.1:8080"]
5759

5860
# Run the agent
5961
ENTRYPOINT ["./golanggraph-agent"]

‎README.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,26 @@ if err != nil {
173173
fmt.Printf("🔄 Graph Result: %v\n", result.Get("response"))
174174
```
175175

176+
## 🔒 Production Deployment
177+
178+
Defaults favour local development. Before exposing GoLangGraph to real traffic,
179+
read **[docs/PRODUCTION.md](docs/PRODUCTION.md)**, which covers:
180+
181+
- **Authentication and CORS** — `RequireAuth` is off by default, and the allowed-origin list also governs WebSocket upgrades.
182+
- **Tool sandboxing** — filesystem confinement, the shell allowlist, and SSRF protection for the HTTP tool.
183+
- **Durable execution** — checkpointing, resume after a crash, and human-in-the-loop interrupts.
184+
- **Health checking** — which probe belongs in a container, and which does not.
185+
- **Typed errors, retries, concurrency and observability.**
186+
187+
LangGraph compatibility, including the places GoLangGraph intentionally
188+
differs, is documented in
189+
**[test/conformance/DEVIATIONS.md](test/conformance/DEVIATIONS.md)** and
190+
enforced by the conformance suite:
191+
192+
```bash
193+
go test -race ./test/conformance/...
194+
```
195+
176196
## 🏗️ Architecture
177197

178198
GoLangGraph follows a modular architecture:

0 commit comments

Comments
 (0)