Skip to content

Conversation

@yilmaztayfun
Copy link
Contributor

@yilmaztayfun yilmaztayfun commented Jan 4, 2026

Introduces new extension mappings and configuration files for subflow and task test scenarios, including child and parent data extensions, HTTP data and transform extensions, and related workflow/view/test definitions. These additions support testing of longpolling, data enrichment, and error boundary handling in workflow extensions.

Summary by Sourcery

Add workflow, task, and extension configurations to exercise HTTP-based data/transform extensions, subflow view/extension long-polling, and error boundary behaviors across parent/child workflows.

New Features:

  • Introduce HTTP data and transform extensions that call external HTTP tasks and expose transformed/enriched data via workflow instance extensions.
  • Add subflow parent/child workflows, mappings, and view definitions to test long-polling and data exchange between parent and child instances.
  • Add dedicated error-boundary test workflow, tasks, and mappings to cover success, retry, ignore, timeout, rollback, notify, manual review, and subflow error propagation scenarios.

Enhancements:

  • Update existing task-test mappings to fetch extension data from the current instance, log initialization, and tag results for extension-focused test runs.

Tests:

  • Add workflow HTTP files and mock configuration updates to support exercising the new subflow, extension, and error boundary test scenarios via runtime tools.

Summary by CodeRabbit

  • New Features

    • Added data extensions for parent and child workflow support with long-polling capabilities
    • Introduced error boundary testing workflows with retry, abort, ignore, and timeout handling scenarios
    • Added workflow views for child and parent workflow interactions
    • Expanded mock API endpoints for testing scenarios
  • Tests

    • Added comprehensive HTTP test workflows for error boundary workflows
    • Added subflow integration test scenarios
  • Chores

    • Updated runtime version to 0.0.28
    • Expanded Postman collection and mock API definitions

✏️ Tip: You can customize this high-level summary in your review settings.

Introduces new extension mappings and configuration files for subflow and task test scenarios, including child and parent data extensions, HTTP data and transform extensions, and related workflow/view/test definitions. These additions support testing of longpolling, data enrichment, and error boundary handling in workflow extensions.
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 4, 2026

Reviewer's Guide

Adds comprehensive test coverage for workflow extensions, subflow view/extension interactions, and error boundary behaviors by introducing new extension mappings, subflow parent/child workflows and views, and dedicated tasks/workflows for HTTP-based data/transform extensions and error handling scenarios, plus minor tweaks to existing task-test mappings and configs.

File-Level Changes

Change Details Files
Adjust GetInstanceData and initial transition mappings to drive and observe HTTP data extension behavior in the task-test workflow.
  • Change GetInstanceData mapping to target the task-test workflow’s own instance instead of a subflow instance and request only the HTTP data extension
  • Capture extension data from GetInstanceData response into workflow data and tag executions for extension testing
  • Convert InitialTransitionMapping to inherit from ScriptBase, add logging, and clean up usings
core/Workflows/task-test/src/GetInstanceDataMapping.csx
core/Workflows/task-test/src/InitialTransitionMapping.csx
core/Workflows/task-test/src/HttpTaskMapping.csx
core/Workflows/task-test/task-test-workflow.json
Introduce HTTP-based task extensions for data extraction and response transformation, wired for use by GetInstanceData and extension tests.
  • Add HttpDataExtensionMapping to call an HTTP task, set extension-identifying headers/body, and expose the response data via extensions
  • Add HttpTransformExtensionMapping to enrich and transform HTTP responses with analytics, derived fields, and metadata for validation in tests
  • Register these extensions via JSON extension config files
core/Extensions/task-test/src/HttpDataExtensionMapping.csx
core/Extensions/task-test/src/HttpTransformExtensionMapping.csx
core/Extensions/task-test/test-http-data-extension.json
core/Extensions/task-test/test-http-transform-extension.json
Add subflow view/extension integration test workflows with parent/child mappings and data extensions for long-polling scenarios.
  • Create parent and child workflows for subflow view/extension tests, including start/complete mappings and an AlwaysTrueRule for auto transitions
  • Implement SubFlowMapping to pass structured test context into the child workflow and process subflow results back into the parent
  • Provide parent and child data extension mappings that drive HTTP tasks and return structured extension payloads tagged for long-polling tests
  • Define corresponding workflow views and extension configuration JSONs
core/Workflows/subflow-test/src/SubFlowMapping.csx
core/Workflows/subflow-test/src/ParentStartMapping.csx
core/Workflows/subflow-test/src/ParentCompleteMapping.csx
core/Workflows/subflow-test/src/ChildStartMapping.csx
core/Workflows/subflow-test/src/ChildCompleteMapping.csx
core/Workflows/subflow-test/src/AlwaysTrueRule.csx
core/Extensions/subflow-test/src/ParentDataExtensionMapping.csx
core/Extensions/subflow-test/src/ChildDataExtensionMapping.csx
core/Extensions/subflow-test/parent-data-extension.json
core/Extensions/subflow-test/child-data-extension.json
core/Views/subflow-test/parent-workflow-view.json
core/Views/subflow-test/child-workflow-view.json
core/Workflows/subflow-test/subflow-view-test-parent.json
core/Workflows/subflow-test/subflow-view-test-child.json
core/Workflows/subflow-test/.meta/subflow-view-test-child.diagram.json
core/Workflows/subflow-test/subflow-view-test.http
Add a dedicated error-boundary test workflow with mappings and tasks that exercise success, retry, ignore, timeout, subflow boundaries, and follow-up actions.
  • Introduce mappings that construct HTTP requests for different error-boundary scenarios (success, retry, ignore, timeout, subflow-error) and capture structured results
  • Add a simple ErrorBoundarySubFlowMapping and SubFlowErrorRecoveryRule to propagate subflow data and gate error-recovery transitions
  • Implement mappings for workflow-level init, manual review, rollback, timeout handling, and generic error recovery to verify actions triggered by error boundaries
  • Define supporting workflow and task JSON for the error-boundary test workflow and its HTTP tasks
core/Workflows/task-test/src/ErrorBoundaryInitMapping.csx
core/Workflows/task-test/src/ErrorBoundarySuccessMapping.csx
core/Workflows/task-test/src/ErrorBoundaryRetryMapping.csx
core/Workflows/task-test/src/ErrorBoundaryIgnoreMapping.csx
core/Workflows/task-test/src/ErrorBoundaryTimeoutMapping.csx
core/Workflows/task-test/src/SubFlowErrorMapping.csx
core/Workflows/task-test/src/ErrorBoundarySubFlowMapping.csx
core/Workflows/task-test/src/SubFlowErrorRecoveryRule.csx
core/Workflows/task-test/src/ManualReviewMapping.csx
core/Workflows/task-test/src/RollbackMapping.csx
core/Workflows/task-test/src/TimeoutHandlerMapping.csx
core/Workflows/task-test/src/ErrorRecoveryMapping.csx
core/Tasks/task-test/error-boundary-success-task.json
core/Tasks/task-test/error-boundary-retry-task.json
core/Tasks/task-test/error-boundary-ignore-task.json
core/Tasks/task-test/error-boundary-timeout-task.json
core/Tasks/task-test/error-boundary-abort-task.json
core/Workflows/task-test/error-boundary-test-workflow.json
core/Workflows/task-test/error-boundary-subflow.json
core/Workflows/task-test/.meta/error-boundary-test-workflow.diagram.json
core/Workflows/task-test/error-boundary-test-workflow.http
Align local tooling/configuration and API mocks with the new workflows and extensions.
  • Update vnext.config and Mockoon migration API definitions to expose endpoints used by the new HTTP-based test scenarios
  • Extend the Postman collection with requests for the new subflow and error-boundary test workflows
mockoon/migration-api.json
postman/vNext Example Runtime.postman_collection.json
vnext.config.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link

coderabbitai bot commented Jan 4, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR introduces comprehensive test infrastructure for subflow workflows and error boundary handling, including parent/child workflow definitions, data extensions with HTTP mapping capabilities, multiple error-level boundary scenarios (task, state, subflow), new task definitions for error simulation, and updates to test collections and mock API configurations.

Changes

Cohort / File(s) Summary
Subflow Parent/Child Definitions
core/Workflows/subflow-test/subflow-view-test-parent.json, core/Workflows/subflow-test/subflow-view-test-child.json, core/Workflows/subflow-test/.meta/subflow-view-test-child.diagram.json
New parent and child workflow definitions with embedded script mappings, state machines, and diagram metadata; parent initiates and waits for child subflow completion.
Subflow Mapping Classes
core/Workflows/subflow-test/src/{ParentStartMapping, ChildStartMapping, ParentCompleteMapping, ChildCompleteMapping, SubFlowMapping, AlwaysTrueRule}.csx
Six new IMapping/IConditionMapping/ISubFlowMapping implementations handling parent/child workflow initialization, completion, subflow data propagation, and transition conditions.
Subflow Views & Extensions
core/Views/subflow-test/{parent-workflow-view, child-workflow-view}.json, core/Extensions/subflow-test/{parent-data-extension, child-data-extension}.json
View configurations and data extension manifests for subflow workflows with HTTP task mappings and embedded C# code.
Data Extension Mappings
core/Extensions/subflow-test/src/{ParentDataExtensionMapping, ChildDataExtensionMapping}.csx, core/Extensions/task-test/src/{HttpDataExtensionMapping, HttpTransformExtensionMapping}.csx
Four new data extension mapping classes handling HTTP request/response processing and data transformation for workflow extensions.
Data Extension Manifests
core/Extensions/task-test/{test-http-data-extension, test-http-transform-extension}.json
JSON configuration files defining test HTTP data and transform extension tasks with embedded mapping scripts.
Error Boundary Workflows
core/Workflows/task-test/error-boundary-test-workflow.json, core/Workflows/task-test/error-boundary-subflow.json, core/Workflows/task-test/.meta/error-boundary-test-workflow.diagram.json
Complex multi-state workflow definitions for testing error boundary scenarios at task, state, and subflow levels with retry/timeout/notification handlers.
Error Boundary Mapping Classes
core/Workflows/task-test/src/{ErrorBoundaryInitMapping, ErrorBoundaryRetryMapping, ErrorBoundaryIgnoreMapping, ErrorBoundarySuccessMapping, ErrorBoundaryTimeoutMapping, ErrorBoundaryNotifyMapping, ErrorBoundarySubFlowMapping, ErrorRecoveryMapping, RollbackMapping, SubFlowErrorMapping, SubFlowErrorRecoveryRule, ManualReviewMapping, TimeoutHandlerMapping}.csx
Thirteen new mapping/condition classes implementing error handling strategies, retry logic, notification triggers, and recovery workflows.
Error Boundary Test Tasks
core/Tasks/task-test/error-boundary-{abort, ignore, retry, success, timeout}-task.json
Five new HTTP task definitions simulating various error scenarios (500, 400, 503, 200, timeout) for error boundary testing.
Test Infrastructure
core/Workflows/subflow-test/subflow-view-test.http, core/Workflows/task-test/error-boundary-test-workflow.http
HTTP test scripts documenting end-to-end workflows for subflow and error boundary scenarios with state polling, transitions, and data validation.
Configuration & Collections
core/Workflows/task-test/task-test-workflow.json (modified), mockoon/migration-api.json, postman/vNext Example Runtime.postman_collection.json, vnext.config.json
Added extension references to task-test-workflow; expanded mock API routes for error boundary, domain resolver, OAuth2, and payment endpoints; updated Postman requests and variables; bumped runtime version from 0.0.23 to 0.0.28.
Existing Code Updates
core/Workflows/task-test/src/{GetInstanceDataMapping, InitialTransitionMapping, HttpTaskMapping}.csx
GetInstanceDataMapping now targets test-http-data-extension and uses current instance ID; InitialTransitionMapping now derives from ScriptBase; HttpTaskMapping formatting adjusted.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ParentWF as Parent Workflow
    participant Extension as Data Extension
    participant ChildWF as Child Workflow
    participant ParentComplete

    Client->>ParentWF: Start Parent Workflow
    activate ParentWF
    ParentWF->>Extension: Load Parent Data Extension
    activate Extension
    Extension-->>ParentWF: Extension Data Ready
    deactivate Extension
    ParentWF->>ChildWF: Start Child Subflow
    activate ChildWF
    ChildWF->>Extension: Load Child Data Extension
    activate Extension
    Extension-->>ChildWF: Extension Data Ready
    deactivate Extension
    rect rgb(200, 220, 255)
        Note over ChildWF: Child Workflow Executes
        ChildWF->>ChildWF: Process: child-active → child-completed
    end
    ChildWF-->>ParentWF: Subflow Completion Result
    deactivate ChildWF
    ParentWF->>ParentComplete: Execute Completion Mapping
    activate ParentComplete
    ParentComplete-->>ParentWF: Final Result with Test Data
    deactivate ParentComplete
    ParentWF-->>Client: Parent Workflow Completed
    deactivate ParentWF
Loading
sequenceDiagram
    participant Client
    participant Workflow as Error Boundary Workflow
    participant HttpTask as HTTP Task
    participant ErrorHandler as Error Boundary Handler
    participant Recovery as Error Recovery

    Client->>Workflow: Start Workflow
    activate Workflow
    
    rect rgb(255, 240, 200)
        Note over Workflow, HttpTask: Task-Level Error Boundary
        Workflow->>HttpTask: Execute Task (503 Retry Scenario)
        HttpTask-->>ErrorHandler: Error Response
        ErrorHandler->>ErrorHandler: Evaluate Retry Policy
        ErrorHandler->>HttpTask: Retry with Exponential Backoff
        HttpTask-->>ErrorHandler: Success Response
    end
    
    rect rgb(255, 200, 200)
        Note over Workflow, ErrorHandler: State-Level Error Boundary
        Workflow->>ErrorHandler: Enter Error-Sensitive State
        ErrorHandler->>ErrorHandler: Evaluate Error Code (400)
        ErrorHandler->>ErrorHandler: Apply Ignore Action
    end
    
    rect rgb(220, 200, 255)
        Note over Workflow, Recovery: Subflow Error Propagation
        Workflow->>HttpTask: Invoke Subflow Task
        HttpTask-->>ErrorHandler: Error in Subflow
        ErrorHandler->>Recovery: Propagate to Parent
        Recovery-->>Workflow: Recovery Action Executed
    end
    
    Workflow-->>Client: Workflow Completed with Recovery
    deactivate Workflow
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Suggested reviewers

  • middt

Poem

🐰 Hops through subflows with grace and might,
Error boundaries catch the fright,
Parent calls child with gentle hand,
Data extensions throughout the land,
Test by test, the workflows stand!


📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fab026f and cdb1baf.

📒 Files selected for processing (49)
  • core/Extensions/subflow-test/child-data-extension.json
  • core/Extensions/subflow-test/parent-data-extension.json
  • core/Extensions/subflow-test/src/ChildDataExtensionMapping.csx
  • core/Extensions/subflow-test/src/ParentDataExtensionMapping.csx
  • core/Extensions/task-test/src/HttpDataExtensionMapping.csx
  • core/Extensions/task-test/src/HttpTransformExtensionMapping.csx
  • core/Extensions/task-test/test-http-data-extension.json
  • core/Extensions/task-test/test-http-transform-extension.json
  • core/Tasks/task-test/error-boundary-abort-task.json
  • core/Tasks/task-test/error-boundary-ignore-task.json
  • core/Tasks/task-test/error-boundary-retry-task.json
  • core/Tasks/task-test/error-boundary-success-task.json
  • core/Tasks/task-test/error-boundary-timeout-task.json
  • core/Views/subflow-test/child-workflow-view.json
  • core/Views/subflow-test/parent-workflow-view.json
  • core/Workflows/subflow-test/.meta/subflow-view-test-child.diagram.json
  • core/Workflows/subflow-test/src/AlwaysTrueRule.csx
  • core/Workflows/subflow-test/src/ChildCompleteMapping.csx
  • core/Workflows/subflow-test/src/ChildStartMapping.csx
  • core/Workflows/subflow-test/src/ParentCompleteMapping.csx
  • core/Workflows/subflow-test/src/ParentStartMapping.csx
  • core/Workflows/subflow-test/src/SubFlowMapping.csx
  • core/Workflows/subflow-test/subflow-view-test-child.json
  • core/Workflows/subflow-test/subflow-view-test-parent.json
  • core/Workflows/subflow-test/subflow-view-test.http
  • core/Workflows/task-test/.meta/error-boundary-test-workflow.diagram.json
  • core/Workflows/task-test/error-boundary-subflow.json
  • core/Workflows/task-test/error-boundary-test-workflow.http
  • core/Workflows/task-test/error-boundary-test-workflow.json
  • core/Workflows/task-test/src/ErrorBoundaryIgnoreMapping.csx
  • core/Workflows/task-test/src/ErrorBoundaryInitMapping.csx
  • core/Workflows/task-test/src/ErrorBoundaryNotifyMapping.csx
  • core/Workflows/task-test/src/ErrorBoundaryRetryMapping.csx
  • core/Workflows/task-test/src/ErrorBoundarySubFlowMapping.csx
  • core/Workflows/task-test/src/ErrorBoundarySuccessMapping.csx
  • core/Workflows/task-test/src/ErrorBoundaryTimeoutMapping.csx
  • core/Workflows/task-test/src/ErrorRecoveryMapping.csx
  • core/Workflows/task-test/src/GetInstanceDataMapping.csx
  • core/Workflows/task-test/src/HttpTaskMapping.csx
  • core/Workflows/task-test/src/InitialTransitionMapping.csx
  • core/Workflows/task-test/src/ManualReviewMapping.csx
  • core/Workflows/task-test/src/RollbackMapping.csx
  • core/Workflows/task-test/src/SubFlowErrorMapping.csx
  • core/Workflows/task-test/src/SubFlowErrorRecoveryRule.csx
  • core/Workflows/task-test/src/TimeoutHandlerMapping.csx
  • core/Workflows/task-test/task-test-workflow.json
  • mockoon/migration-api.json
  • postman/vNext Example Runtime.postman_collection.json
  • vnext.config.json

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yilmaztayfun yilmaztayfun merged commit 0b7c31d into master Jan 4, 2026
1 of 4 checks passed
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • In the new HTTP extension mappings (e.g. HttpTransformExtensionMapping and HttpDataExtensionMapping), context.Instance.Id.ToString() is used without a null check when building headers, which can throw if the instance is null; consider using the same null-safe pattern (context.Instance?.Id) you used elsewhere or guarding earlier.
  • Several OutputHandler/InputHandler methods are declared async but never use await (e.g. in many of the new mapping classes), which produces unnecessary state machines; consider removing async and returning Task.FromResult(...) where applicable for simpler and slightly more efficient code.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the new HTTP extension mappings (e.g. HttpTransformExtensionMapping and HttpDataExtensionMapping), `context.Instance.Id.ToString()` is used without a null check when building headers, which can throw if the instance is null; consider using the same null-safe pattern (`context.Instance?.Id`) you used elsewhere or guarding earlier.
- Several `OutputHandler`/`InputHandler` methods are declared `async` but never use `await` (e.g. in many of the new mapping classes), which produces unnecessary state machines; consider removing `async` and returning `Task.FromResult(...)` where applicable for simpler and slightly more efficient code.

## Individual Comments

### Comment 1
<location> `core/Extensions/task-test/src/HttpTransformExtensionMapping.csx:41-49` </location>
<code_context>
+                ["Content-Type"] = "application/json",
+                ["X-Extension-Name"] = "test-http-data-extension",
+                ["X-Request-Id"] = Guid.NewGuid().ToString(),
+                ["X-Correlation-Id"] = context.Instance.Id.ToString()
+            };
+            httpTask.SetHeaders(headers);
</code_context>

<issue_to_address>
**suggestion:** Guard against null Instance when building correlation headers to avoid brittle tests

In these workflow tests, a null `Instance` or `Instance.Id` will cause a `NullReferenceException` during setup instead of a clear, assertion-based failure. To keep tests robust (especially with partially initialized instances), consider a null-safe correlation header, e.g.:

```csharp
["X-Correlation-Id"] = context.Instance?.Id?.ToString() ?? Guid.NewGuid().ToString()
```

```suggestion
            // Set headers
            var correlationId = context.Instance?.Id.ToString() ?? Guid.NewGuid().ToString();

            var headers = new Dictionary<string, string?>
            {
                ["Content-Type"] = "application/json",
                ["X-Extension-Name"] = "test-http-transform-extension",
                ["X-Transform-Type"] = "enrichment",
                ["X-Request-Id"] = Guid.NewGuid().ToString(),
                ["X-Correlation-Id"] = correlationId
            };
```
</issue_to_address>

### Comment 2
<location> `core/Extensions/task-test/src/HttpDataExtensionMapping.csx:35-43` </location>
<code_context>
+                ["Content-Type"] = "application/json",
+                ["X-Extension-Name"] = "test-http-data-extension",
+                ["X-Request-Id"] = Guid.NewGuid().ToString(),
+                ["X-Correlation-Id"] = context.Instance.Id.ToString()
+            };
+            httpTask.SetHeaders(headers);
</code_context>

<issue_to_address>
**suggestion:** Align correlation-id handling with other test mappings for consistency and null-safety

This mapping assumes `context.Instance` and `context.Instance.Id` are always non-null, so tests that start with minimal or malformed data will fail with a null reference before they can assert extension behavior. Using `context.Instance?.Id?.ToString()` with an appropriate fallback would avoid this and match the defensive pattern used elsewhere in the PR.

```suggestion
            // Set headers
            var correlationId = context.Instance?.Id?.ToString() ?? string.Empty;

            var headers = new Dictionary<string, string?>
            {
                ["Content-Type"] = "application/json",
                ["X-Extension-Name"] = "test-http-data-extension",
                ["X-Request-Id"] = Guid.NewGuid().ToString(),
                ["X-Correlation-Id"] = correlationId
            };
            httpTask.SetHeaders(headers);
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gemini-code-assist
Copy link

Summary of Changes

Hello @yilmaztayfun, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly expands the testing capabilities for workflow extensions and error handling mechanisms. It provides dedicated test setups for validating long-polling behavior in subflow views, ensuring data enrichment and transformation via HTTP extensions, and thoroughly exercising error boundary configurations at global, task, and state levels, including retry policies and timeout handling. The changes aim to enhance the reliability and robustness of the workflow engine's extension and error management features.

Highlights

  • New Extension Mappings: Introduces new extension mappings for subflow and task test scenarios, including child and parent data extensions, and HTTP data and transform extensions.
  • Subflow and Task Test Workflows: Adds new workflow definitions and associated C# scripts for comprehensive testing of subflow interactions, longpolling functionality, and various task types.
  • Error Boundary Handling: Implements a robust set of error boundary test cases covering task-level and state-level retries, aborts, ignores, rollbacks, timeout policies, and error propagation in subflows.
  • HTTP Test Files and Mockoon Updates: Includes new HTTP test files for Postman and updates the Mockoon API configuration to support the newly added test endpoints and scenarios.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive suite of tests for subflows, task extensions, and error boundary handling. The additions of new workflow definitions, C# script mappings, and test configurations are well-structured. I've identified a few areas for improvement, primarily concerning potential null reference exceptions in some of the new C# scripts, along with some suggestions for enhancing code quality and performance. Overall, this is a valuable addition for improving test coverage.

["Content-Type"] = "application/json",
["X-Extension-Name"] = "test-http-data-extension",
["X-Request-Id"] = Guid.NewGuid().ToString(),
["X-Correlation-Id"] = context.Instance.Id.ToString()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There is a potential NullReferenceException here. context.Instance could be null, which would cause a crash. You've used the null-conditional operator ?. elsewhere in this file (e.g., line 28), and the same defensive approach should be applied here to safely access the Id property.

                ["X-Correlation-Id"] = context.Instance?.Id.ToString()

["X-Extension-Name"] = "test-http-transform-extension",
["X-Transform-Type"] = "enrichment",
["X-Request-Id"] = Guid.NewGuid().ToString(),
["X-Correlation-Id"] = context.Instance.Id.ToString()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There is a potential NullReferenceException here. context.Instance could be null, which would cause a crash. You should use the null-conditional operator ?. to safely access the Id property, similar to how it's used in other parts of the code.

                ["X-Correlation-Id"] = context.Instance?.Id.ToString()

// Pass parent data to SubFlow
return Task.FromResult(new ScriptResponse
{
Data = context.Instance.Data,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

There is a potential NullReferenceException here. context.Instance can be null, which would cause a crash when trying to access the Data property. You should use the null-conditional operator ?. for safe access.

            Data = context.Instance?.Data,

Comment on lines +9 to +12
public async Task<bool> Handler(ScriptContext context)
{
return true;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The async keyword is unnecessary here as the method returns a value synchronously. Using async creates a state machine which adds a small performance overhead. For better performance and cleaner code, you can remove the async keyword and return a completed task directly using Task.FromResult.

public Task<bool> Handler(ScriptContext context)
    {
        return Task.FromResult(true);
    }

{
LogInformation("ChildCompleteMapping - Completing child workflow");

var inputData = context.Instance?.Data;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The local variable inputData is declared but its value is never used. It should be removed to improve code clarity.

{
LogInformation("ParentStartMapping - Initializing parent workflow");

var inputData = context.Instance?.Data;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The local variable inputData is declared but its value is never used. It should be removed to improve code clarity.

using System.Threading.Tasks;
using BBT.Workflow.Definitions;
using BBT.Workflow.Scripting;
using BBT.Workflow.Scripting;using BBT.Workflow.Scripting.Functions;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and to adhere to standard C# coding conventions, using statements should each be on their own line.

using BBT.Workflow.Scripting;
using BBT.Workflow.Scripting.Functions;

Comment on lines +9 to +21
public async Task<bool> Handler(ScriptContext context)
{
// Check if there was an error in the SubFlow
var data = context.Instance?.Data;

// If there's a subFlow error result, this transition should fire
if (data?.subFlowErrorResult != null)
{
return true;
}

return false;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The async keyword is not necessary for this method since it returns a value synchronously. Using async generates a state machine, which introduces a slight performance overhead. To make the code cleaner and more performant, you can remove async and use Task.FromResult to return a completed task.

public Task<bool> Handler(ScriptContext context)
    {
        // Check if there was an error in the SubFlow
        var data = context.Instance?.Data;
        
        // If there's a subFlow error result, this transition should fire
        if (data?.subFlowErrorResult != null)
        {
            return Task.FromResult(true);
        }
        
        return Task.FromResult(false);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants