elixir-europe / MARS

Multi-Repository Data Submission using ISA-JSON
MIT License
5 stars 4 forks source link

Build of isajson-ena on main branch failed #41

Closed xiaoranzhou closed 1 month ago

xiaoranzhou commented 1 month ago

I just tried to build a new ENA converter from the repository-services/isajson-ena and it failed. To reproduce the failed build, we could:

git clone https://github.com/elixir-europe/MARS test-mars cd test-mars/repository-services/isajson-ena ./gradlew build -x test Error message is:

> Task :spotlessJavaCheck FAILED

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':spotlessJavaCheck'.

> The following files had format violations:

      src/main/java/com/elixir/biohackaton/ISAToSRA/controller/WebinIsaToXmlSubmissionController.java

          @@ -8,9 +8,9 @@

           import·com.elixir.biohackaton.ISAToSRA.model.Investigation;

           import·com.elixir.biohackaton.ISAToSRA.model.IsaJson;

           import·com.elixir.biohackaton.ISAToSRA.model.Study;

          -import·com.elixir.biohackaton.ISAToSRA.sra.service.*;

           import·com.elixir.biohackaton.ISAToSRA.sra.model.MarsReceipt;

           import·com.elixir.biohackaton.ISAToSRA.sra.model.Receipt;

          +import·com.elixir.biohackaton.ISAToSRA.sra.service.*;

           import·com.fasterxml.jackson.databind.ObjectMapper;

           import·io.swagger.v3.oas.annotations.responses.ApiResponse;

           import·io.swagger.v3.oas.annotations.responses.ApiResponses;

          @@ -32,42 +32,36 @@

           @Slf4j

           @RestController

           public·class·WebinIsaToXmlSubmissionController·{

          -··@Autowired

          -··private·BioSamplesAccessionsParser·bioSamplesAccessionsParser;

          +··@Autowired·private·BioSamplesAccessionsParser·bioSamplesAccessionsParser;

          -··@Autowired

          -··private·WebinStudyXmlCreator·webinStudyXmlCreator;

          +··@Autowired·private·WebinStudyXmlCreator·webinStudyXmlCreator;

          -··@Autowired

          -··private·WebinExperimentXmlCreator·webinExperimentXmlCreator;

          +··@Autowired·private·WebinExperimentXmlCreator·webinExperimentXmlCreator;

          -··@Autowired

          -··private·WebinProjectXmlCreator·webinProjectXmlCreator;

          +··@Autowired·private·WebinProjectXmlCreator·webinProjectXmlCreator;

          -··@Autowired

          -··private·WebinRunXmlCreator·webinRunXmlCreator;

          +··@Autowired·private·WebinRunXmlCreator·webinRunXmlCreator;

          -··@Autowired

          -··private·WebinHttpSubmissionService·webinHttpSubmissionService;

          +··@Autowired·private·WebinHttpSubmissionService·webinHttpSubmissionService;

          -··@Autowired

          -··private·ObjectMapper·objectMapper;

          +··@Autowired·private·ObjectMapper·objectMapper;

          -··@Autowired

          -··private·ReceiptConversionService·receiptConversionService;

          +··@Autowired·private·ReceiptConversionService·receiptConversionService;

          -··@Autowired

          -··private·ReceiptMarsService·receiptMarsService;

      ... (62 more lines that didn't fit)

  Violations also present in 10 other files.

  Run './gradlew :spotlessApply' to fix these violations.

* Try:

> Run with --stacktrace option to get the stack trace.

> Run with --info or --debug option to get more log output.

> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 21s

7 actionable tasks: 6 executed, 1 up-to-date

Maybe there is a new way to build, which can be successful. It will be great is someone can help.

bedroesb commented 1 month ago

@kdp-cloud do you have an idea? Sorry if you already get notifications about the issues on MARS !

kdp-cloud commented 1 month ago

This is sunspot that complains that there's something wring with the formatting in the project. Simply running this should fix it:

./gradlew :spotlessApply

For completeness, I'll open a PR to hopefully avoid situations like this in the future.

xiaoranzhou commented 1 month ago

Yes thanks. after the ./gradlew :spotlessApply. it compiles. Maybe I should start a new issue. I tried to submit "biosamples-modified-isa.json" to a previous version of isajons-ena converter and also new compiled converter. But the conversion does not work. However, the old Test_BioHackathon_Investigation_after_BSD.json works.

Here is the error message. `2024-07-16 09:07:18.410 ERROR 477493 --- [nio-8042-exec-1] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [/isaena] threw exception

com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'biosamples': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')

at [Source: (String)"biosamples-modified-isa.json"; line: 1, column: 11]

at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2391) ~[jackson-core-2.13.4.jar!/:2.13.4]

`