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

Validation plug-in for the Ale meta-programming approach in GEMOC Studio #34

Merged
merged 11 commits into from
May 8, 2020

Conversation

Kairides
Copy link
Contributor

@Kairides Kairides commented Apr 17, 2020

To perform validation on a DSL written in Ale during its creation, we have created an extension point allowing other plug-ins, such as this validation plug-in, to add validation rules to the DslValidator.

The validation plug-in for the Ale meta-programming approach contributes to the extension point from the validation plug-in in the GEMOC Studio. To contribute to the extension point, the Ale validation plug-in has to implement the IRuleProvider from the GEMOC validation plug-in and get a name to be easily distinguishable from another validation plug-in and used as the value of the "metaprog" entry.

ale_metaprog

The plug-in implements the interface IRuleProvider through the class AleRuleProvider, a class AleRule implementing the interface IRule is used for validation in the dsl as well as the EcoreRule, provided by the GEMOC plug-in, are used in this RuleProvider since the meta-programming approach uses an Ecore model.

Ale_class_diagram(v2)

The validation plug-in performs various validations , such as checking for the presence of an "ale" entry in the dsl file
ale_error
checking for the presence of an "ecore" entry since the RuleProvider uses the EcoreRule
ecore_error2
and checking for the presence of methods tagged "@main" and "@init" in the ale file.

Signed-off by Ronan Guéguen gueguen.ronan1@gmail.com

Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
@dvojtise
Copy link
Contributor

@dvojtise
Copy link
Contributor

Apparently there is something wrong in the pom.xml declarations

[ERROR] The project org.eclipse.gemoc.ale.interpreted.engine:org.eclipse.gemoc.ale.language.metaprogramming:1.0.1-SNAPSHOT (/home/jenkins/agent/workspace/io-integration_Kairides-metaprog/gemoc-studio-execution-ale/plugins/org.eclipse.gemoc.ale.language.metaprogramming/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.eclipse.gemoc.ale.interpreted.engine:org.eclipse.gemoc.ale.language.metaprogramming:1.0.1-SNAPSHOT: Could not find artifact org.eclipse.gemoc.ale.interpreted.engine:org.eclipse.gemoc.ale.language.metaprogramming:pom:1.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 7, column 12 -> [Help 2]

Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
@Kairides
Copy link
Contributor Author

Changed the artifactId, hope that will be enough.

Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
@Kairides
Copy link
Contributor Author

I realized I made a mistake when I changed the artifactId, it is now fixed so it should point to the correct parent: org.eclipse.gemoc.ale.interpreted.engine.plugins

Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
@dvojtise
Copy link
Contributor

dvojtise commented Apr 23, 2020

Apparently there is still something wrong in the build/deployment of your plugin (https://ci.eclipse.org/gemoc/job/gemoc-studio-integration/job/Kairides-metaprog/8/console):

[ERROR] Software being installed: org.eclipse.gemoc.gemoc_studio.branding.feature.feature.group 3.2.0.qualifier
[ERROR] Missing requirement: org.eclipse.gemoc.ale.interpreted.engine.feature.feature.group 1.0.1.qualifier requires 'org.eclipse.equinox.p2.iu; org.eclipse.gemoc.ale.language.metaprogramming 0.0.0' but it could not be found

To help you fix it, you can try to compile the studio locally following the instructions here : https://github.com/eclipse/gemoc-studio/tree/master/dev_support/full_compilation (which launch this script: https://github.com/eclipse/gemoc-studio/blob/master/dev_support/full_compilation/docker/scripts/build_gemoc.sh )

I recommend ignoring system tests since they are quite long. And focus on making sure that the studio builds correctly. (in the following command, it builds only the linux package using the -P test_linux profile)

mvn -P test_linux --projects !../../gemoc_studio/tests/org.eclipse.gemoc.studio.tests.system.lwb,!../../gemoc_studio/tests/org.eclipse.gemoc.studio.tests.system.mwb  clean install --errors  --show-version;

Additionally, once you have completed one full build, the -o (offline) option will help you save some more precious seconds/minutes.

Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
@Kairides
Copy link
Contributor Author

I have corrected the plugin's ID but I have a hard time running builds.
I hope that will be enough but at this point I don't know what to do.

Signed-off-by: Ronan Guéguen <gueguen.ronan1@gmail.com>
@ebousse
Copy link
Contributor

ebousse commented Apr 24, 2020

We got a successful build in the CI.

}

if(!tagNames.contains("init")) {
return (new Message("The Ale file does not contain an \"@init\" operation", Severity.ERROR));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think @init is mandatory
it is just "convenient"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You think a warning or an information would be more appropriate ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A warning should be OK

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the same goes for the K3 engine ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes ;-)

Signed-off by Ronan Guéguen <gueguen.ronan1@gmail.com>
@Kairides
Copy link
Contributor Author

I changed the severity for the check on the @init tag but sadly I messed up the commit's signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants