Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ jobs:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_PASS: ${{secrets.GPG_PASS}}
CGO_ENABLED: 0
GOEXPERIMENT: greenteagc
LDFLAGS: >-
-s
-X github.com/roadrunner-server/roadrunner/v2025/internal/meta.version=${{ steps.values.outputs.version }}
Expand Down
38 changes: 38 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Repository Guidelines

This guide helps contributors work efficiently on the RoadRunner core (Go) CLI and runtime.

## Project Structure & Module Organization
- `cmd/rr/`: CLI entrypoint (`main.go`) and basic CLI tests.
- `internal/`: CLI commands, debug helpers, metadata, RPC, service wiring.
- `lib/`: Public Go API to embed and control RoadRunner (`RR` type).
- `schemas/`: YAML schemas and config examples; `.rr.yaml` at repo root.
- `benchmarks/`, `container/`: Performance samples and container settings.
- Tests live alongside code as `*_test.go` files.

## Build, Test, and Development Commands
- `make build` — build the `rr` binary to `./rr`.
- `make test` — run `go test -v -race ./...` across modules.
- `./rr serve -c .rr.yaml` — run locally with the sample config.
- `dlv debug cmd/rr/main.go -- serve -c .rr-sample-bench-http.yaml` — debug run (needs Delve).
- `golangci-lint run` — lint/format per `.golangci.yml` (install locally).

## Coding Style & Naming Conventions
- Go 1.x standards: `gofmt`/`goimports`; tabs; 120‑char lines (see linter config).
- Package names: short, lower‑case; exported identifiers use Go’s `UpperCamelCase`.
- Errors: wrap with `%w`; prefer sentinel/typed errors; no panics in library code.
- Keep functions small; avoid globals (see `gochecknoglobals`); prefer context‑aware APIs.

## Testing Guidelines
- Use table‑driven tests; place in `*_test.go`. Call `t.Parallel()` where safe.
- Run with race detector and coverage: `go test -race -cover ./...`.
- Add tests for new CLI flags, config parsing, and plugin wiring. Keep fixtures minimal.

## Commit & Pull Request Guidelines
- Conventional commits: `feat:`, `fix:`, `chore:`, `docs:`, `refactor:`, `test:`, `ci:`.
- PRs must include: clear description, linked issues, test updates, and config/schema changes if applicable.
- Ensure `make test` and `golangci-lint run` pass; include usage examples for CLI‑related changes.

## Security & Configuration Tips
- Never commit secrets; prefer `.env` loaded via `DOTENV_PATH` or `--dotenv`.
- Debug server (`-d`) listens on `:6061`; avoid exposing in production.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ ENV LDFLAGS="-s \
-X github.com/roadrunner-server/roadrunner/v2025/internal/meta.version=$APP_VERSION \
-X github.com/roadrunner-server/roadrunner/v2025/internal/meta.buildTime=$BUILD_TIME"

# enable Go greentea GC experiment during build
ENV GOEXPERIMENT=greenteagc

# compile binary file
RUN set -x
RUN go mod download
Expand Down
Loading