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

Make pattern language validation ignoreable #143

Open
eclipse-viatra-bot opened this issue Mar 12, 2024 · 2 comments · May be fixed by #160
Open

Make pattern language validation ignoreable #143

eclipse-viatra-bot opened this issue Mar 12, 2024 · 2 comments · May be fixed by #160
Labels
bugzilla Issues migrated from Eclipse bugzilla. Query Issues related to the query component of VIATRA, including runtime or pattern language issues.
Milestone

Comments

@eclipse-viatra-bot
Copy link

| --- | --- |
| Bugzilla Link | 582522 |
| Status | NEW |
| Importance | P4 enhancement |
| Reported | Oct 09, 2023 13:18 EDT |
| Modified | Oct 11, 2023 03:54 EDT |
| Reporter | Gabor Bergmann |

Description

Some pattern language diagnostic markers are intended to safeguard layperson end users from making mistakes that would lead to undesired or undefined behaviour. It would be desirable to allow a more informed user, one who knows what they are doing, to explicitly assume responsibility for them. This may allow VQL code to be generated and matchers to be initialized even for patterns which would otherwise receive validation errors.

A fully general solution would both make diagnostic levels configurable in general (globally or per project) as well as allow the user to manually declare instances where rules should be ignored.

However, at the very minimum, a few commonly frustrating validator rules should have associated pattern annotations to disable them:

The minimal solution could look as simple as a pattern annotation @IgnoreError(issueCode = "recursive_pattern_call")

@eclipse-viatra-bot eclipse-viatra-bot added bugzilla Issues migrated from Eclipse bugzilla. legacy Query Issues related to the query component of VIATRA, including runtime or pattern language issues. labels Mar 12, 2024
@eclipse-viatra-bot
Copy link
Author

By Zoltan Ujhelyi on Oct 10, 2023 10:37

As we have discussed today, we could aim for the following:

For the negative-recursion warning we could use a dedicated @SafeNegativeRecursion annotation to say the developer have checked the recursion and it works in the context of the given pattern (these checks cannot be done statically, so a specialized feature is necessary).

The EObjects inside the pattern we should be more careful about using such an annotation as it might make the specialized validation for local search/rete more complex than it should be and the valid set of cases could have been identified manually. We should think about to avoid having this feature backed in a way we might have to support indefinitely. Let me think about this.

@eclipse-viatra-bot
Copy link
Author

By Zoltan Ujhelyi on Oct 11, 2023 03:54

I was thinking about the issue of EObject checking, and I am okay with including a beta-grade, open-to-change-without-any-prior-notice workaround. Of course, we should clearly document in the annotation documentation that it is subject to change.

ujhelyiz pushed a commit that referenced this issue Mar 18, 2024
Introduced pattern annotations:
 - @SafeNegativeRecursion
 - @SafeModelObjectExpression

Change-Id: I4aae818677cc943de9517ebe0fd1ced4cffae83d
Signed-off-by: Gábor Bergmann <gabor.bergmann@incquerylabs.com>
@ujhelyiz ujhelyiz added this to the 2.9.0 milestone Mar 19, 2024
@ujhelyiz ujhelyiz removed the legacy label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from Eclipse bugzilla. Query Issues related to the query component of VIATRA, including runtime or pattern language issues.
Projects
None yet
2 participants