-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Channel API cant handle multiple versions of same artifact #35
Comments
I'm not sure to understand what the issue is. Afaics, WildFly only requires a single version of Hibernate: https://github.com/wildfly/wildfly/blob/f8f05aede00ff12fad9a303f9b905f4ea90051eb/pom.xml#L433 |
I think multi-version support for Hibernate came to an end with https://issues.redhat.com/browse/WFLY-15607 We may see a need for multi-version support in EAP 8. Prior to this you would see the same as we would see on eap-7.4.x:
|
Its not tests per se. When maven kicks in, it builds project tree and populates deps from info it can find - be it compile, runtime or tests scope, does not matter.
|
@baranowb can you please expand on the issue? The Channel API main goal is to provision WildFly where we should have only 1 version of any Maven Artifact. |
For WFLY it might work as it does not need to bother with long lived versions. EAP on the other hand does not have luxury. Also, Im fairly sure one of key points in having channel defs is to be able to provision specific version/ranges so maven repository does not have to be sanitazed (as it is now) |
@baranowb Can you show me an example of a WildFly/EAP version where we were shipping different versions of the same The Channel API is meant to curate the latest version of a Maven |
@baranowb , we have different artifactId for hibernate jipijapa versions, each one referenced in a slot per hibernate version. Artifacts GA are different for different versions. So the problem you identified is not at provisioning time, right? The problem seems to be when building. We can build against different versions of the same GA. The extension/maven plugin that will resolve version from a channel and inject versions during the build will be impacted by that. Taking hibernate as an example, we have multiple versions for hibernate-core used at compile time. To compile jipijapa4.1 we use hibernate-core 4.2.13.Final, for jipijapa4.3 we use hibernate-core 4.3.10.Final). |
I would leave out the build phase. Yes we do have multiple versions of Hibernate in there, but this is because we want to support multiple API versions. |
The different versions of Hibernate are used for testing. They should have a Depending on their scope, some of these artifacts will not be fetched through the channel library. |
@wolfc , where are these tests located? I can only find tests in the repo that test the latest hibernate version. |
https://github.com/wildfly/wildfly/tree/25.0.0.Final/jpa (and its EAP fork) |
@wolfc , thank-you. That is where I found the various versions of hibernate (for example: https://github.com/wildfly/wildfly/blob/25.0.0.Final/jpa/hibernate4_3/pom.xml#L19) but I missed the test dir in hibernate4_3. The build and test inside this module are both depending the same dependency on hibernate-core. What is specific to tests? |
You can see in the stacktrace I posted earlier how each module is affected individually. |
@wolfc , I think we are on the same page. By using a single version of hibernate-core (the one in the channel), we break the transformer test compilation that expect 5.1, and each jipijapa_4x that expect a given 4.x version. The way the hibernate4_3 module is designed, only a single version is used for both build (API contract) and tests. But in the end, can't it be fixed in the maven plugin/extension that inject the versions? If it does the resolution in the parent project (raw thinking), the sub modules that override the version (the hibernate modules that do that) should override what the extension/plugin has injected. Similar to what occurs without the plugin. No? |
I want to comment on the maven plugin point of view (as oppose to the extension). Currently, executing the plugin would likely lead to this same issue. The plugin now works in a way that all project submodules are processed (their dependencies upgraded), but that's mostly because I wasn't sure what is the most suitable way the plugin should work. This shows that perhaps more reasonable default mode of operation would be that only the (execution) root module is processed, as @jfdenise suggested. The plugin could also make this configurable. In general I agree that the plugin should provide enough flexibility to workaround such issues. I think we will also need an ability to exclude particular streams from being applied, avoid upgrading dependencies to the project submodules, etc. It very much depends on particular use case. |
That's a fundamental flaw. Provisioning cant happen without testing(and in case of our CI, build phase). Because you cant be sure if provisioning of certain version wont break something. There are two distinct flows:
From POV of extension/plugin there is no way to determine which modules should not be processed(or so to say relevant way, other than 'scope') - its either all or non/blacklisting, which makes no sense. |
@baranowb , do you have some examples of that with 7.4? The only reference I found on dealing with artifacts with multiple versions was hibernate, and in this case the versions are hardcoded in the submodule. So the hardcoded value should still win. Do we have other cases? |
Any progress on resolving this issue? Will this be closed or are we planning changes to the channels specification? |
We can keep this issue as an enhancement but we don't need to fix it for our initial release. |
@baranowb Are you okay with that? |
* add a `stream.versions` field to be able to configure different * versions for the same artifact. This field is an object. Its keys are regular expressions that matches the base version of the artifact. The values are regular expressions that determins the latest version of the given base version As an example: ``` streams: - groupId: "io.undertow" artifactId: "undertow-core" versions: "\Q1.0.0.Final\E": "\Q1.0.0.Final\E" "\Q2.0.0.Final\E": "2\..*" ``` For the base version `1.0.0.Final`, it would also fetch the `1.0.0.Final` version. For the base version `2.0.0.Final`, it would fetch the latest version that matches `2\..*` (eg `2.3.4.Final`) This fixes wildfly-extras#35 Signed-off-by: Jeff Mesnil <[email protected]>
* add a `stream.versions` field to be able to configure different * versions for the same artifact. This field is an object. Its keys are regular expressions that matches the base version of the artifact. The values are regular expressions that determins the latest version of the given base version As an example: ``` streams: - groupId: "io.undertow" artifactId: "undertow-core" versions: "\Q1.0.0.Final\E": "\Q1.0.0.Final\E" "\Q2.0.0.Final\E": "2\..*" ``` For the base version `1.0.0.Final`, it would also fetch the `1.0.0.Final` version. For the base version `2.0.0.Final`, it would fetch the latest version that matches `2\..*` (eg `2.3.4.Final`) This fixes wildfly-extras#35 Signed-off-by: Jeff Mesnil <[email protected]>
For instance EAP has distinct tests for hibernate:
There is no way to lookup muzzled versions, unless you ignore channels and do plain maven lookup.
The text was updated successfully, but these errors were encountered: