antenna icon indicating copy to clipboard operation
antenna copied to clipboard

ORT Downloader: Update ORT dependency to match latest ORT Analyzer output

Open andreaslarfors opened this issue 4 years ago • 1 comments

Summary of the Bug

It is not currently possible to use analyzer_result.yml files from the latest version of ORT as input to Antenna with the ORT Downloader enabled. When updating the ort.rev value in pom.xml to any recent commit values, we get compilation errors:

2020-11-13T13:56:35.9752136Z [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project runtime: Compilation failure: Compilation failure: 
2020-11-13T13:56:35.9753046Z [ERROR] /usr/local/src/antenna/core/runtime/src/main/java/org/eclipse/sw360/antenna/util/LicenseSupport.java:[102,50] error: cannot find symbol
2020-11-13T13:56:35.9753528Z [ERROR]   symbol:   method component1()
2020-11-13T13:56:35.9753877Z [ERROR]   location: variable spdxLicenseIdExpression of type SpdxLicenseIdExpression
2020-11-13T13:56:35.9754417Z [ERROR] /usr/local/src/antenna/core/runtime/src/main/java/org/eclipse/sw360/antenna/util/LicenseSupport.java:[103,51] error: cannot find symbol
2020-11-13T13:56:35.9754867Z [ERROR]   symbol:   method component2()
2020-11-13T13:56:35.9755228Z [ERROR]   location: variable spdxLicenseIdExpression of type SpdxLicenseIdExpression
2020-11-13T13:56:35.9755763Z [ERROR] /usr/local/src/antenna/core/runtime/src/main/java/org/eclipse/sw360/antenna/util/LicenseSupport.java:[113,58] error: cannot find symbol
2020-11-13T13:56:35.9756206Z [ERROR]   symbol:   method component1()
2020-11-13T13:56:35.9756562Z [ERROR]   location: variable spdxCompoundExpression of type SpdxCompoundExpression
2020-11-13T13:56:35.9757177Z [ERROR] /usr/local/src/antenna/core/runtime/src/main/java/org/eclipse/sw360/antenna/util/LicenseSupport.java:[114,60] error: cannot find symbol
2020-11-13T13:56:35.9757624Z [ERROR]   symbol:   method component2()
2020-11-13T13:56:35.9757968Z [ERROR]   location: variable spdxCompoundExpression of type SpdxCompoundExpression

This is due to the refactoring of the Kotlin code in ORT: https://github.com/oss-review-toolkit/ort/commit/67db194b225a5eb7ea835954daae020d57fbb570 From data classes to regular classes, which no longer support the component1(), component2(), component3() methods. We also cannot access the fields from Java because the @JvmField has not been used so the fields are private to Java.

The core/runtime/.../antenna/util/LicenseSupport.java logic needs to be updated.

Steps to reproduce

  • Use the latest version of ORT Analyzer to generate a analyzer_result.yml file
  • Use the analyzer_result.yml as input file to Antenna
  • Enable the ORT Downloader
  • Antenna (ORT Downloader) will fail due to not recognizing fields 'processors' which was added to ORT Analyzer output.

Acceptance Criteria

  • [ ] Latest version of ORT Analyzer can be used as input for Antenna to update SW360.

Definition of Done

  • Acceptance criteria fulfilled
  • A test case is created to reproduce the bug
  • A PR is created, the CI infrastructure reports green, the bug test case proves that bug is fixed
  • The PR is reviewed and approved
  • No TODOs left in the code unless explained in the ticket, if something else is still open, this is summarized in a comment in the issue
  • Documentation is updated

andreaslarfors avatar Nov 13 '20 14:11 andreaslarfors

Thanks for the report @andreaslarfors. We're currently looking at ways to stop this mix between Antenna and the ORT Analyzer altogether. May I ask what you use-case for using Antenna is? Specifically, would you still need to use Antenna if https://github.com/oss-review-toolkit/ort/pull/3313 was implemented?

sschuberth avatar Nov 16 '20 12:11 sschuberth