Skip to content

CMG-824 | Delta Migration Support for Wordpress CMS#1023

Open
chetan-contentstack wants to merge 7 commits intofeature/delta-migfrom
feature/cmg-842-delta-wordpress
Open

CMG-824 | Delta Migration Support for Wordpress CMS#1023
chetan-contentstack wants to merge 7 commits intofeature/delta-migfrom
feature/cmg-842-delta-wordpress

Conversation

@chetan-contentstack
Copy link
Copy Markdown

No description provided.

…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.
@chetan-contentstack chetan-contentstack self-assigned this Apr 1, 2026
@chetan-contentstack chetan-contentstack requested a review from a team as a code owner April 1, 2026 06:51
@umeshmore45
Copy link
Copy Markdown
Contributor

@chetan-contentstack take a pull this pr does not have test cases

Copy link
Copy Markdown
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

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 new const 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-in config available for extractContentTypes.
        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.

chetan-contentstack added 4 commits April 6, 2026 12:28
… update string handling and error logging for better readability and maintainability.
…n; upgrade multer in upload-api and fix migration-wordpress package name.
chetan-contentstack added 2 commits April 6, 2026 17:49
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.

4 participants