CLI exits with code 0 when the generated meta-model or instance model is invalid
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
Start by grepping the CLI module for the literal [WARNING] Generated instance model failed validation string to find the validation handler, then look at the main entry point that converts the run into an exit code. The same place almost certainly handles the meta-model validation path (.ecore save plus the -t transform), so both branches need to report errors and return 1 instead of 0. Done means both reproduction commands in the issue exit with code 1 and the existing CLI tests still pass.
Written by the indexing model from the issue text.
Description
What happened
The CLI reports errors in the generated view type or view as plain output lines and still exits with code 0, so scripts and CI jobs cannot detect them:
- If the generated meta-model is invalid, the CLI prints the error, saves the
.ecorefile anyway, transforms the instance models against it (with-t) and exits with 0. - If the generated instance model is invalid, the CLI prints
[WARNING] Generated instance model failed validation:followed by the errors, saves the.xmifile and exits with 0.
Expected: both cases are errors. The CLI prints them as errors and exits with code 1.
How to reproduce
Invalid instance model: restaurant.ecore from test-resources (Restaurant.name is required), an instance model without a name, and this query:
export v to "http://example.org/v"
import "http://example.org/restaurant"
from Restaurant r create R {
r.name
}
<restaurant:Store xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:restaurant="http://example.org/restaurant">
<restaurants address="Main Street 1"/>
</restaurant:Store>
java -jar <cli>.jar -m <meta-model dir> -i <instance dir> -t out.xmi q.nj
Invalid meta-model: same meta-model, a query that names a class like the data type Money and copies an attribute of that data type:
from Food f create Money {
f.name
}
from Restaurant r create R {
r.dailyRevenue
}
java -jar <cli>.jar -m <meta-model dir> -g out.ecore q.nj
(After #213 this query is a validation error; the exit code is still wrong for any other error that the meta-model generator reports.)
Version
main at c4ff36c
Environment
Java 21 (Temurin), macOS
Logs
[WARNING] Generated instance model failed validation:
[ERROR] The required feature 'name' of 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl/http://example.org/v#R@4dad0eed{out.xmi#//@rs.0}' must be set
(exit code 0)
[ERROR] There may not be two classifiers named 'Money'
(exit code 0)
- Dominant language
- Java
- Stars
- 3
- Forks
- 6
- Avg merge
- 19h 10m
- Merged PRs (30d)
- 34
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vitruv-tools/NeoJoin
-
area: language
Difficulty 5/5 Over a week Newbie friendliness 18/100
vitruv-tools/NeoJoin#416 ·
Maintainers usually reply within 1 day
-
area: language status: needs discussion
Difficulty 5/5 Over a week Newbie friendliness 25/100
vitruv-tools/NeoJoin#409 ·
Maintainers usually reply within 1 day
-
area: language
Difficulty 4/5 3-5 days Newbie friendliness 48/100
vitruv-tools/NeoJoin#401 ·
Maintainers usually reply within 1 day
-
Complete JavaDocOpenarea: docs
Difficulty 5/5 Over a week Newbie friendliness 35/100
vitruv-tools/NeoJoin#395 ·
Maintainers usually reply within 1 day
-
area: language
Difficulty 5/5 Over a week Newbie friendliness 15/100
vitruv-tools/NeoJoin#357 ·
Maintainers usually reply within 1 day
All issues in vitruv-tools/NeoJoin
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
speakeasy-api/speakeasy#2159 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
jenkinsci/user-guide-ai-chatbot-plugin#132 ·
Maintainers usually reply within 6 days
-
account assessment course feature lecture
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
bug db/dameng user-priority/P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
docs: document identity-provider types compatibility for Keycloak 26.5+Possibly taken @Motouom claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
adorsys/keycloak-config-cli#1766 ·
Maintainers usually reply within 12 days