-
Notifications
You must be signed in to change notification settings - Fork 13
Migrate widget properties demo #523
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
Migrate widget properties demo #523
Conversation
…perty migration To be verified and fixed
…eed the loggs and a separate property migration in this case.
…-to-content-hub Widget migration/widget content to content hub
…guide about property migrations. Demonstrating on HeroBanner widget of kentico.com
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
This PR demonstrates custom widget property migrations by adding migration examples for HeroBanner and HeroImage widgets from ketico.com. The changes include new migration classes that show how to handle complex widget transformations, property mappings, and content creation during migration.
- Custom widget migration examples with property transformations and content item creation
- New property migration classes for page selectors and custom components
- Configuration updates for enhanced logging and development settings
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Migration.Tool.Extensions/ServiceCollectionExtensions.cs | Registers new widget and property migration services |
| Migration.Tool.Extensions/CustomWidgetMigrations/WidgetPageSelectorToCombinedSelectorMigration.cs | Migrates page selector properties to combined content selector format |
| Migration.Tool.Extensions/CustomWidgetMigrations/WidgetCustomSelectorMigration.cs | Template for migrating custom selector components with example implementations |
| Migration.Tool.Extensions/CustomWidgetMigrations/HeroImage/HeroImageWidgetMigration.cs | Complex widget migration that creates content items and handles property mappings |
| Migration.Tool.Extensions/CustomWidgetMigrations/HeroBanner/HeroBannerWidgetMigration.cs | Widget migration with property transformations and type conversions |
| Migration.Tool.CLI/appsettings.json | Updates connection strings, logging configuration, and feature flags |
| .vscode/settings.json | Adds VS Code color theme customization |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| { | ||
| throw new Exception("Could not publish Hero item"); | ||
| } | ||
| return new ContentItemReference { Identifier = CMS.ContentEngine.Internal.ContentItemInfo.Provider.Get(itemId).ContentItemGUID }; |
Copilot
AI
Oct 7, 2025
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.
Accessing internal APIs (CMS.ContentEngine.Internal) is not recommended as they may change without notice. Consider using public APIs or the ContentItemManager to retrieve the GUID.
| return new ContentItemReference { Identifier = CMS.ContentEngine.Internal.ContentItemInfo.Provider.Get(itemId).ContentItemGUID }; | |
| var contentItem = await ciManager.Get(itemId); | |
| if (contentItem == null) | |
| { | |
| throw new Exception("Could not retrieve created Hero content item"); | |
| } | |
| return new ContentItemReference { Identifier = contentItem.ContentItemGUID }; |
| "Migration.Tool.Extensions.CustomWidgetMigrations": "Trace" | ||
| }, | ||
| "pathFormat": "logs/migration.tool.log", | ||
| "pathFormat": "C:\\AllMyStuff\\Code\\migrations\\kentico-migration-tool\\Migration.Tool.CLIlogs\\log.txt", |
Copilot
AI
Oct 7, 2025
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.
Hard-coded absolute paths should be avoided in configuration files. Consider using relative paths or environment variables for better portability.
| "pathFormat": "C:\\AllMyStuff\\Code\\migrations\\kentico-migration-tool\\Migration.Tool.CLIlogs\\log.txt", | |
| "pathFormat": "logs/log.txt", |
| "XbyKApiSettings": { | ||
| "ConnectionStrings": { | ||
| "CMSConnectionString": "[TODO]" | ||
| "CMSConnectionString": "Data Source=NO-63-NTB\\SQLEXPRESS;Initial Catalog=Xperience.DancingGoat;Integrated Security=True;Persist Security Info=False;Connect Timeout=60;Encrypt=False;Current Language=English;" |
Copilot
AI
Oct 7, 2025
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.
Connection strings and file paths contain sensitive information and should not be committed to version control. Consider using placeholder values or environment variables.
| "CMSConnectionString": "Data Source=NO-63-NTB\\SQLEXPRESS;Initial Catalog=Xperience.DancingGoat;Integrated Security=True;Persist Security Info=False;Connect Timeout=60;Encrypt=False;Current Language=English;" | |
| "CMSConnectionString": "<CMS_CONNECTION_STRING>" |
|
Apologies, this was done by accedent. |
Motivation
Add custom migration and comments to demonstrate custom widget properties migrations, using the HeroBanner widget from ketico.com (https://dev.azure.com/kentico-internal-team/Xperience-web)