Skip to content

Commit 416e80a

Browse files
committed
Update README to reference the make targets
Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
1 parent 4552d64 commit 416e80a

File tree

2 files changed

+107
-15
lines changed

2 files changed

+107
-15
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help build test lint lint-fix validate validate-schemas validate-examples integration-test check dev clean docker publisher coverage
1+
.PHONY: help build test lint lint-fix validate validate-schemas validate-examples integration-test check dev-local dev-compose clean docker publisher coverage
22

33
# Default target
44
help: ## Show this help message
@@ -48,10 +48,10 @@ lint-fix: ## Run linter with auto-fix (includes formatting)
4848
check: lint validate test ## Run all checks (lint, validate, test)
4949

5050
pre-commit: check integration-test ## Run all pre-commit checks
51-
@echo "All pre-commit checks passed!"
51+
@echo "All pre-commit checks passed!"
5252

5353
# Development targets
54-
dev: ## Start development environment with Docker Compose
54+
dev-compose: ## Start development environment with Docker Compose
5555
docker compose up
5656

5757
dev-local: ## Run registry locally (requires MongoDB)
@@ -67,4 +67,4 @@ clean: ## Clean build artifacts and coverage files
6767
coverage: ## Generate test coverage report
6868
go test -v -race -coverprofile=coverage.out -covermode=atomic ./internal/...
6969

70-
.DEFAULT_GOAL := help
70+
.DEFAULT_GOAL := help

README.md

Lines changed: 103 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ For development:
3939
The easiest way to get the registry running is to use `docker compose`. This will setup the MCP Registry service, import the seed data and run MongoDB in a local Docker environment.
4040

4141
```bash
42+
# Build the Docker image
43+
make docker
44+
4245
# Run the registry and MongoDB with docker compose
43-
docker compose up --build
46+
make dev-compose
4447
```
4548

4649
This will start the MCP Registry service and MongoDB with Docker, exposing it on port 8080.
@@ -51,27 +54,68 @@ If you prefer to run the service locally without Docker, you can build and run i
5154

5255
```bash
5356
# Build a registry executable
54-
go build ./cmd/registry
57+
make build
5558
```
5659
This will create the `registry` binary in the current directory. You'll need to have MongoDB running locally or with Docker.
5760

5861
By default, the service will run on `http://localhost:8080`.
5962

6063
## Development
6164

65+
### Available Make Targets
66+
67+
To see all available make targets:
68+
69+
```bash
70+
make help
71+
```
72+
73+
Key development commands:
74+
75+
```bash
76+
# Build targets
77+
make build # Build the registry application
78+
make publisher # Build the publisher tool
79+
make docker # Build Docker image
80+
81+
# Development
82+
make dev-compose # Start development environment with Docker Compose
83+
make dev-local # Run registry locally (requires MongoDB)
84+
85+
# Testing
86+
make test # Run unit tests with coverage
87+
make integration-test # Run integration tests
88+
make test-endpoints # Test API endpoints (requires running server)
89+
make test-publish # Test publish endpoint (requires BEARER_TOKEN)
90+
91+
# Code quality
92+
make lint # Run linter (same as CI)
93+
make lint-fix # Run linter with auto-fix
94+
95+
# Validation
96+
make validate-schemas # Validate JSON schemas
97+
make validate-examples # Validate examples against schemas
98+
make validate # Run all validation checks
99+
100+
# Combined workflows
101+
make check # Run all checks (lint, validate, test)
102+
make pre-commit # Run all pre-commit checks (includes integration tests)
103+
104+
# Utilities
105+
make coverage # Generate test coverage report
106+
make clean # Clean build artifacts and coverage files
107+
```
108+
62109
### Linting
63110

64111
The project uses golangci-lint with extensive checks. Always run linting before pushing:
65112

66113
```bash
67114
# Run all linters (same as CI)
68-
golangci-lint run --timeout=5m
69-
70-
# Check formatting
71-
gofmt -s -l .
115+
make lint
72116

73-
# Fix formatting
74-
gofmt -s -w .
117+
# Run linter with auto-fix
118+
make lint-fix
75119
```
76120

77121
### Git Hooks (Optional)
@@ -333,19 +377,67 @@ The service can be configured using environment variables:
333377

334378
## Testing
335379

336-
Run the test script to validate API endpoints:
380+
### Unit Tests
337381

338382
```bash
339-
./scripts/test_endpoints.sh
383+
# Run unit tests with coverage
384+
make test
385+
386+
# Generate coverage report
387+
make coverage
340388
```
341389

342-
You can specify specific endpoints to test:
390+
### Integration Tests
391+
392+
```bash
393+
# Run integration tests
394+
make integration-test
395+
```
396+
397+
### API Endpoint Testing
398+
399+
```bash
400+
# Test API endpoints (requires running server)
401+
make test-endpoints
402+
```
403+
404+
You can also run the script directly with specific endpoints:
343405

344406
```bash
345407
./scripts/test_endpoints.sh --endpoint health
346408
./scripts/test_endpoints.sh --endpoint servers
347409
```
348410

411+
### Publish Endpoint Testing
412+
413+
```bash
414+
# Test publish endpoint (requires BEARER_TOKEN env var)
415+
make test-publish
416+
```
417+
418+
### Validation
419+
420+
```bash
421+
# Validate JSON schemas
422+
make validate-schemas
423+
424+
# Validate examples against schemas
425+
make validate-examples
426+
427+
# Run all validation checks
428+
make validate
429+
```
430+
431+
### Comprehensive Testing
432+
433+
```bash
434+
# Run all checks (lint, validate, test)
435+
make check
436+
437+
# Run all pre-commit checks (includes integration tests)
438+
make pre-commit
439+
```
440+
349441
## License
350442

351443
See the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)