-
Notifications
You must be signed in to change notification settings - Fork 96
debug(designer): Add console logs to trace static result schema flow #8725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add debug logging throughout the static result schema pipeline to help diagnose issues where Testing tab fields don't match actual action outputs. Logs added at: - Schema generation (apiConnector.ts) - Schema dispatch to Redux (operationdeserializer.ts) - TestingPanel component render (testingTab/index.tsx) - StaticResultContainer parsing (staticResult/index.tsx) - StaticResultProperties dropdown (staticResultProperties.tsx) Filter console by '[DEBUG StaticResult]' to trace the schema flow. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
❌ Commit Type
❌ Risk Level
❌ What & Why
❌ Impact of Change
❌ Test Plan
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | Keep the title. Add matching Commit Type in body. |
| Commit Type | ❌ | Select exactly one type in the PR body (suggest chore). |
| Risk Level | ❌ | Add risk:medium label and checkbox in body; explain any mitigating controls. |
| What & Why | ✅ | Add a note about privacy/security of logged schema. |
| Impact of Change | ❌ | Populate Users/Developers/System impacts and call out potential data exposure. |
| Test Plan | ❌ | Add automated tests or a clear manual test confirmation + justification. |
| Contributors | Optional: add contributors if applicable. | |
| Screenshots/Videos | Not applicable. |
Final message
This PR does not pass the PR body checklist. Primary reasons:
- No Commit Type selected in the PR body (required).
- No Risk Level selected and no risk label on the PR (required). I advise
risk:mediumdue to potential data exposure from JSON-stringified schemas printed at several layers. - No automated tests added and no justification for skipping tests (the PR should either contain tests or a clear manual testing + rationale).
Action items to get this PR accepted:
- Edit the PR body and set Commit Type to exactly one option. Suggested:
- [x] chorewith a one-line note: "Adding debug logs for local troubleshooting; will be gated/removed before production if necessary." - Add a Risk Level checkbox and label. Suggested:
- [x] Medium - Potential for verbose logs and schema data exposureand add the GitHub labelrisk:mediumto the PR. - Update the What & Why to explicitly mention whether the logs will remain in production and any mitigating controls (dev-only flag, guard via environment variable, remove before release).
- Expand Impact of Change with separate bullets for Users/Developers/System (copy examples above).
- Update the Test Plan: either add unit tests (where reasonable) or mark Manual testing completed and provide the exact steps and expected output. If manual testing is used, explain why automated tests are not appropriate for these console logs.
- Consider replacing direct console.log calls with a repo logging utility or guard these logs behind a DEV-only feature flag so that production does not leak potentially sensitive schema data. If keeping console logs is acceptable, explicitly state that these logs will be removed or toggled off before release.
Please update the PR title/body and labels as recommended, then re-submit. Thank you for the clear summary and for adding helpful debug points — once the requested PR metadata and safeguards/tests are added, this should be approvable.
Last updated: Fri, 23 Jan 2026 00:19:49 GMT
|
📊 Coverage check completed. See workflow run for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds diagnostic logging across the “static result schema” flow to trace how an operation’s output schema is generated, stored, and rendered in the Testing tab UI.
Changes:
- Added debug logs during schema generation/wrapping for API connector operations.
- Added debug logs when fetching/dispatching static result schemas into Redux during operation initialization.
- Added debug logs in Testing tab/static result UI components to inspect received/parsed schema and rendered property options.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/logic-apps-shared/src/designer-client-services/lib/staticresultschema/schemas/apiConnector.ts | Logs schema generation/cleaning/wrapping for API connector output schemas. |
| libs/designer/src/lib/ui/panel/nodeDetailsPanel/tabs/testingTab/index.tsx | Logs what schema/properties the Testing tab receives from selectors. |
| libs/designer/src/lib/core/actions/bjsworkflow/operationdeserializer.ts | Logs schema fetch/dispatch timing and payload during manifest operation init. |
| libs/designer-ui/src/lib/staticResult/staticResultProperties.tsx | Logs dropdown options and shown fields used for static result property rendering. |
| libs/designer-ui/src/lib/staticResult/index.tsx | Logs parsed schema result produced by parseStaticResultSchema. |
| // Debug logging for Testing tab | ||
| useEffect(() => { | ||
| console.log('[DEBUG StaticResult] TestingPanel rendered', { | ||
| selectedNode, | ||
| connectorId, | ||
| operationId, | ||
| schemaId: `${connectorId}-${operationId}`, | ||
| hasSchema: !!staticResultSchema, | ||
| schemaProperties: staticResultSchema?.properties ? Object.keys(staticResultSchema.properties) : 'none', | ||
| outputsProperties: staticResultSchema?.properties?.outputs?.properties | ||
| ? Object.keys(staticResultSchema.properties.outputs.properties) | ||
| : 'none', | ||
| bodySchema: staticResultSchema?.properties?.outputs?.properties?.body | ||
| ? JSON.stringify(staticResultSchema.properties.outputs.properties.body, null, 2) | ||
| : 'none', | ||
| currentProperties: properties, |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This effect logs on every render and includes full schema/body JSON and current properties. That can be very noisy (and potentially expose user/workflow details in the console). Please gate this behind an explicit debug flag (dev-only/localStorage toggle) and prefer logging small summaries (ids/keys) rather than full serialized schemas.
| // Debug logging for Testing tab | |
| useEffect(() => { | |
| console.log('[DEBUG StaticResult] TestingPanel rendered', { | |
| selectedNode, | |
| connectorId, | |
| operationId, | |
| schemaId: `${connectorId}-${operationId}`, | |
| hasSchema: !!staticResultSchema, | |
| schemaProperties: staticResultSchema?.properties ? Object.keys(staticResultSchema.properties) : 'none', | |
| outputsProperties: staticResultSchema?.properties?.outputs?.properties | |
| ? Object.keys(staticResultSchema.properties.outputs.properties) | |
| : 'none', | |
| bodySchema: staticResultSchema?.properties?.outputs?.properties?.body | |
| ? JSON.stringify(staticResultSchema.properties.outputs.properties.body, null, 2) | |
| : 'none', | |
| currentProperties: properties, | |
| // Debug logging for Testing tab (dev-only, gated by localStorage flag) | |
| useEffect(() => { | |
| // Only log in non-production environments | |
| if (process.env.NODE_ENV === 'production') { | |
| return; | |
| } | |
| // Ensure we're in a browser environment with localStorage | |
| if (typeof window === 'undefined' || typeof window.localStorage === 'undefined') { | |
| return; | |
| } | |
| const isDebugEnabled = window.localStorage.getItem('LA_DESIGNER_STATICRESULT_DEBUG') === 'true'; | |
| if (!isDebugEnabled) { | |
| return; | |
| } | |
| const schemaProperties = staticResultSchema?.properties; | |
| const outputsProperties = schemaProperties && 'outputs' in schemaProperties ? (schemaProperties as any).outputs?.properties : undefined; | |
| const hasBodySchema = !!(outputsProperties && 'body' in outputsProperties); | |
| const propertyKeys = | |
| properties && typeof properties === 'object' ? Object.keys(properties as Record<string, unknown>) : []; | |
| console.log('[DEBUG StaticResult] TestingPanel rendered', { | |
| selectedNode, | |
| connectorId, | |
| operationId, | |
| schemaId: `${connectorId}-${operationId}`, | |
| hasSchema: !!staticResultSchema, | |
| schemaPropertyKeys: schemaProperties ? Object.keys(schemaProperties) : [], | |
| outputsPropertyKeys: outputsProperties ? Object.keys(outputsProperties) : [], | |
| hasBodySchema, | |
| propertyKeys, |
| const parsed = parseStaticResultSchema(staticResultSchema); | ||
| console.log('[DEBUG StaticResult] StaticResultContainer - parseStaticResultSchema', { | ||
| inputSchema: JSON.stringify(staticResultSchema, null, 2), | ||
| parsedPropertiesKeys: parsed.properties ? Object.keys(parsed.properties) : 'none', | ||
| parsedRequired: parsed.required, | ||
| outputsInParsed: parsed.properties?.outputs ? JSON.stringify(parsed.properties.outputs, null, 2) : 'none', | ||
| }); | ||
| return parsed; |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log inside useMemo runs during render and is a side effect; in React StrictMode it may run twice and it makes render less pure. If you keep this diagnostic, move it to a useEffect that depends on staticResultSchema/parsed output (and gate behind a debug flag) to avoid render-path side effects.
| // Debug logging for StaticResultProperties | ||
| useEffect(() => { | ||
| console.log('[DEBUG StaticResult] StaticResultProperties rendered', { | ||
| isRoot, | ||
| propertiesSchemaKeys: propertiesSchema ? Object.keys(propertiesSchema) : 'none', | ||
| required, | ||
| shownProperties, | ||
| propertyValues, | ||
| dropdownOptions: getOptions(propertiesSchema, required), |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component logs full dropdown options and propertyValues every render, which can be large and may contain user-provided values. Please gate behind a debug flag (dev-only/localStorage toggle) and consider logging only counts/keys instead of full objects to reduce noise and data exposure risk.
| // Debug logging for StaticResultProperties | |
| useEffect(() => { | |
| console.log('[DEBUG StaticResult] StaticResultProperties rendered', { | |
| isRoot, | |
| propertiesSchemaKeys: propertiesSchema ? Object.keys(propertiesSchema) : 'none', | |
| required, | |
| shownProperties, | |
| propertyValues, | |
| dropdownOptions: getOptions(propertiesSchema, required), | |
| // Debug logging for StaticResultProperties (gated behind localStorage flag) | |
| useEffect(() => { | |
| if (typeof window === 'undefined') { | |
| return; | |
| } | |
| const debugFlag = window.localStorage?.getItem('mslaDebugStaticResultProperties'); | |
| if (debugFlag !== 'true') { | |
| return; | |
| } | |
| const dropdownOptions = getOptions(propertiesSchema, required) ?? []; | |
| const propertyKeys = propertyValues ? Object.keys(propertyValues) : []; | |
| console.log('[DEBUG StaticResult] StaticResultProperties rendered', { | |
| isRoot, | |
| propertiesSchemaKeys: propertiesSchema ? Object.keys(propertiesSchema) : [], | |
| required, | |
| shownPropertyKeys: Object.keys(shownProperties), | |
| shownPropertyCount: Object.keys(shownProperties).length, | |
| propertyValueKeys: propertyKeys, | |
| propertyValueCount: propertyKeys.length, | |
| dropdownOptionCount: dropdownOptions.length, | |
| dropdownOptionKeys: dropdownOptions.map((option: any) => option?.key ?? option?.text), |
| console.log('[DEBUG StaticResult] getStaticResultSchemaForAPIConnector called', { | ||
| operationId, | ||
| parserType: parser.constructor.name, | ||
| outputSchema: JSON.stringify(outputSchema, null, 2), | ||
| }); |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These debug logs are unconditional and will ship to production bundles for a shared library. This adds noise and can leak workflow/schema details in customer consoles. Please gate this behind an explicit debug flag (e.g., dev-only build, env var, or localStorage toggle) and/or route through the repo’s LoggerService at a verbose level so it can be disabled centrally.
| console.log('[DEBUG StaticResult] wrapOutputsSchemaToOperationSchema', { | ||
| originalOutputSchema: JSON.stringify(outputSchema, null, 2), | ||
| cleanedSchema: JSON.stringify(newSchema, null, 2), | ||
| finalBodySchema: JSON.stringify(schema.properties.outputs.properties.body, null, 2), | ||
| }); |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The debug logging stringifies the entire schema payload multiple times (original, cleaned, final). This can be quite expensive for large schemas and makes logs hard to scan. Consider logging only high-level details (e.g., top-level keys) or deferring deep serialization behind an explicit debug flag.
| console.log('[DEBUG StaticResult] operationdeserializer - fetching schema', { | ||
| nodeId, | ||
| connectorId, | ||
| operationId, | ||
| manifestOutputs: JSON.stringify(manifest.properties.outputs, null, 2), | ||
| }); |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file already uses LoggerService for operational logging elsewhere; adding raw console.log calls here bypasses log levels/telemetry sinks and can’t be controlled centrally. Please replace these with LoggerService().log(...) (verbose/trace) and/or guard them behind a debug flag.
Summary
Debug Points Added
Logs added at key points in the schema flow:
apiConnector.ts) - Logs when schema is fetched from parseroperationdeserializer.ts) - Logs the full schema being storedtestingTab/index.tsx) - Logs what schema the Testing tab receivesstaticResult/index.tsx) - Logs parsed schema structurestaticResultProperties.tsx) - Logs dropdown options and shown fieldsHow to Use
pnpm run start[DEBUG StaticResult]Test plan
🤖 Generated with Claude Code