Repository navigation
fix(dataProducts): guard ODPS import from a product page on productID (2.0) - #37019
Conversation
The import resolves the target product by productID, but the modal guard still compared the ODPS display name, so a YAML whose name matched the current product could update (or create) a different one, and a re-import with an edited display name was blocked. Compare productID against the product FQN/name (or its sanitized slug, the backend fallback) instead.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 1 closed / 1 findings🔴 High risk · Changing the ODPS import guard to productID matching could let an identifier mismatch route imports to another product and overwrite its metadata. Guards the ODPS import modal on a data product page by ✅ 1 closed✅ Bug: Sanitized-match fallback lets a sibling product's productID bypass guard
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|



Follow-up to #34193 on
2.0. The same change is on #33993 formain.Summary
#34193 made ODPS import pick the target data product by
productID, but the import modal's guard on a data product page still compared the ODPSname(the display label). So from product A's page:namebut anotherproductIDpassed the guard and updated that other product, or created a new one;productIDis A's.The guard now reads
product.details.<lang>.productID(en, else the first language, as the backend does). It accepts the YAML only when the productID exactly equals the product's FQN or name.What changed
ODPSImportModal.component.tsx: guard onproductIDinstead ofname.odps-yaml-name-*messages (all locales) now refer toproductID.DataProductODPS.spec.ts: the guard tests now givenameandproductIDdifferent values, and a new test checks that re-importing with an edited display name updates the same product.Fixes #33995