Add .apiconfig file support for configurable version increment rules and error handling #2028
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements support for a
.apiconfigfile that allows projects to configure API Tools version increment rules and error handling at the project level. This addresses the need for discoverable, version-controllable configuration that can be shared across all developers without relying on IDE-specific settings.Problem Statement
Currently, API Tools version increment rules are hardcoded and cannot be customized:
Solution
Introduces a
.apiconfigfile (similar to.gitignoreor.editorconfig) that projects can place in their root directory to configure version increment behavior.Format Example
Key Features
1. Custom Version Increment Rules
Configure how each semantic change level should increment version numbers:
major.version.increment = minor+1means when breaking changes are detected, suggest incrementing minor version instead of majormicro.version.increment = micro+100means increment micro by 100 instead of 12. Error Handling Modes
Control how version problems are reported:
error: Report as error (default, maintains existing behavior)warning: Report as warning for less strict enforcementignore: Don't report the problemfilter: Automatically create an API filter with explanatory comment (e.g., "Suppressed by .apiconfig: Breaking changes detected: ...")3. Project-Level Configuration
.api_filtersand.api_descriptionImplementation Details
New Classes
ApiConfigSettings: Data structure holding configurationVersionSegmentenum: MAJOR, MINOR, MICROErrorModeenum: ERROR, WARNING, IGNORE, FILTERVersionIncrementRuleclass: Defines target segment and increment amountApiConfigParser: Parser for.apiconfigfiles#commentsModified Classes
BaseApiAnalyzer: Core integration point.apiconfigon component analysiscalculateNewVersion()method uses configurationhandleVersionProblem()method applies error modeserror = filteris configuredTests
ApiConfigParserTests: Unit tests for parser (empty files, comments, whitespace, validation)ApiConfigVersionTests: Integration tests (default settings, custom increments, error modes)ApiToolsTestSuiteDocumentation
docs/APICONFIG.md: Comprehensive user guide with format specification, use cases, examples, migration guide, and troubleshooting.apiconfig.example: Example configuration file with Eclipse Platform patternIMPLEMENTATION_SUMMARY.md: Technical implementation details and design decisionsUse Cases
Eclipse Platform Pattern
Eclipse Platform doesn't use major version increments:
Service Release Pattern
Projects that increment micro by 100:
micro.version.increment = micro+100Lenient Development
Projects wanting warnings during early development:
Backward Compatibility
✅ Fully backward compatible:
.apiconfigwork exactly as before.api_filtersfiles continue to workTesting
✅ All unit and integration tests pass
✅ Code review completed with no issues
✅ Security checks passed (CodeQL)
✅ Example configuration file provided
✅ Comprehensive documentation included
Related Issues
Implements the feature request for
.apiconfigsupport with version increment rules and automatic filter generation.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
repo.eclipse.orgIf you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #2027
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.