Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 392716 - Compute product qualifier based on inclusions
Summary: Compute product qualifier based on inclusions
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Thanh Ha CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 390721
  Show dependency tree
 
Reported: 2012-10-24 03:51 EDT by Uwe Stieber CLA
Modified: 2021-04-28 16:54 EDT (History)
4 users (show)

See Also:


Attachments
Product Qualifier Test patch (Work in progress) (4.13 KB, patch)
2012-11-30 16:19 EST, Thanh Ha CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Stieber CLA 2012-10-24 03:51:39 EDT
With Tycho 0.16 we've switched to the long awaited reproducable version qualifiers, but it fails to update the products artifact version qualifier correctly. The algorithm for product version qualifier used on "product-export" does not consider the version qualifier of the dependencies. Therefore the product version qualifier does not change even if one of the dependent features changed. This does kill the "Check for Updates" functionality as it cannot find any newer version for the product being installed.

In example, the last commit to the a.b.c.repo project where the .product file lives is from 09.10.2012, 07:05. The product file declares a dependency to a.b.c.feature, where the last commit is from 22.10.2012, 10:34. The feature is rebuild and gets a new identifier, a.b.c.feature_1.0.0.201210221034, but the product artifact stays at the original qualifier 1.0.0.201210090705. But the product artifact version qualifier should be bumped to the newest qualifier of the referenced dependencies as otherwise "Check for Updates" will offer/find an update again.
Comment 1 Igor Fedorenko CLA 2012-10-24 09:52:54 EDT
Please consider providing a quality patch.
Comment 2 Tobias Oberlies CLA 2012-10-26 04:56:22 EDT
@Igor: Please consider providing pointers so that the potential contributor has any chance to do this.

AFAIK, computing qualifiers based on the included artifacts is only implemented for features. The way this is done is that the eclipse-feature lifecycle (see [1]) uses the build-qualifier-aggregator goal. This goal would also need to be used for eclipse-repository, and it may be necessary to adapt the goal (implemented here [2]).

[1] /tycho-maven-plugin/src/main/resources/META-INF/plexus/components.xml
[2] /tycho-packaging-plugin/src/main/java/org/eclipse/tycho/buildversion/BuildQualifierAggregatorMojo.java
Comment 3 Thanh Ha CLA 2012-11-20 22:18:05 EST
I'm not sure if I overlooked anything but I was able to reuse the same code used by eclipse-feature to get the product to update based on inclusions. I tested this by rebuilding a product and feature from the Eclipse Platform project.

Unfortunately my Gerrit account does not seem to be working so I pushed my patch to github.

https://github.com/zxiiro/org.eclipse.tycho/commit/2d3cb8067a78ed392fcbfee88b4ac4921db16049
Comment 4 Tobias Oberlies CLA 2012-11-29 13:17:41 EST
I believe that the github change is in fact everything that is needed in the productive code. Still, I think it is worth extending the test org.eclipse.tycho.buildversion.BuildQualifierTest.testStableQualifier. (I've just pushed some comments to master which should make it quite a bit easier to understand the test.)

I think a good test case would be a product which includes feature02 (similar to feature). That project should by itself have a lower timestamp, so that it inherit the 1500 timestamp from feature02. @Thanh: Could you add this test case?

Could you also try to push to Gerrit again? I've fixed the URL in our contributor guide [1] (removing the "/p" from the URL). With the "/p", we also had Gerrit problems (bug 393735).

[1] http://wiki.eclipse.org/Tycho/Contributor_Guide
Comment 5 Thanh Ha CLA 2012-11-29 14:07:16 EST
(In reply to comment #4)
> @Thanh: Could you add this test case?

I'll take a look.

> Could you also try to push to Gerrit again?

I got the issues with my account sorted out. Gerrit link:

    https://git.eclipse.org/r/8941
Comment 6 Thanh Ha CLA 2012-11-30 10:14:12 EST
Looks like a product needs to at least include the o.e.equinox.launcher_*.jar IUs, which means to create a test case for this we'll need to point it to a repo that has them.

Would there be any issues with adding a p2 repository outside of Tycho to get these IUs?

Unless there is another way to create a minimum product that doesn't require outside repos. I'm open to suggestions.

Is there an example of a Tycho test case that uses product files that I could look at?
Comment 7 Thanh Ha CLA 2012-11-30 11:14:22 EST
I was able to find some examples in the tycho-its project and at a glance it seems some of them don't require the launchers as I had thought. I'll see if I can come up with something similar to this.
Comment 8 Thanh Ha CLA 2012-11-30 16:04:26 EST
How do I set the target platform in a Tycho test?

I'm getting an error "Could not resolve plugin org.eclipse.equinox.launcher_null" which seems like my target platform is being reported as null.

I tried adding the following to my product pom but it doesn't seem to help:

      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <version>${tycho-version}</version>
        <configuration>
          <environments>
            <environment>
              <os>linux</os>
              <ws>gtk</ws>
              <arch>x86</arch>
            </environment>
          </environments>
        </configuration>
      </plugin>
Comment 9 Thanh Ha CLA 2012-11-30 16:19:01 EST
Created attachment 224176 [details]
Product Qualifier Test patch (Work in progress)

Attached my work in progress for the Product Qualifier Test.
Comment 10 Tobias Oberlies CLA 2012-12-07 12:09:18 EST
@Thanh: I'm sorry for having sent you into this legacy (non-p2) resolver mess. If you may, I'll implement the test.
Comment 11 Tobias Oberlies CLA 2012-12-10 07:03:20 EST
I've deleted some legacy stuff to make your test possible. I included the test with the functional change as new patch set here: https://git.eclipse.org/r/#/c/8941/

Thanh: Is this change functionally sound for you? If yes, please vote with +1 and I'll merge it after our three day review waiting period.
Comment 12 Thanh Ha CLA 2012-12-10 09:07:48 EST
(In reply to comment #11)
> Thanh: Is this change functionally sound for you? If yes, please vote with
> +1 and I'll merge it after our three day review waiting period.

+1
Comment 13 Tobias Oberlies CLA 2012-12-14 08:32:22 EST
(In reply to comment #12)
> +1
I thought you'd vote in Gerrit, but apparently I didn't make myself clear. But I got the message ;-)

Fixed with 1da3f15 [1]. Thanh, thank you for the contribution.

[1] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=1da3f150f796b335f633d282057ffa68a94a19d0
Comment 14 Thanh Ha CLA 2012-12-14 09:29:14 EST
(In reply to comment #13)
> (In reply to comment #12)
> > +1
> I thought you'd vote in Gerrit, but apparently I didn't make myself clear.
> But I got the message ;-)
> 

Thanks Tobias, for my future reference, how would I vote on Gerrit? Do I add myself as a reviewer and then +1 on Code-Review? Or do I add my +1 as a comment?
Comment 15 Tobias Oberlies CLA 2013-01-11 05:44:28 EST
(In reply to comment #14)
> Thanks Tobias, for my future reference, how would I vote on Gerrit? Do I add
> myself as a reviewer and then +1 on Code-Review? Or do I add my +1 as a comment?
You don't need to add yourself as reviewer first. This happens automatically when you click review and either vote or add a comment. If you can express what you want to say through a vote, prefer that over comments.