-
Notifications
You must be signed in to change notification settings - Fork 121
Description
Currently one needs to configure API tools solely in the IDE what is repetitive and hard to discover by tools, also some aspects/rules can currently not be expressed and we need to enforce them manually.
I would therefore propose an additional way by using an .apiconfig file that works like .gitignores or .editorconfig where it uses the closes one found in the directory tree so for example especially put into the project tree root.
Apart form the usual things already configurable on the workspace and project we should support a new feature to describe version increment rules that works as follow:
- we have a setting for each segment of the OSGi version (major, minor, micro) e.g. it could be
micro.version.increment - Each of these setting allows to specify a segment and an increment (that must be positive) that should be applied when we detect a version change is needed, for example
micro.version.increment = micro+100means, whenever we detect a micro change is (semantically) needed, we suggest / require the micro-version to be incremented by 100 - It should be possible to choose a differing segment, e.g. we do not use major version increments at platform and therefore would like to configure it like
major.version.increment = minor+1to increment the minor segment by one instead even though we detect it requires a major increment - Each of these settings has an (optional) setting
major.version.errorthat can be used to control if set tofilterand we detect a problem automatically creates a commented API filter for that problem with "Suppressed ".
That way we would improve the user experience and allow tools like Tycho to suggest even version increments for API changes and reduce the need for defining API filters manually but still make it clear in a PR if there is an issue that requires special attention.
Tasks would be:
- Enhance the current config reader to look down the file hierarchy if it can find
.apiconfigfile, it should stop if it hits the eclipse workspace directory, or a set of "stop markers" like ".git" (this should be configurable in the preferences and default to.gitso we can enhance it later) - If such file is found, it must be parsed as a regular properties file and account to the current settings where project settings override setting in that config file
- We need ways to access the new
major.version.increment,minor.version.incrementandmicro.version.incrementand have a method that takes an OSGi version and the increment string, this should then be parsed and return an incremented version according to what is specified where any "lower" segment is reset to zero, e.g. if I have version 1.2.3 and apply minor+1 then I get 1.3.0 (the qualifier should be left unchanged) - The quickfixes should be enhanced to use that information to suggest proper increments in case an API problem was found like defined in the config
- The API check needs to be enhanced to take the
filterinto account to automatically create new filters if a problem should automatically be filtered.