|
| 1 | +-- ============================================================================ |
| 2 | +-- Bug #306: Annotations emitted before unsupported-activity comments |
| 3 | +-- ============================================================================ |
| 4 | +-- |
| 5 | +-- Symptom (before fix): |
| 6 | +-- Activities whose BSON type isn't yet implemented in mxcli's describer |
| 7 | +-- render as `-- unsupported: <Type>` comments. Before the fix, the |
| 8 | +-- describer still prefixed these comment lines with `@position`, |
| 9 | +-- `@anchor`, etc. The grammar only accepts annotations as prefixes of |
| 10 | +-- real microflow statements (not comments), so the resulting MDL failed |
| 11 | +-- to re-parse with errors like: |
| 12 | +-- line N:0 mismatched input '@' expecting {...} |
| 13 | +-- |
| 14 | +-- After fix: |
| 15 | +-- When a formatted statement begins with `--`, `emitObjectAnnotations` |
| 16 | +-- is skipped — only the comment is emitted. Annotations on SUPPORTED |
| 17 | +-- activities continue to be emitted as before. |
| 18 | +-- |
| 19 | +-- Reproducibility note: |
| 20 | +-- The unsupported-activity branch can only be triggered by an .mpr |
| 21 | +-- containing a BSON activity type that mxcli does not yet describe |
| 22 | +-- (typical examples are very new or rarely-used activity types). Pure |
| 23 | +-- MDL cannot create such an activity. The Go-side regression |
| 24 | +-- `TestTraverseFlow_UnsupportedActivitySkipsAnnotations` covers that |
| 25 | +-- path directly. |
| 26 | +-- |
| 27 | +-- This script provides a POSITIVE CONTROL: a microflow whose every |
| 28 | +-- activity carries position / caption / anchor annotations. Its describe |
| 29 | +-- output must (a) parse with `mxcli check`, and (b) round-trip cleanly, |
| 30 | +-- confirming the annotation-emission codepath still works for the |
| 31 | +-- common case. |
| 32 | +-- |
| 33 | +-- Usage: |
| 34 | +-- mxcli exec mdl-examples/bug-tests/306-describer-annotations-before-unsupported-comment.mdl -p app.mpr |
| 35 | +-- mxcli -p app.mpr -c "describe microflow BugTest306.MF_AnnotatedFlow" |
| 36 | +-- The output must re-execute cleanly against the same project. |
| 37 | +-- ============================================================================ |
| 38 | + |
| 39 | +create module BugTest306; |
| 40 | + |
| 41 | +create microflow BugTest306.MF_AnnotatedFlow ( |
| 42 | + $input: string |
| 43 | +) |
| 44 | +returns string as $result |
| 45 | +begin |
| 46 | + declare $result string = empty; |
| 47 | + |
| 48 | + @caption 'log entry' |
| 49 | + log info node 'BugTest306' 'flow started'; |
| 50 | + |
| 51 | + @caption 'guard' |
| 52 | + if $input != empty then |
| 53 | + @caption 'happy path' |
| 54 | + set $result = 'value: ' + $input; |
| 55 | + else |
| 56 | + set $result = 'no value'; |
| 57 | + end if; |
| 58 | + |
| 59 | + return $result; |
| 60 | +end; |
| 61 | +/ |
0 commit comments