Skip to content

5856 Warn when the output tab shows placeholder sample data - #5857

Open
ivicac wants to merge 2 commits into
masterfrom
5856
Open

ivicac wants to merge 2 commits into
masterfrom
5856

Conversation

@ivicac

@ivicac ivicac commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Fixes #5856

Problem

When a node has not been tested, the workflow editor's Output tab shows its output schema filled with values generated from the schema itself (57 for integers, sample <name> for strings). Nothing says these are placeholders, so downstream nodes that reference this output are tested against fake values without the user realising the upstream node should be tested first.

Change

The server already knows where a node's output came from: WorkflowNodeOutputFacadeImpl checks for a saved test output first (from Test Action or Upload Sample Output), then a dynamic output function, then the definition's static schema, and it sets WorkflowNodeOutput.testOutputResponse only in the first case. The client never read that flag, and the cluster element endpoint always sent false.

Server

  • ClusterElementOutputDTO carries testOutputResponse, set by the facade when the output comes from the test-output store. The fallback order is unchanged.
  • WorkflowNodeOutputApiController.getClusterElementOutput passes the real value instead of false.

Client

  • useOutputTab reads testOutputResponse, and OutputSchemaDisplay shows an amber warning above the schema when the output is not from a real run. The warning explains that nodes using this output will be tested with placeholder values and names the action to take: Click Test Action / Trigger / Tool, or Upload a sample output for operations that cannot be tested directly.
  • Task dispatchers are excluded, because their output is built from their child tasks.
  • Adds the warning variant to the Alert UI component.

Tests

  • WorkflowNodeOutputFacadeTest: a cluster element with a saved test output reports true; one that falls back to the definition output reports false.
  • WorkflowNodeOutputApiControllerTest (new): the cluster element endpoint passes the flag through in both states.
  • OutputSchemaDisplay.test.tsx: the warning shows for placeholder output, is hidden after a test run and for task dispatchers, and uses the upload wording for resume actions.

To check that the two true-case tests can fail, I put back the old hardcoded false in the facade and the controller; both failed.

@ivicac

ivicac commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator Author
image

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The warning is suppressed for falsey samples and for dynamic trigger outputs that the server marks as tested.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR propagates test-output provenance from the server to the workflow editor and warns users when displayed output is placeholder data.

Changes:

  • Added testOutputResponse handling for cluster element outputs.
  • Added client warning UI and operation-specific guidance.
  • Added server and client tests plus an Alert warning variant.
File Description
WorkflowNodeOutputFacadeTest.java Tests output provenance
WorkflowNodeOutputFacadeImpl.java Sets cluster output provenance
WorkflowNodeOutputApiControllerTest.java Tests flag propagation
WorkflowNodeOutputApiController.java Forwards provenance to API DTO
ClusterElementOutputDTO.java Carries provenance flag
OutputTab.tsx Passes flag to display
OutputSchemaDisplay.tsx Renders placeholder warning
OutputSchemaDisplay.test.tsx Tests warning behavior
useOutputTab.ts Reads output provenance
alert.tsx Adds warning styling

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


const operationLabel = clusterElementType === 'tools' ? 'Tool' : currentNode.trigger ? 'Trigger' : 'Action';
const testable = !resumePerformFunctionDefined && !variablePropertiesDefined;
const showPlaceholderSampleOutputWarning = !testOutputResponse && !currentNode.taskDispatcher && !!sampleOutput;
@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

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.

Output tab does not warn when the output schema is built from placeholder sample data

2 participants