Repository navigation
Add source-preserving C# workflow expressions, JSON boundary fixes, and connector validation - #52
Closed
Brian Lam (lambrianmsft) wants to merge 23 commits into
Closed
Brian Lam (lambrianmsft) wants to merge 23 commits into
Brian Lam (lambrianmsft) wants to merge 23 commits into
Conversation
Introduce a runtime evaluator for serialized C# workflow expressions plus a
static reference extractor, alongside characterization/goal test suites.
- src/...ExpressionEvaluation: netstandard2.0 NuGet package
- RoslynWorkflowExpressionEvaluator (compile + cache + run via Roslyn)
- WorkflowExpressionGlobals (free-function host: outputs/body/trigger/etc.)
- WorkflowExpressionReferenceExtractor (static trigger/action/variable/
agent-parameter reference inference to drive async pre-fetch)
- tests/...ExpressionTests: LA ExpressionConverter characterization tests
- tests/...CSharpExpressionTests: 82 C# converter goal tests (red by design)
- tests/...ExpressionEvaluationTests: 85 evaluator + extractor tests (green)
- Core SDK csproj: InternalsVisibleTo + exclude nested evaluator from glob
- Solution: add new projects
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tion Merge feature branch from fork: Add C# expression evaluation library, reference extractor, and tests
…ature/csharp-expression-evaluation
…sion-evaluation # Conflicts: # Microsoft.Azure.Workflows.Sdk.sln
Route built-in actions through the hybrid converter, preserve template-compatible expressions, add serialization parity behavior, and expand converter coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Update all generated managed connector inputs to use CSharpExpressionConverter while retaining native Logic Apps expressions when C# execution is unnecessary. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Route upstream generated service-provider parameters through CSharpExpressionConverter and cover template-safe versus native C# output. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Integrate SDK build-time expression transformation, generated connector descriptors, schema-aware serialization, and deployment validation. Add approved-catalog, package, IDE, and runtime verification with explicit remaining host/platform gates. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… limitation Preserve the original workflow contracts, add nested JSON and Response controls, and retain precise failure diagnostics. CI provisioning is not included. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep executable compiler, package, host and E2E regressions. Remove historical ledgers, copied logs and evidence-only checks, drop stale fixture references, and mark generated connectors for collapsed review. Historical files remain available in the preceding commit. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use #{...} across generated connectors, preserve literal and JSON-reference semantics, and expand isolated service-provider coverage. Remove retired expression-tree implementations and migrate applicable tests to source-compiled authoring.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| SourceExpression.Validate(bodystartDateTime, nameof(bodystartDateTime), required: true); | ||
| SourceExpression.Validate(bodyendDateTime, nameof(bodyendDateTime), required: true); | ||
| SourceExpression.Validate(bodyname, nameof(bodyname), required: true); | ||
| SourceExpression.Validate(bodydescription, nameof(bodydescription), required: true); |
Contributor
There was a problem hiding this comment.
copying comment from the CodefulSdkGenerator pr: why are the new SourceExpression.Validate and BuildSourceInput delegate needed? I know this differs from the interceptors implementation but that one required minimal changes to generated connectors (just [WorkflowExpression] attribute) and wondering if we can accomplish the same here
Integrate the full managed and service-provider output from BPM e27dd53fc33215bb52e7962194b19768e4759959 (PR 17341699), including 230 new generated files. Preserve Cardsforpowerapps because no replacement was generated. Include connector regression coverage, current API callers, parity tooling, and generation guidance. The catalog retains 22 configured skips and 104 connector-level failures. Existing unsupported-operation omissions, including managed multipart operations, are not claimed fixed. Validated the exact staged tree independently of unstaged runtime/compiler refactoring: 108 CSharpExpression, 789 SourceExpression, and 8 Expression tests pass; E2E project builds. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Normalize legacy descriptor metadata once, remove redundant template-segment construction, share enum/numeric wire policy, and separate schema source generation from runtime serialization. Replace ambient dependency collection with an explicit per-transform collector and clarify factory, schema, deployment, and build-tool responsibilities. Include solution integration, documentation, and regression coverage for interpolation, descriptor compatibility, dependency isolation, factory destinations, and serializer policy. All 921 expression tests pass and the E2E authoring project builds. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move generated connector validation into SDK-only Roslyn build injection while preserving method-entry validation for all callers. Share build manifest tasks, enforce package build receipts, and add contract, transformer, build, and package coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add behavioral boundary regressions, typed interpolation safeguards, complete SDK/bundle candidate preparation, packaged E2E selection, and updated documentation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
4 of 14 tasks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
replaced by #58 |
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
Implement the SDK authoring and definition-generation side of source-preserving C# workflow expressions across built-in actions, managed connectors, and service providers. An SDK-owned Roslyn build tool captures expressions as metadata before compilation; literals remain ordinary JSON and runtime-dependent expressions use native
#{...}C#. Refresh generated connectors, preserve their validation through SDK-build injection, and retain workflow JSON at formatting/serialization boundaries instead of prematurely constructing generated CLR models.This PR is not a new execution-host evaluator or a guarantee of support on every deployed runtime. Runtime evaluation, extension integration, and bundle building have companion changes linked below.
Source-preserving compiler and runtime descriptors
src\Build\Microsoft.Azure.Workflows.Sdk.Build: rewrite workflow arguments before ordinary compilation, preserve authored source/overload semantics, analyze bounded source-visible factories, and record native dependencies.src\Expressions\SourceExpression.csandSourceExpressionConverter.cs: versioned metadata descriptors, explicit workflow bindings, literal/structured JSON values, and native rendering. Remove the legacy expression-tree conversion visitors rather than maintaining a fallback pipeline.[WorkflowExpression] Func<T>and deferred SDK-owned input construction.tools/workflow-buildandbuildTransitive. The runtime remains netstandard2.0; Roslyn/.NET 9 are build-time requirements.JSON materialization and interpolation corrections
The weather response
() => $"{weather.Body}" + "something"previously emittedToObject<CurrentWeather>(); default CLR formatting then printed a model type name. JSON serialization/encoding could also discard properties absent from the model.ToString(), nested JSON navigation, and approved explicit JSON serialization.ToObject<object>(JsonSerializer.Create()): JObject/JArray remain JSON containers, JSON null becomes CLR null, overload selection stays object-based, and ambient serializer defaults are not consulted.ToString()/IFormattable, authored/captured objects, typed method calls, and collection operations. Generic bindings resolve the formatting contract at definition construction without invoking delegates.global::is not parsed as a format separator.serialization-test-cases.md. Assertions check evaluated payloads, unknown fields, nulls, reads, laziness, and typed negative controls, not merely source strings.Example, before JSON escaping:
Literals and compiler-known constants remain data; runtime operations preserve native C#. Recognized direct workflow/property references remain JSON-native.
Connector regeneration and validation
CardsforpowerappsExtensions.csbecause no replacement was generated. Relative to the PR base, add 227 managed files and 3 provider files; the catalog contains 34 regenerated provider files in total.ConnectorValidationTransformer.csandConnectorValidation.targets.pack --no-build, verifies the successful injection-build receipt.tests\GeneratedConnectorParitycompares inventories/APIs/implementation syntax and compiles external generated sources through the actual SDK build.Complete local candidate preparation and durable integration guidance
tests\ExtensionE2E\New-ExtensionCandidate.ps1builds the complete versioned SDK nupkg and invokes the companion Logic Apps Bundle source builder, or imports an existing verified ZIP/producer receipt.candidate.json. Use fresh immutable roots rather than overwriting existing candidates or installed caches.SourceExpressionE2Emode selectingE2ESdkPackageVersion; prohibit mixing it with repository compiler imports or comparison assemblies.-BpmRepository.AGENTS.mdand a README discovery link to the central three-repository runbook intests\ExtensionE2E\README.md. Capture supplied checkout/tool inputs, SDK9 versus bundle10/VS18 prerequisites, exact dependency-generatornpm ci, source-preserving handoff, JSON/Swagger regressions, owned-process/debugger evidence, authorization, privacy, and known unsupported cases.--extensionfrom the read-only dependency source--extensions.Validation
Local code rerun before publishing commit
fd99e1f:Documentation follow-ups through
efbdf96change no runtime/compiler code. All 11 PowerShell examples parse, local Markdown links resolve, andgit diff --checkpasses. Documented manual-launch commands were not executed as a fresh editor/host/workflow acceptance run.Additional recorded evidence:
1.0.0-e2e.ff748b0.jsonboundary1package was built from the changed source; library/compiler hashes matched the isolated build and restored candidate assets. The copied user project built with 0 warnings/errors, and provider definition serialization emitted the JSON-preserving weather expression without a CurrentWeather dependency. This did not start a host or invoke a connector.Compatibility and known limits
ToObject<T>(). Arbitrary typed methods, unsupported navigation, custom serializers/overloads, and application-defined runtime types retain their existing typing/deployment requirements.RecruitmentWorkflow.cscalls to missingCommondataserviceActions.ListRecords; it is not counted as passing.Related work
run-candidate-e2e.mdowns the extension runner/launcher interfaces.