Avoid build-failures due to missing service-version segment increment #165
Replies: 4 comments 5 replies
-
I don't think m2e has to do anything here and it would be quite complicated to setup here, because the actual value of the build qualifier is irrelevant. You actually need two things what could be done in API tools itself:
Whenever anything in the binary build of a bundle changed (even if not an API problem) and the version is the same as in the baseline a micro-bump is required. |
Beta Was this translation helpful? Give feedback.
-
To make this really useful the required service-version bumps would also have to be computed for Features. |
Beta Was this translation helpful? Give feedback.
-
I don't think PDE can help here as it is not responsible of producing final binaries, and service release requires to compare binaries to decide whether it is necessary to change it or not. For example, just reparenting a pom file so |
Beta Was this translation helpful? Give feedback.
-
Just two trivial examples:
Beside that, just assume you fixed that in some smart way ... Qualifier changes are allowed! They re just not allowed (by some eclipse projects!) if, compared to the baseline the artifact has changed, so how do you know it has changed? So in the end it all boils down having run the (full) build in the background to get a normative answer, you also need to clone the git repositories and guess what the user will check in and then compare the artifacts.
Actually PDE can produce binaries, it might not do it exactly as the build but as described above, if we aim at that we need to actually build the artifact what is a way to complicated and I suspect people won't deserve the additional CPU and runtime cost of this. So it is better to aim at the 80% case here (how often do the scmURL changes?), so PDE already has the class output folder and it knows from the bin.includes what resources will go into the final jar and can compare if any of those has changed, and give a hint that a version bump might be required and let the final decisions to the build, because this will already cover most of the annoying cases we see. |
Beta Was this translation helpful? Give feedback.
-
A common problem contributors of Eclipse projects face are build failures due to missing service-version segment increments.
The build then fails with messages like
This is annoying and time-consuming for contributors and build servers because it leads to (at least) one more build to fix the version.
And even if one tries to anticipate such failures and checks if the version has already been bumped within a release cycle, this is an tedious, time consuming task.
There were already other attempts to reduce the response time (like eclipse-tycho/tycho#1018), but I would like to reduce the risk for build failure due to missing service-version segment increments to a minimum, maybe even zero.
My suggestion to tackle this problem is to enhance PDE's API-Tools to also detect the need for service version-increments.
Then one would get already get an error in the IDE indicating that the service version has to be incremented, just like one gets when a minor or major version bump is necessary. To enable this, API-Tools needs to know the build-qualifier of a Plug-in project and can then check if the build-qualifier changed in comparison to the baseline.
With recent changes in M2E starts to support polyglot projects (in the context of eclipse-m2e/m2e-core#119 or with eclipse-m2e/m2e-core#791) so M2E could compute the (expected) build-qualifier of a project while considering all configuration of the Tycho jgit-timestampt provider (like file exclusions, etc.). One drawback would be that it only works after a commit (unless M2E assume the build-qualifier is 'now' for files detected as changed by git). Another drawback would be time-zones (not sure if this a real issue since the qualifier of projects in the baseline is usually a bit older than just a few hours).
To let API-Tools know the build-qualifier it could provide an extension-point/OSGi-service for a
BuildQualifierProvider
and M2E could register such provider.This imitates one important task of Tycho's compare-version-with-baselines mojo is doing.
As an alternative approach @laeubi suggested to compute the service-version during the build:
Would we then just use a placeholder just like for
.qualifier
in the source?cc @vogella
Beta Was this translation helpful? Give feedback.
All reactions