Skip to content

Remove the duplicated Variant SKU entry in the Shopify importer mapping - #68226

Merged
dilirity merged 3 commits into
woocommerce:trunkfrom
darkdi:dup-shopify-sku-mapping
Sep 2, 2026
Merged

dilirity merged 3 commits into
woocommerce:trunkfrom
darkdi:dup-shopify-sku-mapping

Conversation

@darkdi

@darkdi darkdi commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Submission Review Guidelines:

Changes proposed in this Pull Request:

'Variant SKU' => 'sku' is listed twice in the Shopify importer mapping, once at the top of the array and once seven lines down. PHP keeps the first position and the last value for a repeated key, and both values here are the same, so the mapping the importer ends up with does not change. It is just a line that reads as if a second column were being mapped.

How to test the changes in this Pull Request:

There is nothing observable to test. The array wc_importer_shopify_mappings() returns is identical before and after, both in values and in key order, because the removed line was the losing duplicate of one that stays.

  1. Import a Shopify product CSV as before and confirm the SKU column still maps to sku.

Testing that has already taken place:

None beyond reading the array. The change removes a line that PHP was already discarding.

Milestone

Changelog entry

Added by hand as plugins/woocommerce/changelog/fix-duplicate-shopify-variant-sku-mapping, patch significance and dev type, since the automatic job cannot push into a fork branch.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Team

Run ID: 18e75224-1d6f-4c4c-93fd-f7009014f3e5

📥 Commits

Reviewing files that changed from the base of the PR and between 64bce85 and e195ae1.

📒 Files selected for processing (1)
  • plugins/woocommerce/phpstan-baseline.neon
💤 Files with no reviewable changes (1)
  • plugins/woocommerce/phpstan-baseline.neon

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Removed the duplicate Variant SKU to sku mapping, removed its PHPStan suppression, and added a patch-level developer changelog entry.

Changes

Shopify importer mapping cleanup

Layer / File(s) Summary
Mapping cleanup and release note
plugins/woocommerce/phpstan-baseline.neon, plugins/woocommerce/changelog/fix-duplicate-shopify-variant-sku-mapping
Removed the PHPStan suppression for the duplicate Variant SKU key and documented the patch-level developer change.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to e195a

This removes a redundant Shopify SKU mapping entry without changing the importer’s resulting mapping, so no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: removing the duplicated Variant SKU entry from the Shopify importer mapping.
Description check ✅ Passed The description directly explains the duplicate mapping, its effect, the testing approach, and the related changelog and milestone updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@woocommercebot
woocommercebot requested review from a team and dilirity and removed request for a team September 1, 2026 12:00
@github-actions github-actions Bot added type: community contribution plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Testing Guidelines

Hi ,

Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

Reminder: PR reviewers are required to document testing performed. This includes:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

@dilirity dilirity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @darkdi, thanks for the cleanup - you're right that PHP keeps the first key position and the last value here, so dropping the duplicate is a safe no-op.

Two things before this can merge.

The description mentions a change file, but the diff only has shopify.php - please run pnpm --filter=@woocommerce/plugin-woocommerce changelog add from the repo root (patch significance, dev type) and commit the file it creates under plugins/woocommerce/changelog/, otherwise the "Validate changelog" job will fail once full CI runs.

Also please update the description to follow the PR template - ticking its milestone checkbox clears the failing "Ensure milestone is or will be assigned" check, and since the change has no observable behavior difference, the "How to test" section can just say so.

Once those are in we're good to go.

@darkdi

darkdi commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Both done. The change file is in as plugins/woocommerce/changelog/fix-duplicate-shopify-variant-sku-mapping, patch and dev, and the description now follows the template with the milestone box ticked. It was missing because my working copy is a sparse checkout and the add for a path outside the cone went nowhere quietly.

@dilirity dilirity left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the quick turnaround!

Confirmed, changelog file and template both look good, and the milestone check is green now.

Once the PHPStan check has been resolved and all CI is green, this should be ready for merge!

@darkdi

darkdi commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

PHPStan was failing because it already knew about this one. The duplicate sits in plugins/woocommerce/phpstan-baseline.neon as an array.duplicateKey entry, so removing the line made the baselined error stop matching and the run reported the baseline as out of date rather than the code as broken.

Dropped that entry from the baseline in the same branch. Nothing else in the file moved, the six lines removed are only the shopify.php block.

@dilirity dilirity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great work!

:shipit:

@dilirity
dilirity merged commit 5f8bc2b into woocommerce:trunk Sep 2, 2026
37 checks passed
@github-actions github-actions Bot added this to the 11.2.0 milestone Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin. type: community contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants