Skip to content

Conversation

@dominikag2
Copy link
Contributor

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)

dominikag2 and others added 6 commits September 11, 2025 18:36
…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
@dominikag2 dominikag2 requested a review from a team as a code owner October 7, 2025 17:04
Copy link
Contributor

Copilot AI left a 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 };
Copy link

Copilot AI Oct 7, 2025

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.

Suggested change
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 };

Copilot uses AI. Check for mistakes.
"Migration.Tool.Extensions.CustomWidgetMigrations": "Trace"
},
"pathFormat": "logs/migration.tool.log",
"pathFormat": "C:\\AllMyStuff\\Code\\migrations\\kentico-migration-tool\\Migration.Tool.CLIlogs\\log.txt",
Copy link

Copilot AI Oct 7, 2025

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.

Suggested change
"pathFormat": "C:\\AllMyStuff\\Code\\migrations\\kentico-migration-tool\\Migration.Tool.CLIlogs\\log.txt",
"pathFormat": "logs/log.txt",

Copilot uses AI. Check for mistakes.
"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;"
Copy link

Copilot AI Oct 7, 2025

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.

Suggested change
"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>"

Copilot uses AI. Check for mistakes.
@dominikag2 dominikag2 closed this Oct 7, 2025
@dominikag2
Copy link
Contributor Author

Apologies, this was done by accedent.

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.

1 participant