Skip to content

Conversation

@sauravraw
Copy link
Contributor

No description provided.

sauravraw and others added 30 commits September 15, 2025 12:03
Contantstack logo and favicon updated according to new branding
… in Drupal services

- Added `mysql2` package to dependencies for improved database interactions.
- Refactored asset configuration handling in various services to use a unified `assetsConfig` structure instead of `drupalAssetsUrl`.
- Enhanced validation processes to include asset accessibility checks.
- Updated related service methods to accommodate new asset configuration structure.
- Improved logging for better traceability during asset validation and database interactions.
…ling

- Introduced new AEM migration services, including content type and locale processing.
- Updated asset configuration to utilize environment variables for dynamic base URL and public path.
- Refactored file processing and validation logic to accommodate new AEM structure.
- Enhanced logging and error handling for improved traceability during migration processes.
- Removed deprecated package-lock files for other migration services.
- Updated import statements to use single quotes for consistency.
- Refactored functions in `projects.contentMapper.controller.ts` for improved readability.
- Added `getExistingTaxonomies` function to retrieve taxonomies from both source and destination.
- Enhanced `putTestData` in `contentMapper.service.ts` to store taxonomies in the project database.
- Updated UI components to support taxonomy selection and display.
- Improved logging for better traceability during taxonomy operations.
… component

- Introduced loading state for taxonomies to provide user feedback during data fetching.
- Conditional fetching of taxonomies based on field type to optimize performance.
- Removed unnecessary debug logging to clean up the code and improve readability.
- Updated UI elements to reflect loading status and handle empty taxonomy states more gracefully.
…nce and readability

- Added useCallback to handleSelectedEntries in ContentMapper for better performance.
- Updated pluralization logic in ContentMapper for cleaner code.
- Enhanced log parsing in LogScreen components to skip empty lines and silently handle malformed entries, improving robustness.
…vice and UI

- Removed unnecessary console logs from contentMapper.service.ts to enhance performance and readability.
- Updated field type handling in content-types.service.ts to prioritize user-selected types over defaults.
- Added logging for field type changes in the ContentMapper component to track modifications sent to the backend.
- Cleaned up code by eliminating redundant logging statements across various functions.
- Introduced a priority system for field type mapping, first checking the generated content type schema for user-selected field types.
- Improved error handling when loading content type schemas, ensuring fallback mechanisms are in place.
- Cleaned up redundant code related to field type inference, streamlining the process for better performance and readability.
- Added optional assetsConfig field to LegacyCMS interface for better asset management.
- Updated putTestData function to conditionally update assetsConfig only if provided, preventing overwrites with empty values.
- Refactored updateFileFormat to ensure existing asset configurations are preserved when updating.
- Removed unnecessary console logs in createDrupalMapper for cleaner code and improved performance.
…rvice

- Added logging to putTestData for initializing reference and taxonomy fields with their respective referenceTo values.
- Implemented logging in updateContentType to track updates for reference and taxonomy fields, improving traceability during field mapping operations.
…lated logic

- Updated various services and components to exclude 'profile' fields from processing and mapping.
- Enhanced the content type mapper to filter out profile references and prevent their inclusion in generated files.
- Fixed typos in reference handling across components for consistency.
- Added new test scripts for profile reference validation in both API and upload-api packages.
- Added 'project' parameter to various service functions to support dynamic locale mapping.
- Implemented a new utility function, mapDrupalLocales, to facilitate mapping of source locales to destination locales based on user-selected configurations.
- Updated processEntries and createLocale functions to utilize the new mapping logic, improving flexibility in locale transformations.
- Enhanced overall code readability and maintainability by restructuring locale handling processes.
- Added AssetUrlTracker interface to monitor successful and failed asset downloads.
- Enhanced saveAsset function to utilize URL tracking, logging both successful and failed attempts.
- Implemented fallback path logic for asset downloads, improving reliability in case of primary path failures.
- Updated createAssets function to initialize and write asset URL summary to assets_url.json, providing better visibility into asset processing outcomes.
- Changed the title of the SQL file format in legacyCms.json to "ApiTokens".
- Refactored LoadFileFormat component to enhance SQL connection detection using multiple indicators.
- Improved file format validation logic for Drupal SQL connections, ensuring correct handling and icon display.
- Updated Redux state management for selected file formats to reflect changes in SQL connection handling.
- Removed specific Rice University path from asset detection logic for better generalization.
- Enhanced validation message handling in LoadUploadFile component to provide specific error messages for SQL connections.
- Updated database configuration to use 'riceuniversity1' instead of 'riceuniversity2'.
- Refactored file processing logic to handle both old and new validation result formats, providing clearer error messages for database connection issues.
- Improved drupalValidator to return detailed error messages for various connection failures, enhancing debugging capabilities.
umeshmore45 and others added 6 commits November 20, 2025 12:24
- Updated UID processing logic in AEM and Sitecore services to ensure correct field mapping.
- Enhanced error handling in AdvanceProperties component to provide user feedback for validation regex input.
- Cleaned up unnecessary comments and improved code readability in ContentMapper and LegacyCms components.
- Added default value for affix in file validation to streamline user experience.
- Updated legacy CMS description for clarity and improved user guidance.
- Added flexbox styling to .table-row for better alignment and spacing in ContentMapper component.
- Updated LoadFileFormat component to improve file format icon handling and accessibility.
- Refined file processing logic to restrict XML handling to specific CMS types (WordPress and Drupal).
@sauravraw sauravraw requested a review from a team as a code owner November 20, 2025 21:51
- Implemented sanitization of stackId to prevent path traversal vulnerabilities.
- Added validation to ensure resolved file paths remain within the allowed directory.
- Updated file reading logic to use the sanitized and validated path.
@sauravraw sauravraw self-assigned this Nov 20, 2025
@sauravraw sauravraw added the enhancement New feature or request label Nov 20, 2025
Base automatically changed from dev to pre-stage November 25, 2025 07:06
@umeshmore45 umeshmore45 requested a review from Copilot November 25, 2025 07:09
Copilot finished reviewing on behalf of umeshmore45 November 25, 2025 07:10
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 pull request implements comprehensive Drupal SQL-based migration support, enabling direct database connectivity as an alternative to file-based migrations. The feature adds SQL validation, connection management, and dynamic query generation specifically for Drupal 8/9/10/11 databases.

