Skip to content

[Orchestrator] Backporting bug fixes for 1.9.4 release#2734

Merged
lokanandaprabhu merged 2 commits intoworkspace/orchestratorfrom
orchestrator-1.9-backport
Apr 9, 2026
Merged

[Orchestrator] Backporting bug fixes for 1.9.4 release#2734
lokanandaprabhu merged 2 commits intoworkspace/orchestratorfrom
orchestrator-1.9-backport

Conversation

@lokanandaprabhu
Copy link
Copy Markdown
Member

Backporting below fixes for 1.9 release

#2654
#2602
#2653
#2570
#2725

lokanandaprabhu and others added 2 commits April 1, 2026 19:44
…2666)

* feat(orchestrator): pre-populate Execute Workflow form from URL query params (#2570)

* prepopulate workflow execution page form from URL query params

Signed-off-by: Karthik <karthik.jk11@gmail.com>

* support enum coercison for case-insenstive match and skip invalid values

* add support for fields that are defined via '$ref'

* add full support for json schema fields

---------

Signed-off-by: Karthik <karthik.jk11@gmail.com>

* fix(orchestrator-form-react): scope async validation to active step (#2602)

* fix(orchestrator-form-react): scope async validation to active step

Limit validate:url requests to the active step during multi-step navigation.

Made-with: Cursor

* fix(orchestrator-form-react): keep full formData for async validation

Pass full formData to template evaluation while scoping uiSchema traversal.

Made-with: Cursor

* fix(orchestrator-form-react): preserve ui:hidden on objects with properties (#2653)

* fix(orchestrator): honor json schema defaults in initial formData (#2654)

* fix(orchestrator): honor json schema defaults

Ensure extractStaticDefaults falls back to JSON Schema defaults when ui:props fetch:response:default is absent so initial formData includes schema defaults.

Made-with: Cursor

* chore(changeset): document schema default fix

Add changeset for orchestrator form defaults update.

Made-with: Cursor

* fix(orchestrator): handle root defaults

Avoid setting an empty key for root schema defaults and add tests to cover root default handling.

Made-with: Cursor

* fix(orchestrator): document and test defaults

Clarify extractStaticDefaults precedence in docs and add test coverage for default handling.

Made-with: Cursor

* chore(orchestrator): update yarn.lock after backport

Made-with: Cursor

---------

Signed-off-by: Karthik <karthik.jk11@gmail.com>
Co-authored-by: Karthik Jeeyar <karthik@redhat.com>
Limit SchemaUpdater replacements to the originating scope, with robust path
resolution for nested and array schemas, plus tests covering scoping cases.

Made-with: Cursor

Co-authored-by: Lokananda Prabhu <lprabhu@redhat.com>
@rhdh-qodo-merge
Copy link
Copy Markdown

Review Summary by Qodo

Backport orchestrator fixes and enhancements for 1.9 release

✨ Enhancement 🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Pre-populate Execute Workflow form from URL query parameters with full schema support
• Honor JSON Schema defaults in initial form data before widget rendering
• Scope async validation and schema updates to active step in multi-step forms
• Fix ui:hidden preservation on object schemas with properties
• Support enum coercion and $ref resolution for query parameter prepopulation
Diagram
flowchart LR
  A["URL Query Params"] -->|mergeQueryParamsIntoFormData| B["Form Data"]
  C["JSON Schema"] -->|extractStaticDefaults| B
  D["Schema Updates"] -->|scopeId| E["Scoped Properties"]
  F["Multi-step Form"] -->|activeStep| G["Async Validation"]
  H["UI Schema"] -->|ui:hidden on objects| I["Generated UI Schema"]
  B --> J["Execute Workflow Page"]
  E --> J
  G --> J
  I --> J
Loading

Grey Divider

File Changes

1. workspaces/orchestrator/plugins/orchestrator-form-api/src/api.ts ✨ Enhancement +1/-0

Add optional scopeId parameter to schema updater

workspaces/orchestrator/plugins/orchestrator-form-api/src/api.ts


2. workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/extractStaticDefaults.test.ts 🧪 Tests +119/-0

Add comprehensive tests for schema defaults extraction

workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/extractStaticDefaults.test.ts


3. workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/extractStaticDefaults.ts 🐞 Bug fix +26/-7

Support JSON Schema defaults with proper root handling

workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/extractStaticDefaults.ts


View more (17)
4. workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/generateUiSchema.test.ts 🧪 Tests +23/-0

Add test for ui:hidden on object properties

workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/generateUiSchema.test.ts


5. workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/generateUiSchema.ts 🐞 Bug fix +1/-0

Preserve ui:* directives on objects with properties

workspaces/orchestrator/plugins/orchestrator-form-react/src/utils/generateUiSchema.ts


6. workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.test.ts 🧪 Tests +650/-0

Add extensive tests for query parameter prepopulation

workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.test.ts


7. workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.ts ✨ Enhancement +303/-0

Implement query parameter to form data merging with coercion

workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.ts


8. workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/schemaUpdater.test.ts 🧪 Tests +260/-0

Add tests for scoped schema updates with scopeId

workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/schemaUpdater.test.ts


9. workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/schemaUpdater.ts ✨ Enhancement +142/-12

Implement scopeId-based schema update scoping logic

workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/schemaUpdater.ts


10. workspaces/orchestrator/.changeset/honor-schema-defaults.md 📝 Documentation +6/-0

Document schema defaults inclusion in form data

workspaces/orchestrator/.changeset/honor-schema-defaults.md


11. workspaces/orchestrator/.changeset/schema-updater-scope-fix.md 📝 Documentation +7/-0

Document schema updater scoping improvements

workspaces/orchestrator/.changeset/schema-updater-scope-fix.md


12. workspaces/orchestrator/.changeset/scope-async-validation-to-step.md 📝 Documentation +5/-0

Document async validation scoping to active step

workspaces/orchestrator/.changeset/scope-async-validation-to-step.md


13. workspaces/orchestrator/.changeset/tall-games-fail.md 📝 Documentation +5/-0

Document query parameter prepopulation feature

workspaces/orchestrator/.changeset/tall-games-fail.md


14. workspaces/orchestrator/.changeset/unlucky-poems-drum.md 📝 Documentation +5/-0

Document ui:hidden preservation on object schemas

workspaces/orchestrator/.changeset/unlucky-poems-drum.md


15. workspaces/orchestrator/docs/user-interface.md 📝 Documentation +46/-0

Add comprehensive prepopulation documentation and examples

workspaces/orchestrator/docs/user-interface.md


16. workspaces/orchestrator/plugins/orchestrator-form-api/report.api.md 📝 Documentation +1/-1

Update API report for scopeId parameter

workspaces/orchestrator/plugins/orchestrator-form-api/report.api.md


17. workspaces/orchestrator/plugins/orchestrator-form-react/src/components/OrchestratorFormWrapper.tsx 🐞 Bug fix +12/-1

Scope async validation to active step in multi-step forms

workspaces/orchestrator/plugins/orchestrator-form-react/src/components/OrchestratorFormWrapper.tsx


18. workspaces/orchestrator/plugins/orchestrator-form-widgets/src/widgets/SchemaUpdater.tsx ✨ Enhancement +1/-1

Pass widget id to schema updater for scoping

workspaces/orchestrator/plugins/orchestrator-form-widgets/src/widgets/SchemaUpdater.tsx


19. workspaces/orchestrator/plugins/orchestrator/package.json Dependencies +1/-0

Add json-schema-library dependency for schema resolution

workspaces/orchestrator/plugins/orchestrator/package.json


20. workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/ExecuteWorkflowPage.tsx ✨ Enhancement +9/-1

Integrate query parameter prepopulation into workflow page

workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/ExecuteWorkflowPage.tsx


Grey Divider

Qodo Logo

@rhdh-qodo-merge
Copy link
Copy Markdown

rhdh-qodo-merge bot commented Apr 9, 2026

Code Review by Qodo

🐞 Bugs (1)   📘 Rule violations (0)   📎 Requirement gaps (0)   🎨 UX Issues (0)
🐞\ ≡ Correctness (1)

Grey Divider


Remediation recommended

1. Conditional params rejected 🐞
Description
mergeQueryParamsIntoFormData() skips query params unless pathExistsInSchema() finds the path in
static properties, but pathExistsInSchema() does not traverse allOf/if/then/else unless
oneOf/anyOf is present. As a result, query params for conditionally-present fields (e.g., fields
only in an allOf[].then.properties branch) will never prepopulate even when json-schema-library
could resolve them from provided data.
Code

workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.ts[R279-288]

+  for (const [paramKey, paramValue] of searchParams.entries()) {
+    if (RESERVED_QUERY_PARAMS.has(paramKey)) {
+      continue;
+    }
+    if (paramValue === undefined || paramValue === null) {
+      continue;
+    }
+
+    if (!pathExistsInSchema(schema, paramKey, schema)) continue;
+
Evidence
The prepopulation loop hard-gates on pathExistsInSchema(). That function only diverts into composite
traversal when oneOf or anyOf exists, and otherwise checks only schema.properties. This means
properties that exist only under allOf conditionals are treated as non-existent and are skipped.
The repo includes a realistic schema fixture where imageRepository, imageUrl, and namespace
are defined only under an allOf entry’s then.properties, so a query param like
ciMethod.imageRepository=... would be ignored.

workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.ts[59-86]
workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.ts[272-299]
workspaces/orchestrator/plugins/orchestrator-backend/fixtures/mockSpringBootWorkflowData.ts[40-114]
workspaces/orchestrator/docs/user-interface.md[34-48]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`mergeQueryParamsIntoFormData` currently pre-filters query params with `pathExistsInSchema()`, but that helper does not recognize properties introduced through `allOf` + `if/then/else` conditionals (a common draft-07 pattern). This causes valid query params to be dropped before `json-schema-library` gets a chance to resolve the effective schema.

### Issue Context
You already call `getSchemaAtPath()` (json-schema-library) later, which can resolve `$ref` and conditionals given the proposed data. The extra `pathExistsInSchema()` gate is both incomplete and redundant for rejecting unknown params.

### Fix Focus Areas
- workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.ts[59-109]
- workspaces/orchestrator/plugins/orchestrator/src/components/ExecuteWorkflowPage/queryParamsToFormData.ts[272-300]

### Suggested fix approach
- Prefer removing the `pathExistsInSchema()` guard entirely and rely on `getSchemaAtPath()` returning `undefined` for unknown/invalid paths.
 - This should allow conditional `then` properties to be recognized when the proposed data satisfies the condition.
- If you keep a fast-path guard, update it to account for `allOf` (and potentially `if/then/else`) at each node, not only when `oneOf/anyOf` exist.
- Add a test that mirrors the fixture pattern:
 - schema has `properties: { ci }` and `allOf: [{ if: ... }, { if: ..., then: { properties: { imageRepository: ... }}}]`
 - query params include both `ci=tekton` and `imageRepository=quay.io`
 - assert that `imageRepository` is prepopulated when condition is met.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 9, 2026

@lokanandaprabhu
Copy link
Copy Markdown
Member Author

Tested all 5 PR fixes, working fine

lgtm

@lokanandaprabhu lokanandaprabhu merged commit 1f5de5a into workspace/orchestrator Apr 9, 2026
9 checks passed
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