|
| 1 | +# Automated Labeling Strategy |
| 2 | + |
| 3 | +This repository uses automated labeling for Pull Requests and Issues to improve organization and make it easier to identify the scope of changes. |
| 4 | + |
| 5 | +## Pull Request Labels |
| 6 | + |
| 7 | +PRs are automatically labeled based on the files changed: |
| 8 | + |
| 9 | +- **frontend** - Changes to Next.js/TypeScript frontend code in `frontend/` directory |
| 10 | +- **backend** - Changes to Python/FastAPI backend code in `backend/` directory |
| 11 | +- **dependencies** - Updates to dependencies (package.json, requirements.txt, etc.) |
| 12 | +- **ci/cd** - Changes to GitHub Actions workflows or CI/CD scripts |
| 13 | +- **documentation** - Changes to Markdown documentation files |
| 14 | +- **docker** - Changes to Docker configuration files (Dockerfile, docker-compose.yml) |
| 15 | +- **tests** - Changes to test files or test configuration |
| 16 | +- **configuration** - Changes to configuration files (linters, git config, etc.) |
| 17 | + |
| 18 | +### How It Works |
| 19 | + |
| 20 | +The PR labeler runs automatically when a PR is: |
| 21 | +- Opened |
| 22 | +- Updated (new commits pushed) |
| 23 | +- Reopened |
| 24 | + |
| 25 | +It uses the `.github/labeler.yml` configuration to match file paths to labels. The `sync-labels` option ensures labels are updated as the PR evolves. |
| 26 | + |
| 27 | +## Issue Labels |
| 28 | + |
| 29 | +Issues are automatically labeled based on keywords in the title and body: |
| 30 | + |
| 31 | +- **frontend** - Keywords: frontend, ui, interface, next.js, react, typescript, css, tailwind |
| 32 | +- **backend** - Keywords: backend, api, fastapi, python, database, sqlite, endpoint, service |
| 33 | +- **docker** - Keywords: docker, container, image, dockerfile, docker-compose |
| 34 | +- **ci/cd** - Keywords: ci/cd, workflow, github actions, deployment, pipeline |
| 35 | +- **documentation** - Keywords: documentation, readme, docs, guide, tutorial |
| 36 | +- **bug** - Keywords: bug, error, crash, fail, broken, issue, problem, not working |
| 37 | +- **enhancement** - Keywords: feature, enhancement, improvement, add, new, request, suggestion |
| 38 | +- **security** - Keywords: security, vulnerability, cve, exploit, unsafe |
| 39 | +- **performance** - Keywords: performance, slow, optimize, speed, latency, memory |
| 40 | +- **dependencies** - Keywords: dependency, dependencies, package, npm, pip, upgrade, update version |
| 41 | + |
| 42 | +### How It Works |
| 43 | + |
| 44 | +The issue labeler runs automatically when an issue is: |
| 45 | +- Opened |
| 46 | +- Edited |
| 47 | + |
| 48 | +It uses a GitHub Actions script to scan the issue title and body for relevant keywords and applies matching labels. |
| 49 | + |
| 50 | +## Manual Label Management |
| 51 | + |
| 52 | +While most labels are applied automatically, maintainers can still: |
| 53 | +- Add additional labels manually |
| 54 | +- Remove auto-applied labels if incorrect |
| 55 | +- Create custom labels for special cases |
| 56 | + |
| 57 | +## Benefits |
| 58 | + |
| 59 | +1. **Quick Identification**: See at a glance what areas of the codebase a PR affects |
| 60 | +2. **Better Organization**: Filter and search issues/PRs by component |
| 61 | +3. **Review Assignment**: Easily identify which team members should review |
| 62 | +4. **Release Notes**: Generate better changelogs grouped by component |
| 63 | +5. **Consistency**: Standardized labeling across all contributions |
| 64 | + |
| 65 | +## Configuration Files |
| 66 | + |
| 67 | +- `.github/labeler.yml` - PR labeling rules (path-based) |
| 68 | +- `.github/workflows/auto-label.yml` - PR labeling workflow |
| 69 | +- `.github/workflows/auto-label-issues.yml` - Issue labeling workflow |
| 70 | + |
| 71 | +## Customization |
| 72 | + |
| 73 | +To modify the labeling rules: |
| 74 | + |
| 75 | +1. Edit `.github/labeler.yml` for PR path-based rules |
| 76 | +2. Edit `.github/workflows/auto-label-issues.yml` to adjust issue keyword matching |
| 77 | +3. Test changes by creating a PR or issue |
| 78 | + |
| 79 | +For more information on the labeler syntax, see: |
| 80 | +- [actions/labeler documentation](https://github.com/actions/labeler) |
| 81 | +- [GitHub Actions documentation](https://docs.github.com/en/actions) |
0 commit comments