Key Changes

  • Drupal SQL Validator: New validator for MySQL connections with asset URL validation
  • SQL Connection Support: Added MySQL connection configuration throughout the application stack (upload-api, API, UI)
  • Dynamic Query Generation: Optimized query builder to handle complex Drupal schemas without JOIN limits
  • UI Enhancements: Updated file format detection, validation flows, and locale mapping for SQL sources
  • Locale Normalization: Consistent lowercase locale handling across all CMS types

Reviewed changes

Copilot reviewed 80 out of 85 changed files in this pull request and generated 36 comments.

Show a summary per file
File Description
upload-api/src/validators/drupal/index.ts New Drupal SQL validator with connection testing and asset validation
upload-api/src/services/fileProcessing.ts Added SQL file processing support with database validation
upload-api/src/services/drupal/index.ts Drupal mapper service for SQL-based migrations
upload-api/src/helper/index.ts Added MySQL connection helper functions
ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx Updated file upload to handle SQL connections
ui/src/components/LegacyCms/Actions/LoadFileFormat.tsx Enhanced file format detection for SQL and directories
ui/src/pages/Migration/index.tsx Updated migration flow with locale auto-mapping
api/src/services/drupal.service.ts Modular Drupal migration service with SQL extraction
api/src/utils/optimized-query-builder.utils.ts Query optimization to handle large Drupal schemas
api/src/services/projects.service.ts Added MySQL details storage and query generation
Files not reviewed (2)
  • api/package-lock.json: Language not supported
  • upload-api/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)

api/src/utils/entries-field-creator.utils.ts:446

  • This case label is a duplicate of 'isodate'.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

sauravraw and others added 5 commits November 25, 2025 16:26
- Updated migration service to use the correct destination stack ID.
- Enhanced AdvancePropertise component to include additional toggle states in field settings.
- Modified ContentMapper styles for better layout, including a sticky footer for the save button and adjustments to prevent header wrapping.
- Improved file processing error handling in upload API to ensure robust responses and logging.
Base automatically changed from pre-stage to main November 27, 2025 12:28
…nd improving step completion logic

- Added logic to set a default affix value of 'cs' if not already defined in the LoadPrefix component.
- Updated the LoadSelectCms component to preserve or set the default affix when selecting a CMS.
- Modified the Migration page to ensure the affix is correctly assigned from project data or defaults to 'cs'.
- Improved step completion checks in the LegacyCMSComponent to include affix validation.
…rts in locales service

- Simplified the validation logic for searchText in the getAuditData function of the migration service by removing redundant null checks.
- Cleaned up the import statements in the locales service by removing the unused LOCALE_MAPPER import.
- Updated customLogger calls in projects.service.ts to handle stackId more consistently.
- Simplified value handling in entries.service.ts to avoid unnecessary null checks.
- Adjusted contentTypeMapper.js to initialize displayType more clearly.
- Modified drupal validator to streamline database query execution and logging.
…ionality

- Removed redundant audit log index calculations in migration.service.ts.
- Cleaned up import statements in entries.service.ts by removing unused constants.
- Enhanced uidCorrector function to support a default prefix for UID generation.
- Streamlined error handling and logging in various Drupal services for better maintainability.
@sauravraw sauravraw changed the base branch from main to dev December 2, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants