|
| 1 | +<!-- List of authors who contributed to this decision. Include full names and roles if applicable. --> |
| 2 | +authors: |
| 3 | +- Martin Stühmer |
| 4 | + |
| 5 | +<!-- |
| 6 | +The patterns this decision applies to. Each entry is a glob pattern that matches files affected by this decision. |
| 7 | +--> |
| 8 | +applyTo: |
| 9 | +- "**/*.*" |
| 10 | + |
| 11 | +<!-- The date this ADR was initially created in YYYY-MM-DD format. --> |
| 12 | +created: 2025-07-10 |
| 13 | + |
| 14 | +<!-- |
| 15 | +The most recent date this ADR was updated in YYYY-MM-DD format. |
| 16 | +IMPORTANT: Update this field whenever the decision is modified. |
| 17 | +--> |
| 18 | +lastModified: 2025-07-14 |
| 19 | + |
| 20 | +<!-- |
| 21 | +The current state of this ADR. If superseded, include references to the superseding ADR. |
| 22 | +Valid values: proposed, accepted, deprecated, superseded |
| 23 | +--> |
| 24 | +state: accepted |
| 25 | + |
| 26 | +<!-- |
| 27 | +A compact AI LLM compatible definition of this decision. |
| 28 | +This should be a precise, structured description that AI systems can easily parse and understand. |
| 29 | +Include the core decision, key rationale, and primary impact in 1-2 concise sentences. |
| 30 | +--> |
| 31 | +instructions: | |
| 32 | + Adopt Conventional Commits 1.0.0 specification for structured commit messages with type, scope, and description format to enable automated semantic versioning and changelog generation. |
| 33 | + Required types include feat, fix, docs, style, refactor, test, chore, build, ci, perf, and revert with breaking change indicators. |
| 34 | +--- |
| 35 | +<!-- REQUIRED: Filename MUST follow the format: YYYY-MM-DD-Title (replace all spaces with hyphens) --> |
| 36 | +# Conventional Commits |
| 37 | + |
| 38 | +A decision to adopt the Conventional Commits specification for standardizing commit messages across the project to improve automation, semantic versioning, and change communication. |
| 39 | + |
| 40 | +## Context |
| 41 | + |
| 42 | +The project currently lacks a standardized approach to commit messages, which creates several challenges: |
| 43 | + |
| 44 | +1. **Inconsistent commit history**: Developers use different styles and formats for commit messages, making it difficult to understand the nature and impact of changes |
| 45 | +2. **Manual versioning**: Without structured commit messages, determining semantic version bumps requires manual analysis of changes |
| 46 | +3. **Changelog generation**: Creating release notes and changelogs is a manual process that is time-consuming and error-prone |
| 47 | +4. **Automated tooling limitations**: The lack of structured commit messages prevents the use of automated tools for CI/CD, semantic versioning, and release management |
| 48 | +5. **Communication gaps**: Unclear commit messages make it difficult for team members and stakeholders to understand the impact of changes |
| 49 | + |
| 50 | +The project already uses GitVersion (as evidenced by `GitVersion.MsBuild` in `Directory.Packages.props`) and follows centralized package management, indicating a preference for automation and structured development practices. |
| 51 | + |
| 52 | +## Decision |
| 53 | + |
| 54 | +We will adopt the [Conventional Commits 1.0.0 specification](https://www.conventionalcommits.org/en/v1.0.0/) for all commit messages in this project. |
| 55 | + |
| 56 | +**Commit Message Structure:** |
| 57 | +``` |
| 58 | +<type>[optional scope]: <description> |
| 59 | +
|
| 60 | +[optional body] |
| 61 | +
|
| 62 | +[optional footer(s)] |
| 63 | +``` |
| 64 | + |
| 65 | +**Required Types:** |
| 66 | +- `feat`: A new feature (correlates with MINOR in Semantic Versioning) |
| 67 | +- `fix`: A bug fix (correlates with PATCH in Semantic Versioning) |
| 68 | +- `BREAKING CHANGE`: Breaking API changes (correlates with MAJOR in Semantic Versioning) |
| 69 | + |
| 70 | +**Recommended Additional Types:** |
| 71 | +- `build`: Changes to build system or external dependencies |
| 72 | +- `chore`: Maintenance tasks that don't modify src or test files |
| 73 | +- `ci`: Changes to CI configuration files and scripts |
| 74 | +- `docs`: Documentation changes |
| 75 | +- `style`: Code style changes (formatting, missing semicolons, etc.) |
| 76 | +- `refactor`: Code changes that neither fix bugs nor add features |
| 77 | +- `perf`: Performance improvements |
| 78 | +- `test`: Adding or modifying tests |
| 79 | + |
| 80 | +**Implementation Guidelines:** |
| 81 | +- Commits MUST be prefixed with a type followed by an optional scope, optional `!`, and required terminal colon and space |
| 82 | +- Breaking changes MUST be indicated either by `!` after the type/scope or by including `BREAKING CHANGE:` in the footer |
| 83 | +- Scope MAY be provided to give additional context (e.g., `feat(api):`, `fix(parser):`) |
| 84 | +- Description MUST immediately follow the colon and space after the type/scope prefix |
| 85 | +- Body and footers are OPTIONAL and provide additional context when needed |
| 86 | + |
| 87 | +## Consequences |
| 88 | + |
| 89 | +**Positive Consequences:** |
| 90 | +1. **Automated versioning**: GitVersion and other tools can automatically determine semantic version bumps based on commit types |
| 91 | +2. **Automated changelog generation**: Tools can automatically generate changelogs and release notes from structured commit messages |
| 92 | +3. **Improved communication**: Clear, structured commit messages help team members and stakeholders understand the nature and impact of changes |
| 93 | +4. **Better CI/CD integration**: Automated tools can trigger appropriate build and deployment processes based on commit types |
| 94 | +5. **Consistent commit history**: Standardized format makes the project history more readable and searchable |
| 95 | +6. **Enhanced collaboration**: New contributors can quickly understand the commit convention and follow established patterns |
| 96 | + |
| 97 | +**Potential Challenges:** |
| 98 | +1. **Learning curve**: Team members need to learn and remember the conventional commit format |
| 99 | +2. **Enforcement overhead**: Initial effort required to establish tooling and processes to enforce the convention |
| 100 | +3. **Commit message length**: Some developers may need to adjust to writing more descriptive commit messages |
| 101 | +4. **Retroactive application**: Existing commit history will not follow the convention, creating inconsistency in historical data |
| 102 | + |
| 103 | +**Risk Mitigation:** |
| 104 | +- Implement commit message linting tools to validate format automatically |
| 105 | +- Provide training and documentation for team members |
| 106 | +- Use commit message templates in development environments |
| 107 | +- Consider squash-and-merge workflow for pull requests to allow maintainers to create properly formatted commit messages |
| 108 | + |
| 109 | +## Alternatives Considered |
| 110 | + |
| 111 | +### 1. Custom Commit Convention |
| 112 | + |
| 113 | +**Description**: Develop a project-specific commit message convention tailored to our needs. |
| 114 | + |
| 115 | +**Pros**: Complete control over format and requirements, can be optimized for specific project needs |
| 116 | + |
| 117 | +**Cons**: Requires documentation and training, no existing tooling support, reinventing the wheel, lacks community standards |
| 118 | + |
| 119 | +**Rejection Reason**: Conventional Commits is already a well-established standard with extensive tooling support |
| 120 | + |
| 121 | +### 2. Continue with Free-form Commit Messages |
| 122 | + |
| 123 | +**Description**: Maintain the current approach of allowing developers to write commit messages without specific formatting requirements. |
| 124 | + |
| 125 | +**Pros**: No learning curve, no enforcement overhead, developer freedom |
| 126 | + |
| 127 | +**Cons**: Inconsistent history, no automation benefits, poor communication, manual versioning and changelog generation |
| 128 | + |
| 129 | +**Rejection Reason**: Does not address the identified problems and prevents automation benefits |
| 130 | + |
| 131 | +### 3. GitHub Flow with Descriptive PR Titles |
| 132 | + |
| 133 | +**Description**: Focus on descriptive pull request titles and use squash merging to create clean commit messages. |
| 134 | + |
| 135 | +**Pros**: Reduces individual commit message burden, maintains clean main branch history |
| 136 | + |
| 137 | +**Cons**: Still lacks standardization, no automation benefits, requires manual formatting of squash commit messages |
| 138 | + |
| 139 | +**Rejection Reason**: Does not provide the structured format needed for automation tools |
| 140 | + |
| 141 | +### 4. Semantic Commit Messages (Alternative Format) |
| 142 | + |
| 143 | +**Description**: Use alternative structured commit formats like Angular commit convention or other semantic formats. |
| 144 | + |
| 145 | +**Pros**: Similar benefits to Conventional Commits, some tooling support |
| 146 | + |
| 147 | +**Cons**: Less standardized than Conventional Commits, smaller ecosystem, potential compatibility issues |
| 148 | + |
| 149 | +**Rejection Reason**: Conventional Commits is more widely adopted and has better tooling ecosystem |
| 150 | + |
| 151 | +## Related Decisions |
| 152 | + |
| 153 | +- [Centralized Package Version Management](./2025-07-10-centralized-package-version-management.md) - The adoption of centralized package management demonstrates the project's commitment to automation and standardization, which aligns with adopting Conventional Commits for automated versioning and release management |
| 154 | +- [GitVersion for Automated Semantic Versioning](./2025-07-10-gitversion-automated-semantic-versioning.md) - GitVersion is configured to parse conventional commit messages and automatically determine semantic version increments, making conventional commits essential for automated versioning to work correctly |
0 commit comments