223 lines
5.8 KiB
Markdown
223 lines
5.8 KiB
Markdown
# Sample Commit Messages for CI/CD Chaos
|
|
|
|
This file contains examples of commit messages that would be judged by the AI Commit Message Judge.
|
|
|
|
## Excellent Commit Messages (Grade A+)
|
|
|
|
### Conventional Commits
|
|
```
|
|
feat(auth): add OAuth2 integration for third-party providers
|
|
|
|
Implement OAuth2 authentication flow for Google, GitHub, and Microsoft
|
|
providers. This allows users to sign in using their existing accounts instead
|
|
of creating new credentials.
|
|
|
|
Technical details:
|
|
- Added OAuth2 client configuration
|
|
- Implemented token validation and refresh
|
|
- Created user profile synchronization
|
|
- Updated login UI with provider buttons
|
|
- Added security headers for CSRF protection
|
|
|
|
This addresses user feedback requesting easier sign-in options and should
|
|
increase user conversion rates.
|
|
|
|
BREAKING CHANGE: Removed basic authentication for new sign-ups
|
|
```
|
|
|
|
```
|
|
fix(api): resolve memory leak in user service
|
|
|
|
Fixed memory leak in user service where cached user objects were not properly
|
|
cleared from memory after session timeout. This was causing gradual memory
|
|
consumption increase leading to service restarts every 24 hours.
|
|
|
|
The issue was in the cache eviction logic where the cleanup task wasn't
|
|
properly removing expired entries from all cache layers.
|
|
|
|
Metrics show memory usage decreased by 40% after this fix.
|
|
```
|
|
|
|
### Well-Structured Feature
|
|
```
|
|
feat: implement real-time notifications
|
|
|
|
Add WebSocket-based real-time notification system that allows users to receive
|
|
instant updates for their activities. This replaces the previous polling-based
|
|
system and reduces server load by 60%.
|
|
|
|
Key features:
|
|
- Real-time message delivery
|
|
- Connection state management
|
|
- Offline message queuing
|
|
- Battery-efficient background syncing
|
|
- Push notification integration
|
|
|
|
Performance improvements:
|
|
- Reduced API calls from 6/min to 1/session
|
|
- Decreased server CPU usage by 25%
|
|
- Improved user experience with instant feedback
|
|
|
|
Closes #1234, #5678
|
|
```
|
|
|
|
## Good Commit Messages (Grade B)
|
|
|
|
### Clear and Concise
|
|
```
|
|
feat: add user profile caching
|
|
|
|
Implement Redis-based caching for user profiles to reduce database queries.
|
|
Cache keys include user ID and last modified timestamp for automatic invalidation.
|
|
```
|
|
|
|
```
|
|
fix: resolve login page styling issues
|
|
|
|
Fixed CSS compatibility issues with Safari and improved mobile responsiveness.
|
|
Added proper viewport meta tag and fixed flexbox layout problems.
|
|
```
|
|
|
|
## Needs Improvement (Grade C)
|
|
|
|
### Vague Description
|
|
```
|
|
update files
|
|
|
|
Updated several configuration files and added new logging functionality.
|
|
```
|
|
|
|
```
|
|
fix bug
|
|
|
|
Fixed the authentication bug that was preventing users from logging in.
|
|
```
|
|
|
|
## Poor Commit Messages (Grade D)
|
|
|
|
### Too Short
|
|
```
|
|
wip
|
|
```
|
|
|
|
```
|
|
stuff
|
|
```
|
|
|
|
### Too Long
|
|
```
|
|
I made a lot of changes to the codebase today. I fixed some bugs in the authentication system, added new features to the user interface, updated the database schema, modified the API endpoints, added unit tests, integrated third-party services, configured deployment settings, and updated documentation. This was a really big day of coding and I'm tired but proud of what I accomplished. The team will be happy with these improvements.
|
|
|
|
Let me break down what I did:
|
|
|
|
1. Authentication fixes
|
|
2. UI improvements
|
|
3. Database changes
|
|
4. API updates
|
|
5. Testing
|
|
6. Third-party integration
|
|
7. Deployment
|
|
8. Documentation
|
|
|
|
I think that covers everything. Let me know if you have any questions!
|
|
```
|
|
|
|
## Terrible Commit Messages (Grade F)
|
|
|
|
### Unprofessional
|
|
```
|
|
lol this commit fixes everything trust me
|
|
|
|
I don't know what I did but it works now. Magic!
|
|
```
|
|
|
|
```
|
|
why doesn't this work?????
|
|
|
|
I've been trying to fix this for hours. Maybe this will work?
|
|
```
|
|
|
|
### Violates Best Practices
|
|
```
|
|
Fixed the thing.
|
|
|
|
Not sure what I changed but it's working now.
|
|
Don't touch this code!
|
|
```
|
|
|
|
```
|
|
commit
|
|
|
|
This is a commit. Yes it is.
|
|
```
|
|
|
|
## Challenge Examples for Commit Message Judge
|
|
|
|
### The Conventional Commit Challenge
|
|
```
|
|
feat(payment): integrate Stripe payment processing
|
|
|
|
Add Stripe integration for processing credit card payments. Includes:
|
|
- Payment form validation
|
|
- Card tokenization
|
|
- Transaction processing
|
|
- Error handling
|
|
- Webhook integration for payment status updates
|
|
|
|
Implements requirements from payment processing specification.
|
|
```
|
|
|
|
### The Perfect Imperative Challenge
|
|
```
|
|
Refactor user service to improve code maintainability
|
|
|
|
Extract common functionality into helper methods and improve error handling.
|
|
Add comprehensive unit tests and update documentation.
|
|
```
|
|
|
|
### The Minimalist Masterpiece
|
|
```
|
|
Fix typo in user registration email template.
|
|
```
|
|
|
|
## Humorous Examples (That Still Follow Best Practices)
|
|
|
|
```
|
|
feat: add coffee machine integration to office dashboard
|
|
|
|
Connect office coffee machine to dashboard API for real-time monitoring.
|
|
Tracks coffee levels, brewing status, and maintenance needs.
|
|
|
|
Prevents developers from encountering empty coffee pots during critical coding sessions.
|
|
Should improve team productivity by 42% (unofficial metric).
|
|
```
|
|
|
|
```
|
|
fix: resolve infinite loop in Friday afternoon code
|
|
|
|
Fixed bug where Friday afternoon code created infinite loop due to
|
|
developer's brain being on weekend mode. Added proper exit condition.
|
|
|
|
Note: This only happens on Fridays between 4-6 PM. Coincidence? I think not.
|
|
```
|
|
|
|
## Testing Examples
|
|
|
|
### Test your commit messages with the AI Judge:
|
|
|
|
```bash
|
|
# Judge a single commit message
|
|
python3 scripts/commit-judge.py "feat: add user authentication system"
|
|
|
|
# Judge a multi-line commit message
|
|
python3 scripts/commit-judge.py "feat: add user authentication system
|
|
|
|
Implement JWT-based authentication with password hashing and session management.
|
|
Added security middleware and rate limiting to prevent brute force attacks."
|
|
|
|
# Generate a writing challenge
|
|
python3 scripts/commit-judge.py --challenge
|
|
```
|
|
|
|
Remember: Good commit messages help your team understand what changed and why.
|
|
The AI Commit Message Judge is here to help you improve your commit hygiene! 🎪 |