eclipse-tycho / tycho

Tycho project repository (tycho)
https://tycho.eclipseprojects.io
Eclipse Public License 2.0
170 stars 189 forks source link

tycho-baseline-plugin false positive #1932

Closed Bananeweizen closed 1 year ago

Bananeweizen commented 1 year ago

Trying to compile m2e with a Tycho snapshot (of today) gives me this:

[INFO] --- tycho-baseline-plugin:4.0.0-SNAPSHOT:verify (baseline-check) @ org.eclipse.m2e.profiles.core ---
[ERROR] ┌──────────────────────────┬──────────────────────────┬──────────────────────────┬─────────────────────────┬─────────────────────────┬─────────────────────────┐
[ERROR] │Delta                     │Type                      │Name                      │Project Version          │Baseline Version         │Suggested Version        │
[ERROR] ├──────────────────────────┼──────────────────────────┼──────────────────────────┼─────────────────────────┼─────────────────────────┼─────────────────────────┤
[ERROR] │MICRO                     │RESOURCES                 │org.eclipse.m2e.profiles.c│2.1.0                    │2.1.0                    │2.1.100                  │
[ERROR] │                          │                          │ore-2.1.0-SNAPSHOT.jar    │                         │                         │                         │
[ERROR] ├──────────────────────────┼──────────────────────────┼──────────────────────────┴─────────────────────────┴─────────────────────────┴─────────────────────────┤
[ERROR] │..CHANGED                 │RESOURCE                  │about.html
                                               │
[ERROR] ├──────────────────────────┴──────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────┤
[ERROR] │different
                                               │
[ERROR] └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
[ERROR] C:\dev\m2e\git\m2e-core\org.eclipse.m2e.profiles.core [0:0]: Baseline problems found! Project version: 2.1.0.20221110-1338, baseline version: 2.1.0.20221110-1338, suggested version: 2.1.100

The about.html hasn't changed. If I read the code of the baseline plugin right, it does a strict byte comparison. That will fail, if people have local git line ending conversions enabled (which is probably the case on my Windows machine).

laeubi commented 1 year ago

Yes currently we have no comparator that compares html documents semantically.

Do you like to add one (similar to XmlComparator ) e.g. based on this: https://stackoverflow.com/questions/47310845/compare-two-html-documents-using-jsoup-java ?

Bananeweizen commented 1 year ago

No, that's way to complicated for the problem at hand. The html can simply be handled by the XML comparator, too, since this is only about ignoring whitespace for now. Can two roles be specified for the same component by adding a second line?

That being said, if the problem is actually the git line ending normalization, then adding that HTML comparator will also not help in the long run...

laeubi commented 1 year ago

HTML is not XML so it won't work. but maybe one can simply disable eol conversions for html files: https://stackoverflow.com/a/39461324/9503281