Skip to content

VCST-4927: Add virto oz#130

Open
basilkot wants to merge 25 commits into
devfrom
feat/VCST-4927-virto-oz
Open

VCST-4927: Add virto oz#130
basilkot wants to merge 25 commits into
devfrom
feat/VCST-4927-virto-oz

Conversation

@basilkot
Copy link
Copy Markdown
Collaborator

@basilkot basilkot commented Apr 29, 2026

Description

References

QA-test:

Jira-link:

https://virtocommerce.atlassian.net/browse/VCST-4927

Artifact URL:

https://vc3prerelease.blob.core.windows.net/packages/VirtoCommerce.PageBuilderModule_3.1011.0-pr-130-81e1.zip


Note

Medium Risk
Adds an externally-configured iframe integration (postMessage + sanitizer bypass) and introduces new page content write paths, which can impact security posture and persistence behavior if misconfigured. Also changes export batching/logging, which could affect export performance and production logging noise.

Overview
Virto OZ integration: Adds a new ai-agent module to the Angular Page Builder designer, rendering a toggle button and a right-side panel that hosts an Oz iframe and performs a postMessage handshake (CHAT_READYINIT_CONTEXT) gated by configured origin.

Configuration: Introduces a new platform setting VirtoCommerce.PageBuilderModule.General.OzAgentUrl and wires ozAgentUrl into the designer app config (settings.json, AppConfig type), disabling the UI when unset.

Page content persistence + robustness tweaks: Adds request models (CreateGroupedPageRequest, UpdatePageContentRequest) and a transient PageBuilderPage.Content field that is mapped into PageBuilderContentEntity on create; ContentStreamRepository.LoadBinaryAsync now skips null DB values. Export/import is adjusted to BatchSize = 1 and includes extra console logging, and repo docs/metadata are updated (skills docs, commit convention formatting, PR template, migration state file).

Reviewed by Cursor Bugbot for commit 81e1c13. Bugbot is set up for automated code reviews on this repo. Configure here.

- Implemented CreateGroupPage method in PageBuilderPageController to create a grouped page with draft content.
- Added CreateGroupedPageRequest model to encapsulate request data for creating grouped pages.
- Introduced OzAgentTransportService and OzContextService for handling communication with the OZ agent in the page builder designer.
- Defined types for OZ messaging in types.ts to facilitate structured communication.
- Created page-builder-expert.md to outline the AI-powered page generation process and rules.
- Added create-page.yaml tool definition for the new page creation API.
- Updated project file to include necessary content and configurations for AI integration.
basilkot and others added 7 commits May 1, 2026 20:13
- Added OzAgentUrl localization entries for Portuguese, Russian, Swedish, and Chinese.
- Expanded PageBuilder Expert agent capabilities with new intents: Diagnose and Bulk.
- Updated schema retrieval process to improve efficiency and clarity.
- Introduced new tools for fetching page metadata and publishing pages.
- Enhanced validation for page content envelopes with comprehensive unit tests.
- Bump @vc-shell/framework, @vc-shell/config-generator, @vc-shell/api-client-generator and @vc-shell/ts-config from 1.2.3 to 2.0.3
- Drop @vc-shell/release-config dependency and remove scripts/release.ts
- Regenerate api_client with --APP_TYPE_STYLE=Interface for vc-shell 2.0.3
- Adapt page-builder module (components, composables, pages, routes) to the new shell API
- Remove obsolete src/shims-vue.d.ts
- Reformat .github/COMMIT_CONVENTION.md and PULL_REQUEST_TEMPLATE.md
JsonSerializer jsonSerializer)
{
private const int BatchSize = 50;
private const int BatchSize = 1;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Debug batch size of 1 left in export

High Severity

BatchSize was changed from 50 to 1, which is clearly a debugging value left in. This causes the export to fetch pages one at a time instead of in batches of 50, resulting in ~50x more database round-trips and dramatically slower export performance for any non-trivial dataset.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a0f4b5c. Configure here.


for (criteria.Skip = 0; ; criteria.Skip += BatchSize)
{
Console.WriteLine(criteria.Skip);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Debug Console.WriteLine statements left in production code

Medium Severity

Two Console.WriteLine calls were added to the export loop — one printing criteria.Skip and another printing group.Name. These are debug statements that will pollute stdout in production and leak page metadata to server logs unnecessarily.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a0f4b5c. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

There are 4 total unresolved issues (including 2 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 81e1c13. Configure here.

}
}
},
"ozAgentUrl": ""
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

OZ URL not from platform

Medium Severity

The designer adds ozAgentUrl as a fixed empty string while the module registers VirtoCommerce.PageBuilderModule.General.OzAgentUrl. Unlike previewPath, it never loads the platform setting, so configuring OZ in admin leaves the designer integration disabled.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 81e1c13. Configure here.

if (saved) {
this._isOpen.set(!!saved.isOpen);
this._isPinned.set(!!saved.isPinned);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Panel open without URL

Medium Severity

Saved UI state restores isOpen and isPinned even when agentUrl is missing. The panel host still applies open/pinned layout classes, reserving a 420px strip with no content and no close control because the toggle and header render only when a URL exists.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 81e1c13. Configure here.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4 New Major Issues (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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