fix: register import mapping result variable types#360
Open
hjotha wants to merge 2 commits intomendixlabs:mainfrom
Open
fix: register import mapping result variable types#360hjotha wants to merge 2 commits intomendixlabs:mainfrom
hjotha wants to merge 2 commits intomendixlabs:mainfrom
Conversation
Import-from-mapping actions infer their result cardinality from the referenced mapping and JSON structure, but the builder did not copy that inferred result type into the variable scope. Later activities that depended on the imported result could therefore rebuild with missing object/list type information. The builder now records the output variable as either the mapped entity or a list of that entity after constructing the mapping result handling. This keeps the variable scope aligned with the BSON result handling that is already written for the action. Tests cover single-object and array-root mappings with synthetic backend metadata, and make build, make lint-go, and make test pass locally.
This was referenced Apr 27, 2026
AI Code ReviewCritical IssuesNone found. Moderate IssuesNone found. Minor IssuesNone found. What Looks Good
RecommendationApprove - The PR correctly addresses the issue with minimal, well-tested changes that follow project conventions. No checklist violations identified for this bug fix scope. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Adds an MDL script under mdl-examples/bug-tests/ exercising `import from mapping` followed by a `change` on the imported result. After exec, `mx check` reports 0 errors, confirming the result variable type is registered so the downstream change resolves the entity attribute. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Preserves inferred object/list type information for import-from-mapping output variables.
Changes
ResultHandlingMapping.Module.EntityorList of Module.Entitybased on the inferredSingleObjectflag.Validation
go test ./mdl/executor -run TestAddImportFromMappingRegistersmake buildmake lint-gomake testPart of #352
Part of #332