Skip to content

feat(extractEntries, extractItems, schemaMapper): enhance UID generat…#1110

Open
aishwarya-cstk wants to merge 5 commits into
devfrom
feature/cmg-705
Open

feat(extractEntries, extractItems, schemaMapper): enhance UID generat…#1110
aishwarya-cstk wants to merge 5 commits into
devfrom
feature/cmg-705

Conversation

@aishwarya-cstk

Copy link
Copy Markdown
Contributor

🔗 Jira Ticket

Replace with your ticket link — required before requesting review.

MIGRATION-XXXX


📋 PR Type

  • ✨ Feature
  • 🐛 Bug Fix
  • 🔥 Hotfix
  • ♻️ Refactor
  • 🧹 Chore / Dependency Update
  • 📝 Documentation

📝 Description

This PR enhances the WordPress migration pipeline by improving UID generation and filtering logic across the extraction and schema mapping flow. These changes help ensure only relevant WordPress content is processed while generating stable and unique UIDs for migrated entries.

What changed?

  • Enhanced UID generation in extractEntries to produce consistent and unique entry identifiers.
  • Improved filtering logic in extractItems to process only supported WordPress items.
  • Updated schemaMapper to work with the new UID generation and filtering behavior.
  • Improved the overall migration flow for better data consistency and reduced unnecessary processing.

Why?

The previous implementation could process unsupported items and generate inconsistent UIDs in certain scenarios. This enhancement improves migration accuracy, prevents duplicate or unstable entry identifiers, and ensures cleaner data mapping to Contentstack.


🧪 Testing

  • Verified unique UID generation for migrated entries.
  • Tested extraction with multiple WordPress export files.
  • Confirmed unsupported items are filtered out correctly.
  • Validated successful schema mapping after the changes.
  • Performed regression testing to ensure existing migration behavior remains unaffected.

📸 Screenshots / Logs (if applicable)

N/A


✅ Checklist

  • Code follows project coding standards.
  • Self-reviewed the changes.
  • Tested locally.
  • Existing functionality verified.
  • Documentation updated (if applicable).

…ion and filtering logic for WordPress migration
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 1 0 10 ✅ Passed
🟠 High Severity 2 382 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 1 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 382
  • Medium without fixes: 0
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 1 0 10 ✅ Passed
🟠 High Severity 2 382 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 1 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 382
  • Medium without fixes: 0
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the WordPress migration pipeline to generate deterministic, iteration-stable UIDs (avoiding Gutenberg clientId churn) and to filter extracted entries more aggressively by post type/status to reduce unsupported or irrelevant processing.

Changes:

  • Introduces stableSuffix() in schemaMapper and replaces clientId-based UID fragments across multiple block mappings.
  • Updates extractItems to align modular block UID generation with the new stable suffix logic.
  • Updates extractEntries to (a) namespace source UIDs for authors/terms and (b) filter items by allowed WordPress post statuses.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
upload-api/migration-wordpress/libs/schemaMapper.ts Adds stable UID suffix generation and replaces clientId-derived UID composition across many block types.
upload-api/migration-wordpress/libs/extractItems.ts Switches modular block UID generation to use stableSuffix() consistently with schema mapping.
upload-api/migration-wordpress/libs/extractEntries.ts Adds allowed-status filtering and adjusts source UID generation/author mapping to support stable namespaced UIDs.

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

Comment thread upload-api/migration-wordpress/libs/schemaMapper.ts
Comment thread upload-api/migration-wordpress/libs/extractItems.ts
Comment thread upload-api/migration-wordpress/libs/extractEntries.ts
Comment thread upload-api/migration-wordpress/libs/extractEntries.ts
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 1 0 10 ✅ Passed
🟠 High Severity 2 382 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 1 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 382
  • Medium without fixes: 0
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread upload-api/migration-wordpress/libs/extractEntries.ts
Comment thread upload-api/migration-wordpress/libs/schemaMapper.ts Outdated
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 1 0 10 ✅ Passed
🟠 High Severity 2 382 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 1 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 382
  • Medium without fixes: 0
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@aishwarya-cstk aishwarya-cstk requested a review from Copilot July 8, 2026 14:43
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 1 0 10 ✅ Passed
🟠 High Severity 2 382 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 1 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 382
  • Medium without fixes: 0
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread upload-api/migration-wordpress/libs/schemaMapper.ts
Comment thread upload-api/migration-wordpress/libs/schemaMapper.ts
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.

3 participants