Skip to content
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

Add ability to do binary comparison of IUs #12

Open
adietish opened this issue Aug 18, 2016 · 3 comments
Open

Add ability to do binary comparison of IUs #12

adietish opened this issue Aug 18, 2016 · 3 comments

Comments

@adietish
Copy link

We use embedded jar in our plugins. A typical situation where the current comparison strategies (default and deep) are falling short is where the embedded jar is SNAPSHOT but was updated. Neither of the current comparisons would then detect the new IUs would have to get published. A binary comparison would fix this.
@nickboldt cc

@adietish
Copy link
Author

@irbull @nickboldt I'd love to get your feedback on the following suggestion:
add a new mode "--mode=binary" that ignores IU versions but compares IU sha's and filesizes.

@nickboldt
Copy link
Contributor

nickboldt commented Aug 22, 2016

+1 for -mode=binary (one dash to be consistent w/ existing -mode=deep).

Artifacts.xml contains data such as for each IU. Note that the size is potentially different for the .pack.gz version of the same artifact, even after unpacking. So we should check both, I guess? Or just check the first one we find? (Aside: seems odd that the unpacked sizes are different.)

There is no digest, SHA or MD5 available in artifacts.xml or content.xml. We would have to compute these for the site and store that information in another metadata file, in order to be able to perform the diff. On the fly this would mean downloading both entire sites; if we cached the information for one side of the diff it would at least speed up the diff for CI builds but would still be painfully time- and bandwidth-intensive.

There is also no mention of classpath entries like lib/openshift-restclient-SNAPSHOT.jar.

So... we could try adding something into the p2 metadata for that IU (eg., using <touchpointData><instructions/></touchpointData> in content.xml?), which could then be compared against a previous build's site, and which could trigger a deeper comparison automatically for just those affected IUs.

(That would certainly be faster than downloading EACH and EVERY IU on the site.)

Perhaps we could store this information:
a) SNAPSHOT version, eg. 4.4.1.AM2-SNAPSHOT of deps/libs used in the build
b) actual maven version, eg., 4.4.1.AM2-20160817.171529-21
c) sha256sum of the unpacked IU (.jar, not .pack.gz)

This could be added when we're producing the site, eg., https://github.com/jbosstools/jbosstools-maven-plugins/blob/master/tycho-plugins/repository-utils/src/main/java/org/jboss/tools/tycho/sitegenerator/GenerateRepositoryFacadeMojo.java#L475

So we could add additional metadata to content.xml, and the sha256sums to artifacts.xml.

Or we could try to use p2.inf instructions to add all three pieces of information to content.xml, so the solution is more portable outside jbosstools/devstudio. Ref: https://wiki.eclipse.org/Equinox/p2/Customizing_Metadata

@nickboldt
Copy link
Contributor

Sample of p2.inf we could use to set metadata. jbosstools/jbosstools-openshift#1292

Ideally, tycho would create this information during the build. cc: @mickaelistria

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants