
🚀 Breaking Changes: - Introduced new environment variables for GitLab API integration - Added validation script for PR checks - Updated package.json with new scripts for testing and formatting 📝 Details: - Added .prettierrc and .eslintrc.json for code formatting and linting - Created .env.example for environment variable setup - Updated CHANGELOG.md with recent changes - Added documentation for GitHub secrets setup
2.1 KiB
2.1 KiB
PR Validation Guide
Overview
All Pull Requests are now automatically tested and validated. Manual testing is no longer required!
Automated Validation Items
1. Build and Type Check
- TypeScript compilation success
- No type errors
2. Testing
- Unit Tests: API endpoints, error handling, authentication, etc.
- Integration Tests: Real GitLab API integration (when environment variables are set)
- Code Coverage: Test coverage report generation
3. Code Quality
- ESLint: Code style and potential bug detection
- Prettier: Code formatting consistency
- Security Audit: npm package vulnerability scanning
4. Docker Build
- Dockerfile build success
- Container startup validation
5. Node.js Version Compatibility
- Tested across Node.js 18.x, 20.x, and 22.x
GitHub Secrets Setup (Optional)
To enable integration tests, configure these secrets:
GITLAB_TOKEN_TEST
: GitLab Personal Access TokenTEST_PROJECT_ID
: Test GitLab project IDGITLAB_API_URL
: GitLab API URL (default: https://gitlab.com)
Running Validation Locally
You can run validation locally before submitting a PR:
# Run all validations
./scripts/validate-pr.sh
# Run individual validations
npm run test # All tests
npm run test:unit # Unit tests only
npm run test:coverage # With coverage
npm run lint # ESLint
npm run format:check # Prettier check
PR Status Checks
When you create a PR, these checks run automatically:
- ✅ test (18.x)
- ✅ test (20.x)
- ✅ test (22.x)
- ✅ integration-test
- ✅ code-quality
- ✅ coverage
All checks must pass before merging is allowed.
Troubleshooting
Test Failures
- Check the failed test in the PR's "Checks" tab
- Review specific error messages in the logs
- Run the test locally to debug
Formatting Errors
npm run format # Auto-fix formatting
npm run lint:fix # Auto-fix ESLint issues
Type Errors
npx tsc --noEmit # Run type check only
Dependabot Auto-merge
- Minor and patch updates are automatically merged
- Major updates require manual review