mirror of
https://github.com/allaunthefox/Research-Stack.git
synced 2026-07-31 03:05:21 +00:00
1.9 KiB
1.9 KiB
Danger PR Validation System
Overview
The Danger PR validation system provides automated quality checks for pull requests in the NoDupeLabs repository.
Components
1. Dangerfile
Location: /Dangerfile
The Dangerfile contains Python-based rules that validate:
- PR Size: Warns when PRs exceed 500 lines of code
- Commit Format: Ensures PR titles follow Conventional Commits
- API Stability: Flags modifications to core API files
- TODO Tracking: Warns about TODOs without issue references
- Documentation: Checks if documentation is updated when code changes
2. GitHub Actions Workflow
Location: .github/workflows/pr-validation.yml
The workflow:
- Triggers on PR events (opened, synchronized, reopened)
- Runs on Ubuntu latest
- Installs Python 3.10 and danger-python
3. API Check Script
Location: tools/core/api_check.py
A standalone tool that scans the codebase for API decorators.
Usage
For Contributors
- Create a pull request as usual
- The Danger workflow will automatically run
- Check the PR comments for any warnings
For Maintainers
- Review Danger warnings in PRs
- Use the API check script:
python3 tools/core/api_check.py
API Decorators
The system recognizes:
@stable_api: Stable, backwards-compatible APIs@beta_api: Beta APIs that may change@experimental_api: Experimental APIs@deprecated: APIs scheduled for removal
Testing
Run Danger Locally
DANGER_GITHUB_API_TOKEN=your_TOKEN_REMOVED danger-python ci
Test API Check Script
python3 tools/core/api_check.py
Troubleshooting
- Danger not running: Check workflow file location and GitHub TOKEN_REMOVED permissions
- Script not finding decorators: Verify decorator naming and file extensions