This guide explains how to write valid commit messages for this repository and how to fix validation errors.
All commit messages must include a description with a Resolves: line in one of these formats:
Note: This validation supports any issue tracking system that uses the
PREFIX-NUMBERformat (e.g., MTV-123, DPP-17811, CCSINTL-298, JIRA-456, etc.). The PREFIX must be uppercase letters and NUMBER must be digits.
Resolves: MTV-123
Resolves: DPP-17811
Resolves: CCSINTL-298
Resolves: JIRA-456
Resolves: MTV-3111 | Add validations for VDDK and RCM
Resolves: DPP-17811 | Fix authentication bug
Resolves: CCSINTL-298 | Update payment processing
Space-separated:
Resolves: MTV-123 MTV-456
Resolves: DPP-17811 DPP-17812
Resolves: MTV-123 DPP-456 CCSINTL-789
Resolves: MTV-123 MTV-456 | Fix multiple authentication issues
Comma-separated:
Resolves: MTV-123, MTV-456
Resolves: DPP-17811,CCSINTL-298
Resolves: MTV-123, DPP-456, CCSINTL-789
Resolves: MTV-123, MTV-456 | Authentication and authorization fixes
"And" separated:
Resolves: MTV-123 and MTV-456
Resolves: DPP-17811 and CCSINTL-298
Resolves: MTV-123 and DPP-456 and CCSINTL-789
Resolves: MTV-123 and MTV-456 | Complete authentication system overhaul
Resolves: None
- Do NOT mix separator styles in the same line (e.g.,
MTV-123, MTV-456 and DPP-789is invalid) - Issue numbers must be numeric (e.g.,
MTV-abcorDPP-xyzis invalid) - Issue prefixes must be uppercase (e.g., use
MTV-123notmtv-123) - Issue format:
PREFIX-NUMBERwhere PREFIX is uppercase letters and NUMBER is digits - The
Resolves:line can appear anywhere in the commit message body - You can mix different issue types in the same line (e.g.,
MTV-123 DPP-456) - Optional descriptions can be added after
|(pipe with spaces):Resolves: MTV-123 | Description
Fix user authentication bug
Updated the login validation to handle edge cases properly.
This resolves issues with special characters in passwords.
Resolves: MTV-456
Add new dashboard features
Implemented user dashboard with analytics and reporting.
Added export functionality and improved UI responsiveness.
Resolves: DPP-17811, CCSINTL-298, MTV-125
Integrate payment processing system
Connected the new payment gateway and updated checkout flow.
Fixed currency conversion issues for international users.
Resolves: DPP-17811 and CCSINTL-298 | Payment system integration
chore: update dependencies
Resolves: None
This validation works with any issue tracking system that follows the PREFIX-NUMBER format:
- MTV: MTV-123, MTV-4567
- DPP: DPP-17811, DPP-20001
- CCSINTL: CCSINTL-298, CCSINTL-1000
- JIRA: JIRA-456, JIRA-789
- GitHub Issues: GH-123, ISSUE-456
- Custom prefixes: Any uppercase letters followed by dash and numbers
The following commits are automatically skipped and don't need Resolves: lines:
- Bot users: dependabot, renovate, github-actions, ci, automated, etc.
- Chore commits: Messages containing
chore:orchore(format
git commit --amend
# Edit your commit message to include a 'Resolves:' linegit rebase -i HEAD~N # where N is the number of commits to go back
# Mark commits as 'edit' or 'reword' to fix them- Fix the commits using the methods above
- Force push:
git push --force-with-lease
Problem: Your commit only has a subject line.
Solution: Add a description with a Resolves: line:
git commit --amend -m "Your subject line
Add your description here explaining what was changed.
Resolves: MTV-XXXX"Problem: The Resolves: line doesn't match the required format.
Examples of invalid formats:
Resolves: MTV-(missing number)Resolves: mtv-123(lowercase prefix)Resolves: MTV-abc(non-numeric issue number)Resolves: MTV-123, MTV-456 and DPP-789(mixed separators)Resolves: 123-MTV(wrong format - number before prefix)
Solution: Replace with a valid format from the examples above.
You can test your commit messages locally using:
npm run validate-commits # Validate latest commit
npm run validate-commits-range "HEAD~5..HEAD" # Validate last 5 commits
./scripts/validate-commits.sh --verbose # Show detailed outputPlease be aware that as these changes become more familiar to those who contribute to this product conforming to this format will become more important At a later date omitting the valid messages and committing will break CI as well as various other automation & tooling. This will make the lives of those who work on CI, QE, and documentation much more difficult so please be aware of this criticality moving forward.
If you're still having trouble with commit message validation:
- Check the specific error message for details about what's wrong
- Review the examples in this guide
- Use the quick fix commands above to amend your commits
- Test locally with the validation script before pushing
For questions about this validation process, please reach out to the development team.