# Collections Under Version Control
## Rule
All Bruno collections MUST be committed to the same Git repository as the API they test. Collections must evolve alongside API code in the same pull requests.
## Directory Structure
```
project/
├── src/ # API source code
├── tests/ # Unit/integration tests
├── api-tests/ # Bruno collection (committed)
│ ├── bruno.json
│ ├── environments/
│ │ ├── dev.bru
│ │ ├── ci.bru
│ │ └── .gitignore # Exclude production.bru with real secrets
│ ├── Auth/
│ ├── Users/
│ └── Products/
├── .gitignore
└── package.json
```
## What to Commit
```gitignore
# .gitignore
# Commit these
# api-tests/**/*.bru
# api-tests/bruno.json
# api-tests/environments/dev.bru
# api-tests/environments/ci.bru
# Ignore these
api-tests/environments/production.bru
api-tests/environments/local.bru
```
## PR Requirements
- API endpoint changes MUST include corresponding Bruno test updates
- New endpoints MUST have at least success + error test cases
- Removed endpoints MUST have their Bruno tests deleted
- Collection structure changes require team review
## Anti-Patterns
- Bruno collections stored only on individual developer machines
- Collections in a separate repository from the API code
- No .gitignore for environment files with secrets
- API changes merged without updating corresponding tests
- Collections exported as JSON and stored in shared drives