Skip to content

Fix UserTypeResolver to return meta for the SDK UI rendering#1106

Merged
ThaminduDilshan merged 3 commits intoasgardeo:mainfrom
ThaminduDilshan:thamindu-flow-impr
Jan 19, 2026
Merged

Fix UserTypeResolver to return meta for the SDK UI rendering#1106
ThaminduDilshan merged 3 commits intoasgardeo:mainfrom
ThaminduDilshan:thamindu-flow-impr

Conversation

@ThaminduDilshan
Copy link
Contributor

Purpose

This pull request fixes returning meta for the UserTypeResolver dynamic inputs. Additionally this PR introduces prompt nodes with meta for the default registration flow definition.

Approach

  • Introduces a meta builder to the core that is capable of building meta element for the user input response dynamically, particularly from executors
  • Fixes UserTypeResolver executor to return a meta element when prompting to select a user type
  • Fixes the gate frontend to render user type selection UIs, incorporating related SDK changes
  • Define PROMPT nodes with meta element in the default registration flow

Related Issues

Related PRs

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes the UserTypeResolver executor to return meta for SDK UI rendering and introduces dynamic meta generation capabilities for flow executors.

Changes:

  • Introduces a MetaBuilder in the flow core package for dynamically constructing UI metadata structures
  • Updates UserTypeResolver to return meta when prompting user type selection using the new MetaBuilder
  • Modifies task execution nodes to prefer executor-returned meta over node-configured meta in verbose mode
  • Updates default registration flow definition with PROMPT nodes containing meta elements
  • Updates frontend dependencies (@asgardeo/react from 0.6.27 to 0.6.31) and sample app SDK to support the new meta structure
  • Adds i18n translations for user type selection (label and placeholder)

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
backend/internal/flow/core/meta_builder.go New MetaBuilder implementation for dynamic meta construction with fluent API
backend/internal/flow/core/meta_builder_test.go Comprehensive unit tests for MetaBuilder functionality
backend/internal/flow/executor/user_type_resolver.go Updated to use MetaBuilder for generating user type selection meta
backend/internal/flow/executor/user_type_resolver_test.go Updated tests to verify meta structure is returned
backend/internal/flow/core/task_execution_node.go Modified to prefer executor meta over node meta in verbose mode
backend/internal/flow/core/task_execution_node_test.go Added tests for executor meta precedence logic
backend/internal/flow/common/model.go Added Meta field to ExecutorResponse
backend/cmd/server/bootstrap/flows/registration/registration_flow_basic.json Updated with PROMPT nodes containing structured meta for credentials and user info
frontend/apps/thunder-gate/src/components/SignUp/SignUpBox.tsx Enhanced SELECT component handling to support both string and object options
frontend/packages/thunder-i18n/src/locales/en-US.ts Added usertype label and placeholder translations
frontend/pnpm-workspace.yaml Updated @asgardeo/react catalog version to 0.6.31
frontend/pnpm-lock.yaml Updated dependency lockfile
samples/apps/react-sdk-sample/package.json Updated @asgardeo/react to 0.6.31
samples/apps/react-sdk-sample/pnpm-lock.yaml Updated sample app dependency lockfile
Files not reviewed (2)
  • frontend/pnpm-lock.yaml: Language not supported
  • samples/apps/react-sdk-sample/pnpm-lock.yaml: Language not supported

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 96.73203% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.27%. Comparing base (a84ac26) to head (b2b356d).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
backend/internal/flow/mgt/service.go 88.37% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1106      +/-   ##
==========================================
+ Coverage   87.09%   87.27%   +0.17%     
==========================================
  Files         535      536       +1     
  Lines       36152    36240      +88     
  Branches     1611     1611              
==========================================
+ Hits        31488    31627     +139     
+ Misses       3012     2976      -36     
+ Partials     1652     1637      -15     
Flag Coverage Δ
backend-integration-postgres 55.11% <71.24%> (+0.15%) ⬆️
backend-integration-sqlite 55.08% <71.24%> (+0.15%) ⬆️
backend-unit 79.15% <94.11%> (+0.44%) ⬆️
frontend-apps-develop-unit 80.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI review requested due to automatic review settings January 16, 2026 11:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.

Files not reviewed (2)
  • frontend/pnpm-lock.yaml: Language not supported
  • samples/apps/react-sdk-sample/pnpm-lock.yaml: Language not supported

@thiva-k
Copy link
Contributor

thiva-k commented Jan 16, 2026

Hope we are planning to add meta for ProvisioningExecutor too and improve it to dynamically get schema attributes as inputs in future efforts

Copilot AI review requested due to automatic review settings January 16, 2026 13:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 15 changed files in this pull request and generated no new comments.

Files not reviewed (2)
  • frontend/pnpm-lock.yaml: Language not supported
  • samples/apps/react-sdk-sample/pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)

frontend/apps/thunder-gate/src/components/SignUp/SignUpBox.tsx:252

  • The type definition for options is string[] but the code at lines 419-441 handles both string and { value: string; label: string } types. The type definition should be updated to match the actual implementation: options?: (string | { value: string; label: string })[] to provide accurate type information for consumers of this component.
                                              options?: string[];

frontend/apps/thunder-gate/src/components/SignUp/SignUpBox.tsx:262

  • Similar to the previous type definition issue on line 252, this options type declaration should also be updated to (string | { value: string; label: string })[] to accurately reflect the handling logic used later in the component.
                                              options?: string[];

thiva-k

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings January 19, 2026 06:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 25 out of 27 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • frontend/pnpm-lock.yaml: Language not supported
  • samples/apps/react-sdk-sample/pnpm-lock.yaml: Language not supported

@ThaminduDilshan ThaminduDilshan merged commit c406531 into asgardeo:main Jan 19, 2026
38 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signup is broken in gate app due to flow not returning meta

3 participants