feat(source-shopify): Add requiresComponents and productVariantComponents to product_variants stream (AI-Triage PR)#74079
Conversation
…ents to product_variants stream Add support for Shopify Bundles data on the ProductVariant object: - requiresComponents (boolean): indicates whether a variant requires components - productVariantComponents (connection): returns component variants that make up a bundle This enables users who use Shopify Bundles to access bundle/component data for their product variants via the Airbyte Shopify connector. Co-Authored-By: bot_apk <apk@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksPR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful Resources
|
Co-Authored-By: bot_apk <apk@cognition.ai>
|
… results Co-Authored-By: bot_apk <apk@cognition.ai>
|
↪️ Triggering Reason: Draft PR with CI passing, linked to oncall issue for missing Shopify Bundles fields. |
|
Fix Validation EvidenceOutcome: Fix/Feature Proven Successfully Evidence SummaryRegression tests (comparison mode) passed for Live connection testing was not performed — approval for internal connection pinning was escalated but not yet received. Both identified internal connections are inactive (no recent syncs), so regression tests provide the primary evidence for this additive feature. Code review note: The Next Steps
Connector & PR DetailsConnector: Evidence PlanProving CriteriaSince this is a feature addition (not a bug fix), proving evidence means:
Disproving Criteria
Cases Attempted
Pre-flight Checks
Note: No version bump or changelog entry on this PR yet. Use Detailed Evidence Log
Note: Connection IDs and detailed logs are recorded in the linked private issue. |
|
What
Resolves https://github.com/airbytehq/oncall/issues/11459:
Adds two missing Shopify Bundles fields to the
product_variantsstream:requires_components(boolean) — whether a variant is a bundle that requires componentsproduct_variant_components(array) — the component variants that make up a bundleThese fields are available on the Shopify GraphQL Admin API
ProductVariantobject but were not previously fetched by the connector. Requested in community discussion airbytehq/airbyte#74078.How
query.py): AddedrequiresComponentsscalar field andproductVariantComponentsconnection (withid,quantity, nestedproductVariant.id,product.id) to theProductVariantbulk query.ProductVariantComponenttorecord_componentsso the BULK record assembler collects component records alongsideProductVariantPricePair._process_variant_componentsmethod flattens the JSONL component records into{id, quantity, variant_id, product_id}objects. Non-bundle variants default to an emptyproduct_variant_componentslist.product_variants.json): Added both new fields with appropriate types.conftest.py): Updatedproduct_variants_response_expected_resultto include the newproduct_variant_components: []field for non-bundle test variants.Review guide
source_shopify/shopify_graphql/bulk/query.py—ProductVariantclass changes:query_nodesproperty (~line 2773–2847): newvariant_component_fields,requiresComponents, and list concatenation withvariant_components_process_variant_componentsmethod (~line 2888): flatten logic for component recordsrecord_process_components(~line 2949): wiring + default empty list for non-bundle variantssource_shopify/schemas/product_variants.json— schema additions forrequires_componentsandproduct_variant_componentsunit_tests/conftest.py— addedproduct_variant_components: []to expected test results forProductVariantsparse response testpresentmentPrices) but BULK JSONL output forproductVariantComponentshas not been verified against a real store.productVariantComponentsis added as a second connection at the same nesting level aspresentmentPrices(both underproductVariants). Multiple connections at the same level should be fine per Shopify BULK API rules, but worth confirming.component_variant_idandcomponent_product_id. The_process_variant_componentsmethod assumes these aliases appear correctly in the flattened BULK JSONL output. This should be verified against actual Shopify BULK API behavior.User Impact
Users who use Shopify Bundles can now access bundle/component data for their product variants. For non-bundle variants,
requires_componentswill befalseandproduct_variant_componentswill be an empty array.No breaking changes — new fields are nullable and default to safe values.
Can this PR be safely reverted and rolled back?
This is an additive change. Reverting would remove the new fields but not break existing syncs.
Link to Devin run: https://app.devin.ai/sessions/fcf81ecba8934b749ecf9551f15305b0
Requested by: bot_apk (apk@cognition.ai)