Microservice for automatically assigning reviewers to Pull Requests.
- Language: Go 1.22
- Database: MongoDB 7.0
- HTTP Router: Gorilla Mux
- Logging: Uber Zap
- Testing: Go testing + testify
- Containerization: Docker + Docker Compose
# Start all services
docker-compose up
## Convenient make commands (other commands can be found via make help)
# Stop and clean up
make docker-clean
# Start
make docker-upThe service will be available at http://localhost:8080
Note: If you already have a local MongoDB running on port 27017, Docker Compose will automatically use port 27018 for external access. Inside the Docker network, containers communicate via the standard port 27017.
# Install dependencies
make deps
# Build and run
make run
# Or simply:
go run ./cmd/serverMain commands (make help):
buildBuild binaryrunRun application locallytestRun tests with race detectortest-coverageShow test coveragelintCheck code with golangci-lintfmtFormat code (go fmt + goimports)verifyFull check: format + linter + testscleanRemove binaries and coveragedepsDownload and clean up dependenciesdocker-buildBuild Docker imagesdocker-upStart servicesdocker-up-detachedStart services (in background)docker-downStop and remove containersdocker-cleanFull cleanup: containers + volumes + imagesdocker-logsFollow container logshelpShow this help
POST /team/add- create teamGET /team/get- get team informationPOST /users/setIsActive- set user activity statusGET /users/getReview- get PRs assigned to userPOST /pullRequest/create- create Pull RequestPOST /pullRequest/merge- setMERGEDstatus for Pull RequestPOST /pullRequest/reassign- reassign reviewer
GET /health- check service health (not described in OpenAPI, only declared)GET /stats/user- user statistics
Code coverage: 87.5%
# Run all tests
make test
# View coverage
make test-coverageTests verify all main service scenarios including error handling and edge cases.
More details are described in scripts/k6/README.md
k6 is used for load testing. Tests are located in the scripts/k6/ folder:
Test results are saved to:
scripts/k6/results/- text reports directly from the terminal with k6 runsscripts/k6/k6-results/YYYY-MM-DD/- JSON results for analysis (local folder)scripts/k6/parse_results.py- script for parsing results
Load testing was performed on the following hardware:
Main specifications:
- CPU: Intel i3-7020U (4 cores) @ 2.3GHz
- RAM: 8GB
- OS: Arch Linux x86_64
The project is configured with GitHub Actions:
- go-ci.yml - building, testing and linting Go code
- docker-ci.yml - building Docker images
This project is distributed under the MIT License.