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

feat: warn about missing manifests and main classes #1217

Merged
merged 3 commits into from
May 9, 2023

Conversation

0utplay
Copy link
Member

@0utplay 0utplay commented May 7, 2023

Motivation

If a application does not contain a manifest reading the attributes will fail as the manifest is null. Same goes for the Main-Class, if the manifest does not contain a main class the main class is passed down into the process builder as null which will result in an exception that does not say anything about the main class as it furtherdown the execution chain.

Modification

Added a new method preCheckJarManifest that takes a nullable manifest and ensures that a manifest is present and the manifest contains a main class. Otherwise two exceptions are thrown for each case.

Result

It is clear what is the issue with the application jar and the service is deleted afterwards instead of staying prepared.

@0utplay 0utplay added v: 4.X This pull should be included in the 4.0 release in: node An issue/pull request releated to the node module code t: improvement The pull request improves existing code labels May 7, 2023
@0utplay 0utplay added this to the 4.0.0-RC9 milestone May 7, 2023
@0utplay 0utplay requested a review from derklaro May 7, 2023 08:01
@0utplay 0utplay self-assigned this May 7, 2023
@github-actions
Copy link

github-actions bot commented May 7, 2023

Test Results

  47 files  ±0    47 suites  ±0   1m 12s ⏱️ +2s
321 tests ±0  321 ✔️ ±0  0 💤 ±0  0 ±0 
651 runs  ±0  651 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 9e28c34. ± Comparison against base commit 859a7e7.

This pull request removes 16 and adds 16 tests. Note that renamed tests count towards both.
eu.cloudnetservice.driver.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"insane":"!","this":"is","hello":"world"}}, PRETTY
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [10] 21396, null
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [1] {test2=test3, test=test1}, class java.lang.String, class java.lang.String
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [2] GJJWJUPZ3KDNG2WGMMJFEZTHM, null
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [2] {test2=456, test=123}, class java.lang.String, class java.lang.Integer
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] 916995999, null
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] Lobbyhello156:0830ab70-e9ad-4796-a5ce-db4ea434ef4b
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] {test2=[678, 456], test=[123, 456]}, class java.lang.String, java.util.List<java.lang.Integer>
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [4] 9079842698101443442, null
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [4] Optional[{test2=test3, test=test1}], java.util.Map<java.lang.String, java.lang.String>
…
eu.cloudnetservice.driver.document.DocumentSerialisationTest ‑ [4] {"b":1,"s":2,"i":3,"l":4,"f":5.0,"d":6.0,"c":"/","string":"Hello, World!","bol":true,"cloud":["Ben?","Yes","No","HoHoHoHo"],"world":{"hello":"world","insane":"!","this":"is"}}, PRETTY
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [10] 20162, null
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [1] {test=test1, test2=test3}, class java.lang.String, class java.lang.String
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [2] LX9LPYHE5V89EDQ4JGVCJEJX5, null
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [2] {test=123, test2=456}, class java.lang.String, class java.lang.Integer
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] -1239873316, null
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] Lobbyhello156:45cc8a95-fc6f-4b53-a666-1e80604d0b17
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [3] {test=[123, 456], test2=[678, 456]}, class java.lang.String, java.util.List<java.lang.Integer>
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [4] -2118605919363802222, null
eu.cloudnetservice.driver.network.rpc.object.DefaultObjectMapperTest ‑ [4] Optional[{test=test1, test2=test3}], java.util.Map<java.lang.String, java.lang.String>
…

♻️ This comment has been updated with latest results.

@derklaro derklaro added this pull request to the merge queue May 9, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 9, 2023
@0utplay 0utplay added this pull request to the merge queue May 9, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 9, 2023
@0utplay 0utplay added this pull request to the merge queue May 9, 2023
Merged via the queue into nightly with commit 05236d2 May 9, 2023
@0utplay 0utplay deleted the warn-about-missing-manifest branch May 9, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: node An issue/pull request releated to the node module code t: improvement The pull request improves existing code v: 4.X This pull should be included in the 4.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants