Skip to content

F/sprint24#14

Merged
yilmaztayfun merged 4 commits into
masterfrom
f/sprint24
Apr 15, 2026
Merged

F/sprint24#14
yilmaztayfun merged 4 commits into
masterfrom
f/sprint24

Conversation

@yilmaztayfun

@yilmaztayfun yilmaztayfun commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Add new collection/object workflow tests, multi-task account-opening functions, and local mock infrastructure while updating validation and simplifying existing workflows.

New Features:

  • Introduce collection-object-test workflow with mappings to exercise dynamic object and collection helper functions.
  • Add multi-task account-opening functions for validating account policies and aggregating instance data.
  • Add new account-opening and payments configuration and schema files, including an account-opening master schema.
  • Provide docker-compose setup with Mocklab and Dapr plus seed data for local mock API development.
  • Document repository conventions and local commands in a new CLAUDE.md guide.

Bug Fixes:

  • Fix account-opening mappings to use the correct accountType shape and instance key when calling downstream systems.
  • Ensure instance data lookups use the current instance key instead of legacy identifiers.

Enhancements:

  • Update JSON schema validation to select the appropriate AJV instance based on the schema draft version.
  • Improve logging in account-opening mappings to capture errors during bank account creation.

Build:

  • Bump @burgan-tech/vnext-schema dependency to the latest referenced version in both dev and runtime dependencies.

Documentation:

  • Add CLAUDE.md with architecture overview, development rules, and workflow testing guidance.

Tests:

  • Add comprehensive workflow mappings to validate collection and list helper functions (creation, projection, filtering, counting, and mutation).
  • Add subflow-test mappings to verify shared transitions can be handled correctly by parent and child workflows.
  • Add account-opening function mappings to validate multi-task function orchestration and instance data retrieval.

Chores:

  • Remove legacy OAuth, contract, and task-test workflows, tasks, extensions, and related Mockoon configs that are no longer needed.
  • Relocate a generic AlwaysTrueRule mapping into the collection-object-test workflow context.

yilmaztayfun and others added 4 commits February 6, 2026 09:29
Prune deprecated contract, discovery, oauth, task-test, and related
example assets to reduce maintenance overhead and keep the core domain
focused on currently supported flows.
@yilmaztayfun yilmaztayfun self-assigned this Apr 15, 2026
@yilmaztayfun yilmaztayfun requested review from a team April 15, 2026 08:41
@sourcery-ai

sourcery-ai Bot commented Apr 15, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces multi-draft JSON schema validation support, extends and refactors account-opening/subflow workflows and functions (including new collection/object test utilities and multi-task functions), adds local Mocklab/Dapr docker setup, and removes several legacy task-test, OAuth, contract, and mockoon components.

Sequence diagram for multi-task function execution in account-opening domain

sequenceDiagram
    actor Client
    participant Runtime as VNextRuntime
    participant Function as MultiTaskFunction
    participant MapPolicies as FunctionValidatePoliciesMapping
    participant HttpTask1 as HttpTask_validateAccountPolicies
    participant MapInstance as FunctionGetInstanceDataMapping
    participant GetInstanceTask as GetInstanceDataTask
    participant OutputMap as FunctionOutputMapping
    participant Mocklab as MocklabService

    Client->>Runtime: Start multi-task function
    Runtime->>Function: Execute function with tasks

    par Validate_account_policies
        Function->>MapPolicies: InputHandler(task, context)
        MapPolicies->>HttpTask1: SetBody and SetHeaders
        MapPolicies-->>Function: ScriptResponse
        Function->>HttpTask1: Execute HTTP request
        HttpTask1->>Mocklab: POST validate-account-policies
        Mocklab-->>HttpTask1: Policy validation response
        HttpTask1-->>Function: HTTP result
        Function->>MapPolicies: OutputHandler(context)
        MapPolicies-->>Function: ScriptResponse policy-check-result
    and Get_instance_data
        Function->>MapInstance: InputHandler(task, context)
        MapInstance->>GetInstanceTask: SetInstance(context.Instance.Key)
        MapInstance-->>Function: ScriptResponse
        Function->>GetInstanceTask: Execute
        GetInstanceTask-->>Function: Instance data snapshot
        Function->>MapInstance: OutputHandler(context)
        MapInstance-->>Function: ScriptResponse instance-data-result
    end

    Function->>OutputMap: OutputHandler(context with OutputResponse)
    OutputMap-->>Function: ScriptResponse multi-task-function-output
    Function-->>Runtime: Aggregated result
    Runtime-->>Client: HTTP response with policyValidation and instanceSnapshot
Loading

Class diagram for updated account-opening mappings and new multi-task function handlers

classDiagram
    class ScriptBase
    class IMapping
    class IOutputHandler
    class WorkflowTask
    class HttpTask
    class GetInstanceDataTask
    class ScriptContext
    class ScriptResponse

    IMapping <|.. CreateBankAccountMapping
    ScriptBase <|-- CreateBankAccountMapping
    IMapping <|.. TriggerGetInstanceTaskMapping
    IMapping <|.. InitialTransMapping
    IMapping <|.. FunctionValidatePoliciesMapping
    IMapping <|.. FunctionGetInstanceDataMapping
    IMapping <|.. LookupPaymentTypes
    IMapping <|.. OnEntryGetInstanceDataMapping
    IOutputHandler <|.. FunctionOutputMapping

    WorkflowTask <|-- HttpTask
    WorkflowTask <|-- GetInstanceDataTask

    class CreateBankAccountMapping {
      +Task~ScriptResponse~ InputHandler(WorkflowTask task, ScriptContext context)
    }

    class TriggerGetInstanceTaskMapping {
      +Task~ScriptResponse~ InputHandler(WorkflowTask task, ScriptContext context)
    }

    class InitialTransMapping {
      +Task~ScriptResponse~ InputHandler(WorkflowTask task, ScriptContext context)
    }

    class FunctionValidatePoliciesMapping {
      +Task~ScriptResponse~ InputHandler(WorkflowTask task, ScriptContext context)
      +Task~ScriptResponse~ OutputHandler(ScriptContext context)
    }

    class FunctionGetInstanceDataMapping {
      +Task~ScriptResponse~ InputHandler(WorkflowTask task, ScriptContext context)
      +Task~ScriptResponse~ OutputHandler(ScriptContext context)
    }

    class LookupPaymentTypes {
      +Task~ScriptResponse~ InputHandler(WorkflowTask task, ScriptContext context)
      +Task~ScriptResponse~ OutputHandler(ScriptContext context)
    }

    class OnEntryGetInstanceDataMapping {
      +Task~ScriptResponse~ InputHandler(WorkflowTask task, ScriptContext context)
      +Task~ScriptResponse~ OutputHandler(ScriptContext context)
    }

    class FunctionOutputMapping {
      +Task~ScriptResponse~ OutputHandler(ScriptContext context)
    }

    class ScriptContext {
      +object Instance
      +object Body
      +object Headers
      +object OutputResponse
    }

    class ScriptResponse {
      +string Key
      +object Data
    }
Loading

Flow diagram for multi-draft JSON schema validation in validate.js

flowchart TD
    Start[Start validation for JSON files] --> LoadSchema[Load schema for directory]
    LoadSchema --> CheckSchemaField{Schema has $schema field?}

    CheckSchemaField -->|Yes| ReadDraft[Read draft from schema.$schema]
    CheckSchemaField -->|No| UseDefaultDraft[Use default draft 7]

    ReadDraft --> DecideDraft{draft string includes 2019-09?}
    UseDefaultDraft --> UseAjv7[Use Ajv7 instance]

    DecideDraft -->|Yes| UseAjv2019[Use Ajv2019 instance]
    DecideDraft -->|No| UseAjv7

    UseAjv7 --> CompileSchema[Compile schema with selected AJV]
    UseAjv2019 --> CompileSchema

    CompileSchema --> ValidateFiles[Validate JSON files with compiled validator]
    ValidateFiles --> End[Report validation results]
Loading

File-Level Changes

Change Details Files
Support JSON schema validation for both draft-07 and 2019-09 schemas.
  • Replaced single Ajv instance with separate Ajv7 and Ajv2019 instances configured with formats and non-strict options.
  • Added helper to select the correct Ajv instance based on the schema's $schema field.
  • Updated schema validator compilation to use the selected Ajv instance.
validate.js
Adjust account-opening workflow mappings to use simpler accountType handling, better error logging, and correct instance resolution.
  • Changed CreateBankAccountMapping to inherit from ScriptBase and treat accountType as a simple value for payload and headers.
  • Added structured error logging inside CreateBankAccountMapping catch block.
  • Updated TriggerGetInstanceTaskMapping and OnEntryGetInstanceDataMapping to use context.Instance.Key instead of oldInstanceId for SetInstance.
  • Extended InitialTransMapping to include customer in the initial payload.
core/Workflows/account-opening/src/CreateBankAccountMapping.csx
core/Workflows/account-opening/src/TriggerGetInstanceTaskMapping.csx
core/Workflows/account-opening/src/OnEntryGetInstanceDataMapping.csx
core/Workflows/account-opening/src/InitialTransMapping.csx
Add new collection/object helper function tests as a dedicated workflow.
  • Created InitCollectionTestMapping to initialize test workflow data.
  • Added multiple mapping scripts to exercise collection and object helper functions (CreateObject, CreateList, SetProperty, ListAdd/Remove/Filter/Select/Count/Any/First/Last, GetList, AsList, RemoveProperty, ToDictionary, HasProperty).
  • Defined a new collection-object-test workflow JSON and supporting seed data collections for account-opening and payments.
core/Workflows/collection-object-test/src/InitCollectionTestMapping.csx
core/Workflows/collection-object-test/src/CreateAndSetMapping.csx
core/Workflows/collection-object-test/src/GetListAndAsListMapping.csx
core/Workflows/collection-object-test/src/ListAddRemoveMapping.csx
core/Workflows/collection-object-test/src/ListFilterCountAnyMapping.csx
core/Workflows/collection-object-test/src/ListFirstLastMapping.csx
core/Workflows/collection-object-test/src/ListSelectMapping.csx
core/Workflows/collection-object-test/src/RemovePropertyToDictionaryMapping.csx
core/Workflows/collection-object-test/collection-object-test-workflow.json
etc/docker/config/seed/account-opening-collection.json
etc/docker/config/seed/payments-collection.json
Introduce new account-opening multi-task function and instance-data helper functions.
  • Added FunctionValidatePoliciesMapping to call validate-account-policies HTTP task with instance data and headers.
  • Added FunctionGetInstanceDataMapping to retrieve current instance data via GetInstanceDataTask.
  • Added FunctionOutputMapping to normalize outputs from multiple tasks into a single response structure.
  • Added LookupPaymentTypes placeholder mapping and new function JSON definitions for multi-task-function-test and payment-types.
core/Functions/account-opening/src/FunctionValidatePoliciesMapping.csx
core/Functions/account-opening/src/FunctionGetInstanceDataMapping.csx
core/Functions/account-opening/src/FunctionOutputMapping.csx
core/Functions/account-opening/src/LookupPaymentTypes.csx
core/Functions/account-opening/multi-task-function-test.json
core/Functions/account-opening/payment-types.json
Enhance subflow-test workflows to validate shared transitions and parent/child instance data retrieval.
  • Added ParentSharedUpdateMapping and ChildSharedUpdateMapping to process shared-transition PATCH bodies on parent/child with logging and structured response.
  • Added ParentInitialGetInstanceDataMapping to fetch account-opening instance data on parent entry.
  • Moved AlwaysTrueRule mapping into collection-object-test and cleaned trailing newline.
  • Updated subflow-test workflow JSON/diagram references accordingly.
core/Workflows/subflow-test/src/ParentSharedUpdateMapping.csx
core/Workflows/subflow-test/src/ChildSharedUpdateMapping.csx
core/Workflows/subflow-test/src/ParentInitialGetInstanceDataMapping.csx
core/Workflows/collection-object-test/src/AlwaysTrueRule.csx
core/Workflows/subflow-test/.meta/subflow-view-test-parent.diagram.json
core/Workflows/subflow-test/subflow-view-test-parent.json
core/Workflows/subflow-test/subflow-view-test-child.json
core/Workflows/subflow-test/subflow-view-test-grandchild.json
Add local Mocklab+Dapr docker setup and Dapr configuration for mocks.
  • Introduced docker-compose with mocklab service and sidecar dapr container on shared development network.
  • Configured volume mounting of seed collections into mocklab container.
  • Added Dapr configuration disabling mTLS for local mocklab usage.
docker-compose.yml
etc/docker/config/seed/account-opening-collection.json
etc/docker/config/seed/payments-collection.json
etc/dapr/config.yaml
Upgrade vnext-schema dependency and add Claude-specific repository documentation.
  • Bumped @burgan-tech/vnext-schema dependency and devDependency from 0.0.33 to 0.0.38 in package metadata and lockfile.
  • Documented repository architecture, conventions, commands, and local runtime/mock usage in CLAUDE.md.
package.json
package-lock.json
CLAUDE.md
Clean up legacy or unused task-test, OAuth, contract, and mock/mockoon components.
  • Removed task-test workflows, tasks, extensions, and mappings no longer needed.
  • Removed OAuth and contract-related workflows, tasks, views, and C# mappings.
  • Removed older mockoon migration-api configuration and several workflow HTTP test files and BUSY-STATE-TEST readme that are now obsolete.
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/*
core/Tasks/oauth/*
core/Tasks/contract/*
core/Tasks/account-opening/user-session.json
core/Workflows/task-test/*
core/Workflows/oauth/*
core/Workflows/contract/*
core/Workflows/subflow-test/BUSY-STATE-TEST-README.md
core/Workflows/account-opening/account-opening-workflow.http
core/Workflows/payments/scheduled-payments-workflow.http
mockoon/migration-api.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

@yilmaztayfun yilmaztayfun merged commit b022358 into master Apr 15, 2026
1 of 3 checks passed
@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 189 files, which is 39 over the limit of 150.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b216a7b6-359a-4c70-b1a4-f067fc43d49f

📥 Commits

Reviewing files that changed from the base of the PR and between 590b772 and 344ab4f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (189)
  • CLAUDE.md
  • core/Extensions/account-opening/extension-user-session.json
  • 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/Functions/account-opening/multi-task-function-test.json
  • core/Functions/account-opening/payment-types.json
  • core/Functions/account-opening/src/FunctionGetInstanceDataMapping.csx
  • core/Functions/account-opening/src/FunctionOutputMapping.csx
  • core/Functions/account-opening/src/FunctionValidatePoliciesMapping.csx
  • core/Functions/account-opening/src/LookupPaymentTypes.csx
  • core/Schemas/account-opening/account-details-input.json
  • core/Schemas/account-opening/account-opening-master.json
  • core/Tasks/account-opening/user-session.json
  • core/Tasks/contract/get-contract-documents.json
  • core/Tasks/contract/notify-document-approved.json
  • core/Tasks/contract/notify-document-ready.json
  • core/Tasks/contract/render-document.json
  • core/Tasks/contract/start-document-subprocess.json
  • core/Tasks/oauth/check-device-registration.json
  • core/Tasks/oauth/check-push-denied-response.json
  • core/Tasks/oauth/check-push-response.json
  • core/Tasks/oauth/generate-tokens.json
  • core/Tasks/oauth/register-device.json
  • core/Tasks/oauth/send-otp-notification.json
  • core/Tasks/oauth/send-push-notification.json
  • core/Tasks/oauth/validate-authorization-code.json
  • core/Tasks/oauth/validate-client.json
  • core/Tasks/oauth/validate-user-credentials.json
  • core/Tasks/oauth/verify-otp-code.json
  • core/Tasks/subflow-test/trigger-busy-completion-task.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/Tasks/task-test/test-dapr-pubsub.json
  • core/Tasks/task-test/test-dapr-service-task.json
  • core/Tasks/task-test/test-direct-transition.json
  • core/Tasks/task-test/test-get-instance-data.json
  • core/Tasks/task-test/test-get-instances.json
  • core/Tasks/task-test/test-http-items.json
  • core/Tasks/task-test/test-http-task.json
  • core/Tasks/task-test/test-start-workflow.json
  • core/Tasks/task-test/test-subprocess.json
  • core/Views/account-opening/account-type-selection-view.json
  • core/Workflows/account-opening/.meta/account-opening-workflow.diagram.json
  • core/Workflows/account-opening/account-opening-workflow.http
  • core/Workflows/account-opening/account-opening-workflow.json
  • core/Workflows/account-opening/src/CreateBankAccountMapping.csx
  • core/Workflows/account-opening/src/InitialTransMapping.csx
  • core/Workflows/account-opening/src/OnEntryGetInstanceDataMapping.csx
  • core/Workflows/account-opening/src/TriggerGetInstanceTaskMapping.csx
  • core/Workflows/collection-object-test/collection-object-test-workflow.json
  • core/Workflows/collection-object-test/src/AlwaysTrueRule.csx
  • core/Workflows/collection-object-test/src/CreateAndSetMapping.csx
  • core/Workflows/collection-object-test/src/GetListAndAsListMapping.csx
  • core/Workflows/collection-object-test/src/InitCollectionTestMapping.csx
  • core/Workflows/collection-object-test/src/ListAddRemoveMapping.csx
  • core/Workflows/collection-object-test/src/ListFilterCountAnyMapping.csx
  • core/Workflows/collection-object-test/src/ListFirstLastMapping.csx
  • core/Workflows/collection-object-test/src/ListSelectMapping.csx
  • core/Workflows/collection-object-test/src/RemovePropertyToDictionaryMapping.csx
  • core/Workflows/contract/.meta/contract-approval-workflow.diagram.json
  • core/Workflows/contract/.meta/contract-document-subflow.diagram.json
  • core/Workflows/contract/contract-approval-workflow.http
  • core/Workflows/contract/contract-approval-workflow.json
  • core/Workflows/contract/contract-document-subflow.json
  • core/Workflows/contract/src/AllApprovedRule.csx
  • core/Workflows/contract/src/AllDocumentsReadyRule.csx
  • core/Workflows/contract/src/AlwaysTrueRule.csx
  • core/Workflows/contract/src/DocumentsLoadedRule.csx
  • core/Workflows/contract/src/GetContractDocumentsMapping.csx
  • core/Workflows/contract/src/HasMoreDocumentsRule.csx
  • core/Workflows/contract/src/IncrementApprovedCountMapping.csx
  • core/Workflows/contract/src/IncrementReadyCountMapping.csx
  • core/Workflows/contract/src/InitContractApprovalMapping.csx
  • core/Workflows/contract/src/InitDocumentMapping.csx
  • core/Workflows/contract/src/MoreApprovalsPendingRule.csx
  • core/Workflows/contract/src/NoDocumentsRule.csx
  • core/Workflows/contract/src/NotifyDocumentApprovedMapping.csx
  • core/Workflows/contract/src/NotifyDocumentReadyMapping.csx
  • core/Workflows/contract/src/NotifyDocumentRejectedMapping.csx
  • core/Workflows/contract/src/RenderDocumentMapping.csx
  • core/Workflows/contract/src/RenderFailedRule.csx
  • core/Workflows/contract/src/RenderSuccessRule.csx
  • core/Workflows/contract/src/StartDocumentSubprocessMapping.csx
  • core/Workflows/oauth/.meta/password-subflow.diagram.json
  • core/Workflows/oauth/authorization-code-subflow.json
  • core/Workflows/oauth/oauth-authentication-workflow.http
  • core/Workflows/oauth/oauth-authentication-workflow.json
  • core/Workflows/oauth/otp-mfa-subflow.json
  • core/Workflows/oauth/password-subflow.json
  • core/Workflows/oauth/push-notification-mfa-subflow.json
  • core/Workflows/oauth/src/AuthorizationCodeFlowRule.csx
  • core/Workflows/oauth/src/AuthorizationCodeSubflowMapping.csx
  • core/Workflows/oauth/src/AuthorizationFailedRule.csx
  • core/Workflows/oauth/src/AuthorizationSuccessRule.csx
  • core/Workflows/oauth/src/CheckDeviceRegistrationMapping.csx
  • core/Workflows/oauth/src/CheckPushDeniedResponseMapping.csx
  • core/Workflows/oauth/src/CheckPushResponseMapping.csx
  • core/Workflows/oauth/src/ClientCredentialsFlowRule.csx
  • core/Workflows/oauth/src/ClientInvalidRule.csx
  • core/Workflows/oauth/src/ClientValidRule.csx
  • core/Workflows/oauth/src/DeviceNotRegisteredOtpRule.csx
  • core/Workflows/oauth/src/DeviceRegisteredPushRule.csx
  • core/Workflows/oauth/src/DeviceRegisteredRule.csx
  • core/Workflows/oauth/src/GenerateTokensMapping.csx
  • core/Workflows/oauth/src/HeaderInitialMapping.csx
  • core/Workflows/oauth/src/MfaFailedRule.csx
  • core/Workflows/oauth/src/MfaSuccessRule.csx
  • core/Workflows/oauth/src/OtpInvalidMaxAttemptsRule.csx
  • core/Workflows/oauth/src/OtpInvalidRetryRule.csx
  • core/Workflows/oauth/src/OtpMfaSubflowMapping.csx
  • core/Workflows/oauth/src/OtpSendFailedRule.csx
  • core/Workflows/oauth/src/OtpSentRule.csx
  • core/Workflows/oauth/src/PasswordFlowRule.csx
  • core/Workflows/oauth/src/PasswordSubflowMapping.csx
  • core/Workflows/oauth/src/PushNotificationMfaSubflowMapping.csx
  • core/Workflows/oauth/src/PushSendFailedRule.csx
  • core/Workflows/oauth/src/PushSentRule.csx
  • core/Workflows/oauth/src/RegisterDeviceMapping.csx
  • core/Workflows/oauth/src/SendOtpNotificationMapping.csx
  • core/Workflows/oauth/src/SendPushNotificationMapping.csx
  • core/Workflows/oauth/src/TokenGenerationFailedRule.csx
  • core/Workflows/oauth/src/TokensGeneratedRule.csx
  • core/Workflows/oauth/src/ValidateAuthorizationCodeMapping.csx
  • core/Workflows/oauth/src/ValidateClientMapping.csx
  • core/Workflows/oauth/src/ValidateUserCredentialsMapping.csx
  • core/Workflows/oauth/src/VerifyOtpCodeMapping.csx
  • core/Workflows/payments/payment-notification-subflow.json
  • core/Workflows/payments/payment-process.json
  • core/Workflows/payments/scheduled-payments-workflow.http
  • core/Workflows/payments/scheduled-payments-workflow.json
  • core/Workflows/subflow-test/.meta/subflow-view-test-parent.diagram.json
  • core/Workflows/subflow-test/BUSY-STATE-TEST-README.md
  • core/Workflows/subflow-test/src/ChildSharedUpdateMapping.csx
  • core/Workflows/subflow-test/src/ParentInitialGetInstanceDataMapping.csx
  • core/Workflows/subflow-test/src/ParentSharedUpdateMapping.csx
  • core/Workflows/subflow-test/subflow-view-test-child.json
  • core/Workflows/subflow-test/subflow-view-test-grandchild.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/.meta/task-test-subflow.diagram.json
  • core/Workflows/task-test/.meta/task-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/DaprPubSubMapping.csx
  • core/Workflows/task-test/src/DaprServiceTaskMapping.csx
  • core/Workflows/task-test/src/DirectTransitionMapping.csx
  • 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/GetConfigValueMapping.csx
  • core/Workflows/task-test/src/GetInstanceDataMapping.csx
  • core/Workflows/task-test/src/GetInstancesMapping.csx
  • core/Workflows/task-test/src/GetSecretAsyncMapping.csx
  • core/Workflows/task-test/src/HttpTaskItemsMapping.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/ScriptTaskMapping.csx
  • core/Workflows/task-test/src/StartWorkflowMapping.csx
  • core/Workflows/task-test/src/SubFlowErrorMapping.csx
  • core/Workflows/task-test/src/SubFlowErrorRecoveryRule.csx
  • core/Workflows/task-test/src/SubProcessMapping.csx
  • core/Workflows/task-test/src/TaskResponseUsageMapping.csx
  • core/Workflows/task-test/src/TimeoutHandlerMapping.csx
  • core/Workflows/task-test/task-test-subflow.json
  • core/Workflows/task-test/task-test-workflow.http
  • core/Workflows/task-test/task-test-workflow.json
  • docker-compose.yml
  • etc/dapr/config.yaml
  • etc/docker/config/seed/.gitkeep
  • etc/docker/config/seed/account-opening-collection.json
  • etc/docker/config/seed/payments-collection.json
  • mockoon/migration-api.json
  • package.json
  • validate.js
  • vnext.config.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch f/sprint24

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.

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

Copy link
Copy Markdown

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 significantly enhances the vNext workflow system by introducing a detailed CLAUDE.md guide, new workflows for testing multi-task functions and dynamic collections, and a master schema for account opening with role-based field visibility. Infrastructure updates include the addition of mocklab for API mocking and improved validation logic in validate.js to support multiple JSON schema drafts. Feedback on the implementation identifies critical compilation errors due to extra semicolons, inconsistent null-conditional access in task responses, and unsafe casting practices. Additionally, corrections are needed for inaccurate documentation comments and minor formatting inconsistencies in the markdown documentation.

{
public Task<ScriptResponse> InputHandler(WorkflowTask task, ScriptContext context)
{
var httpTask = task as HttpTask;;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

This line contains extra semicolons, which will cause a compilation error.

        var httpTask = task as HttpTask;

Comment on lines +14 to +15
var policyResult = context.OutputResponse["validateAccountPolicies"].data;
var instanceData = context.OutputResponse?["getDataFromWorkflow"].data;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

There's an inconsistent use of the null-conditional operator (?) when accessing context.OutputResponse. On line 14, a direct access is performed, which could lead to a NullReferenceException if OutputResponse is null. However, line 15 correctly uses the null-conditional operator. For safety and consistency, you should use it on both lines.

        var policyResult = context.OutputResponse?["validateAccountPolicies"].data;
        var instanceData = context.OutputResponse?["getDataFromWorkflow"].data;

Comment thread CLAUDE.md
- `core/Views/` — UI component definitions bound to workflow states
- `core/Schemas/` — JSON Schema definitions for data validation
- `core/Functions/` — Reusable business logic callable from workflows
`core/Extensions/` — Runtime capability extensions

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

This list item is missing a leading hyphen. For formatting consistency with the rest of the list, please add one.

Suggested change
`core/Extensions/` — Runtime capability extensions
- `core/Extensions/` — Runtime capability extensions

Comment on lines +5 to +7
/// <summary>
/// Task 2 mapping for multi-task function test.
/// Fetches current workflow instance data via GetInstanceDataTask.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The summary comment for this class appears to be incorrect and likely copied from another file. It refers to a multi-task function test and GetInstanceDataTask, which doesn't match the LookupPaymentTypes class. Please update the comment to accurately describe this class's purpose.

/// <summary>
/// Mapping for the payment-types function.
/// </summary>

{
public Task<ScriptResponse> InputHandler(WorkflowTask task, ScriptContext context)
{
var triggerTask = (task as GetInstanceDataTask)!;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using the null-forgiving operator (!) here can hide potential runtime errors if the task object is not of type GetInstanceDataTask. A safer approach is to perform a proper type check and handle the case where the cast might fail, for example by throwing an InvalidCastException or InvalidOperationException.

        var triggerTask = task as GetInstanceDataTask ?? throw new InvalidOperationException("Task is not a GetInstanceDataTask");

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • In validate.js, getAjvInstance only distinguishes draft-2019-09 by a substring check on $schema; consider handling unknown/missing drafts more explicitly (e.g., logging the detected draft or throwing on unsupported versions) to make schema selection and future draft support easier to reason about.
  • Several new C# mappings declare async Task<ScriptResponse> OutputHandler(...) but never await (e.g., ParentSharedUpdateMapping, ChildSharedUpdateMapping); either remove async and return Task.FromResult(...) or introduce awaited async work to avoid unnecessary state-machine overhead and compiler warnings.
  • In ParentInitialGetInstanceDataMapping, triggerTask.SetInstance("50044086189") is hard-coded; consider deriving the instance identifier from configuration or ScriptContext to avoid baking environment-specific IDs into the workflow logic.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `validate.js`, `getAjvInstance` only distinguishes draft-2019-09 by a substring check on `$schema`; consider handling unknown/missing drafts more explicitly (e.g., logging the detected draft or throwing on unsupported versions) to make schema selection and future draft support easier to reason about.
- Several new C# mappings declare `async Task<ScriptResponse> OutputHandler(...)` but never `await` (e.g., `ParentSharedUpdateMapping`, `ChildSharedUpdateMapping`); either remove `async` and return `Task.FromResult(...)` or introduce awaited async work to avoid unnecessary state-machine overhead and compiler warnings.
- In `ParentInitialGetInstanceDataMapping`, `triggerTask.SetInstance("50044086189")` is hard-coded; consider deriving the instance identifier from configuration or `ScriptContext` to avoid baking environment-specific IDs into the workflow logic.

## Individual Comments

### Comment 1
<location path="docker-compose.yml" line_range="18-22" />
<code_context>
+    networks:
+      - bbt-development
+
+  mocklab-dapr:
+    image: daprio/daprd:latest
+    container_name: mocklab-dapr
+    command:
+      - ./daprd
+      - --app-id
+      - mocklab
</code_context>
<issue_to_address>
**issue (bug_risk):** Revisit daprd invocation; using './daprd' with the daprd image may not be necessary and could fail.

The `daprio/daprd` image already uses `daprd` as its entrypoint, so the command should usually be just the flags (e.g. `[
</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.

Comment thread docker-compose.yml
Comment on lines +18 to +22
mocklab-dapr:
image: daprio/daprd:latest
container_name: mocklab-dapr
command:
- ./daprd

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (bug_risk): Revisit daprd invocation; using './daprd' with the daprd image may not be necessary and could fail.

The daprio/daprd image already uses daprd as its entrypoint, so the command should usually be just the flags (e.g. `[

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.

1 participant