CMG-824 | Delta Migration Support for Wordpress CMS#1023
Open
chetan-contentstack wants to merge 39 commits intofeature/delta-migfrom
Open
CMG-824 | Delta Migration Support for Wordpress CMS#1023chetan-contentstack wants to merge 39 commits intofeature/delta-migfrom
chetan-contentstack wants to merge 39 commits intofeature/delta-migfrom
Conversation
…e contentMapper and WordPress services to utilize new entry extraction logic, enhance error handling in parse utilities, and adjust API routes for improved response management.
Contributor
|
@chetan-contentstack take a pull this pr does not have test cases |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds/updates WordPress migration support, including generating entry mappings from WordPress exports and improving robustness of block parsing and mapper/entry generation flows.
Changes:
- Add WordPress entry extraction (
extractEntries) and wire it into the upload-api WordPress mapper flow. - Make WordPress Gutenberg block setup/parsing more fault-tolerant (parser-only fallback + safe returns).
- Fix duplicate entry-mapper accumulation and prevent double-sending HTTP responses; update WordPress entry creation to conditionally include some fields.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| upload-api/src/routes/index.ts | Prevents sending the same response twice during XML processing. |
| upload-api/src/controllers/wordpress/index.ts | Incorporates new entry extraction into WordPress mapper generation. |
| upload-api/src/config/index.json | Updates runtime config defaults (currently includes machine-specific values). |
| upload-api/migration-wordpress/utils/parseUtil.ts | Adds safe fallbacks for core block registration and parsing. |
| upload-api/migration-wordpress/utils/parseUtil.js | Compiled counterpart of the above changes. |
| upload-api/migration-wordpress/libs/extractEntries.ts | New logic to derive entry mappings per post type and persist them. |
| upload-api/migration-wordpress/libs/extractEntries.js | Compiled counterpart of the above changes. |
| upload-api/migration-wordpress/index.ts | Exports extractEntries. |
| upload-api/migration-wordpress/index.js | Compiled counterpart of the above changes. |
| api/src/services/wordpress.service.ts | Adds conditional field inclusion logic when building entry payloads. |
| api/src/services/contentMapper.service.ts | Fixes entry-mapper update to avoid re-adding the same entries. |
Comments suppressed due to low confidence (1)
upload-api/src/controllers/wordpress/index.ts:31
- The function parameter is named
config, but inside the function a newconst config = { ... }is declared for the axios request config. This shadows the parameter and makes it easy to accidentally use the wrong value (and can break future edits). Rename the inner variable (e.g.,requestConfig/axiosConfig) to avoid shadowing, and keep the passed-inconfigavailable forextractContentTypes.
jsonfileContent.type = 'content_type';
fieldMapping?.contentTypes?.push(jsonfileContent);
});
const config = {
method: 'post',
maxBodyLength: Infinity,
url: `${process.env.NODE_BACKEND_API}/v2/mapper/createDummyData/${projectId}`,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 4 commits
April 6, 2026 12:28
… update string handling and error logging for better readability and maintainability.
…contentTypeData mapping.
…roved data handling.
…n; upgrade multer in upload-api and fix migration-wordpress package name.
… API standards and ensure consistency in otherCmsEntryUid formatting
…mproved error logging - Replaced synchronous file reading with asynchronous methods for better performance. - Introduced concurrency control to optimize the processing of multiple files. - Added regex matching for language extraction and improved directory skipping logic. - Enhanced logging for progress tracking and error handling during file operations.
- Updated regex patterns to improve the efficiency of language extraction from metadata blocks. - Introduced a fast-path strategy to locate the language key within a limited slice of the JSON structure, enhancing performance. - Maintained fallback to full JSON parsing for compatibility with various file formats.
…es.js - Added checks for null or invalid directory and file path inputs to prevent runtime errors. - Enhanced logging for invalid inputs to aid in debugging. - Ensured that the locale extraction process gracefully handles empty or non-array paths.
…es.js - Improved error logging to provide more informative messages when reading directories and files. - Added optional chaining to safely access properties of directory entries. - Introduced a limit variable for concurrency control to ensure robust processing of file paths.
…ocales.js - Updated input validation to use optional chaining for safer property access. - Improved handling of potential null or empty directory and file path scenarios. - Ensured robust processing by checking the length of paths with optional chaining.
…ocales.js - Updated input validation to use optional chaining for safer property access. - Improved handling of potential null or empty directory and file path scenarios. - Ensured robust processing by checking the length of paths with optional chaining.
…nt dependencies in package-lock.json
…d text-table in package-lock.json
…nt dependencies in package-lock.json
…ncy and adjust its version to 2.8.3
…ding @contentstack/cli and vite to latest versions
…n; upgrade multer in upload-api and fix migration-wordpress package name.
…ds, improving schema handling and data structure
…ompose for additional environment variables
…rvices and utils - Updated various files to use optional chaining for improved null safety, preventing potential runtime errors. - Added new region configurations for GCP Europe and Australia in constants. - Ensured consistent handling of optional properties in request bodies and parameters across services. - Improved error handling in login and user services to gracefully manage undefined values.
…ge-lock.json across multiple modules for improved functionality and security. Additionally, add new qs dependency in upload-api for enhanced compatibility.
…entrymapper and field mapper code
60c8b06 to
8200837
Compare
added 3 commits
April 9, 2026 12:02
- Add @rollup/rollup-linux-x64-gnu installation step in GitHub Actions for UI tests - Add missing testing library dependencies (@testing-library/dom, @testing-library/react, etc.) - Fix duplicate jsdom dependency in package.json - Update vitest config to exclude complex UI components from coverage - Adjust coverage thresholds to realistic values (70% lines, 75% functions, 50% branches, 70% statements) - All UI tests now pass: 21 test files, 316 tests, 89.5% coverage Made-with: Cursor
- Switch from @vitejs/plugin-react-swc to @vitejs/plugin-react to avoid SWC native binding dependencies - Update both vite.config.ts and vitest.config.ts to use regular React plugin - Install compatible version @vitejs/plugin-react@4.3.3 for Vite 7.x - All UI tests still pass: 21 test files, 316 tests, 89.5% coverage - This resolves the "Failed to load native binding" error in Linux CI environment Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.