Skip to content

fix(cli-utilities): read aggregate globalfields.json in readGlobalFieldSchemas (DX-7312) - #2716

Open
harshitha-cstk wants to merge 2 commits into
developmentfrom
fix/DX-7312-global-fields-aggregate-read
Open

fix(cli-utilities): read aggregate globalfields.json in readGlobalFieldSchemas (DX-7312)#2716
harshitha-cstk wants to merge 2 commits into
developmentfrom
fix/DX-7312-global-fields-aggregate-read

Conversation

@harshitha-cstk

@harshitha-cstk harshitha-cstk commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

What

readGlobalFieldSchemas() now reads the aggregate global_fields/globalfields.json when present, falling back to per-uid files.

Why

The function ignored the aggregate globalfields.json and only read per-uid files. For aggregate-format exports it returned 0 global fields, which cascaded:

  • The audit stripped every global_field reference from content types.
  • The import global-fields module created no global fields on the destination.
  • Content types / entries then failed with "The referenced Global Field does not exist", and image-preset (and other global-field-nested) entry data was silently dropped.

This is the shared reader used by the audit and the import global-fields/content-types modules, so the single fix corrects all three consumers.

Investigation notes

  • Not marketplace extension_uid remapping (that works — verified same-org: apps install, mapper populated, 0 marketplace-extension errors).
  • Not version- or node bin/run-vs-csdx-specific: reproduced identically on 2.0.0, 2.0.0-beta.21, 2.0.0-beta.28. The real variable is the export format (aggregate vs per-uid).

Verification

Clean import of the ticket's export into an empty dev11 stack → ✅ IMPORT completed successfully, 0 errors; global fields / content types / entries all imported; extension + marketplace UID mappings applied.

🤖 Generated with Claude Code

…ldSchemas

readGlobalFieldSchemas ignored the aggregate global_fields/globalfields.json
and only read per-uid files, so aggregate-format exports returned 0 global
fields. This caused the audit to strip all global-field references from
content types, global fields to never import, and content-types/entries to
fail with "The referenced Global Field does not exist" (plus image-preset
data loss).

Now prefer the aggregate globalfields.json when present and fall back to
per-uid files, so both export formats load correctly. Shared by the audit
and the import global-fields/content-types modules.

Fixes DX-7312

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@harshitha-cstk
harshitha-cstk requested a review from a team as a code owner August 25, 2026 05:58
@snyk-io

snyk-io Bot commented Aug 25, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

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 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

⚠️ Warning: The following vulnerabilities have exceeded their SLA thresholds (days since publication).

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 1 90 / 365 days ⚠️ Warning
🔵 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: 0
  • Medium without fixes: 2
  • Low without fixes: 0

⚠️ BUILD PASSED WITH WARNINGS - SLA breaches detected for issues without available fixes

Consider reviewing these vulnerabilities when fixes become available.

@github-actions

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 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

⚠️ Warning: The following vulnerabilities have exceeded their SLA thresholds (days since publication).

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 1 90 / 365 days ⚠️ Warning
🔵 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: 0
  • Medium without fixes: 2
  • Low without fixes: 0

⚠️ BUILD PASSED WITH WARNINGS - SLA breaches detected for issues without available fixes

Consider reviewing these vulnerabilities when fixes become available.

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