Reject noerror constraints on EMV2 events 🤖 - #3251
Merged
Merged
Conversation
Cover noerror constraints on component error, recovery, and repair events and on an event in a reusable behavior machine. Assert the specific diagnostic on each condition and reject unrelated diagnostics. Preserve valid event type constraints and noerror conditions on incoming and subcomponent outgoing propagations. Before the fix, the valid model passes and both negative tests fail because typed events lack the required diagnostic.
Check for noerror on every ErrorBehaviorEvent before the existing type-set checks. This reports a specific error for typed and untyped error events, recovery events, and repair events while preserving noerror on propagations. Keep the grammar and metamodel unchanged, as requested by issue #2817. The three focused regression tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2817
EMV2 transition conditions accepted
{noerror}on typed error events becauseErrorModelValidator.checkConditionElementTypeexemptsnoerrorfrom type-set containment checks. Rejectnoerroron everyErrorBehaviorEventbefore the existing type checks, with the diagnostic “The noerror constraint is not permitted on an event.” The grammar and metamodel are unchanged.Issue2817Testcovers typed and untyped error events, recovery and repair events, a nested conjunction, and an event in a reusable behavior machine. It checks the diagnostic on each offending condition and the total issue count. A valid model preserves ordinary event constraints andnoerroron incoming and subcomponent outgoing propagations. Before the fix, the valid model passed and both negative tests failed because the typed event diagnostic was absent.Validation:
git diff --checkpassed. The regression commit precedes the production fix commit.Commands run from the repository root:
mvn -o -T5 -s releng/osate.releng/settings.xml -Plocal \ -pl :org.osate.xtext.aadl2.errormodel,:org.osate.aadl2.errormodel.tests,:org.osate.xtext.aadl2.errormodel.feature \ -Dtycho.localArtifacts=default -Dpr.build=true -Dsign=false \ -Dspotbugs=false -Dcodecoverage=false -Djavadoc=false \ -Dtest=Issue2817Test -DfailIfNoTests=false verify # Complete EMV2 suite: same options, without -Dtest, using clean verify. mvn -o -T5 -s releng/osate.releng/settings.xml -Plocal \ -Dtycho.localArtifacts=ignore -Dpr.build=true -Dsign=false \ -Dspotbugs=false -Dcodecoverage=false -Djavadoc=false \ -DfailIfNoTests=false clean installTargets
masterwith no dependency on unmerged PRs. Risk is limited to the intended validation change: models usingnoerroron events now report errors; valid propagation conditions retain their existing behavior.