Skip to content

Expand Shopify cable ingestion across more brands#47

Merged
anand-testcompare merged 1 commit intomainfrom
feat/shopify-multi-brand-ingest-quality
Feb 19, 2026
Merged

Expand Shopify cable ingestion across more brands#47
anand-testcompare merged 1 commit intomainfrom
feat/shopify-multi-brand-ingest-quality

Conversation

@anand-testcompare
Copy link
Collaborator

@anand-testcompare anand-testcompare commented Feb 19, 2026

Summary

  • add Shopify template coverage for Native Union, Satechi, Mous, Baseus, and UGREEN
  • harden extraction to fall back from Next.js data to Shopify search/suggest.json discovery and /products/<handle>.js payloads
  • normalize noisy vendor aliases (n/a, unknown) back to canonical brand and normalize protocol-relative image URLs
  • fix web display-name slug parsing to remove the active row brand token instead of hardcoded anker

Validation

  • bun test packages/shopify-cable-source/src/source.integration.test.ts
  • bun test packages/backend/convex/shopify.ingest.integration.test.ts
  • bun test apps/web/src/lib/mappers.test.ts
  • bun run check-types
  • bun x ultracite check apps/web/src/lib/mappers.ts apps/web/src/lib/mappers.test.ts packages/shopify-cable-source/src/source.ts packages/shopify-cable-source/src/source.integration.test.ts packages/shopify-cable-source/src/templates/index.ts packages/shopify-cable-source/src/templates/native-union.ts packages/shopify-cable-source/src/templates/satechi.ts packages/shopify-cable-source/src/templates/mous.ts packages/shopify-cable-source/src/templates/baseus.ts packages/shopify-cable-source/src/templates/ugreen.ts

Summary by CodeRabbit

  • New Features

    • Extended product support to include Native Union, Satechi, Mous, Baseus, and UGREEN brands.
    • Enhanced product data extraction with intelligent fallback mechanisms for improved reliability.
  • Bug Fixes

    • Improved error resilience during product data retrieval with graceful recovery from non-critical failures.
  • Tests

    • Added comprehensive test coverage for multi-brand product extraction and display name derivation.

@vercel
Copy link

vercel bot commented Feb 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cable-intel-web Ready Ready Preview, Comment Feb 19, 2026 7:10am

Request Review

@coderabbitai
Copy link

coderabbitai bot commented Feb 19, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

Extends Shopify cable source with support for five additional brands (Native Union, Satechi, Mous, Baseus, UGREEN) via brand-specific templates. Updates product slug derivation to dynamically use brand information. Adds resilient product data fetching with fallback mechanisms and improved URL/text normalization logic.

Changes

Cohort / File(s) Summary
Brand Template Definitions
packages/shopify-cable-source/src/templates/baseus.ts, mous.ts, native-union.ts, satechi.ts, ugreen.ts
Five new brand-specific Shopify cable templates with candidate filtering logic to identify cable products via title/handle patterns while excluding bundles and accessories.
Template Registration
packages/shopify-cable-source/src/templates/index.ts
Expanded exported shopifyCableTemplates array from single Anker template to six templates, adding Native Union, Satechi, Mous, Baseus, and UGREEN imports.
Source Data Fetching & Mapping
packages/shopify-cable-source/src/source.ts
Added ShopifyProductJson types for JSON-based product data. Implemented fallback product extraction via search-suggest and JSON endpoints when Next data is unavailable. Enhanced URL normalization for protocol-relative URLs and error recovery for non-fatal Next.js fetch failures.
Product Slug Derivation
apps/web/src/lib/mappers.ts
Updated getSlugTitle to accept brand parameter and dynamically remove brand from product slug using escaped regex patterns instead of hardcoded logic. Falls back to original slug if brand cannot be determined.
Testing
apps/web/src/lib/mappers.test.ts, packages/shopify-cable-source/src/source.integration.test.ts
Added test case validating slug title derivation without hardcoded brand tokens. Expanded integration tests across five new brand templates with variant extraction and field validation.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant ProductURL
    participant NextData
    participant SearchSuggest
    participant ProductJSON
    participant Internal

    Client->>ProductURL: extractFromProductUrl(url)
    ProductURL->>NextData: fetchNextData()
    
    alt Next Data Available
        NextData-->>ProductURL: Product Data
        ProductURL->>Internal: Convert to ShopifyProduct
    else Next Data Failed/Missing
        NextData-->>ProductURL: Recoverable Error
        ProductURL->>SearchSuggest: fetchSearchSuggestCandidates()
        SearchSuggest-->>ProductURL: Candidate URLs
        ProductURL->>ProductJSON: fetchProductJson(candidateUrl)
        ProductJSON-->>ProductURL: Product JSON
        ProductURL->>Internal: mapProductJsonToShopifyProduct()
    end
    
    Internal-->>Client: Extracted ShopifyProduct
Loading

Possibly related PRs

Poem

🐰 Five new brands hop into our cable source today,
With templates fine-tuned to find products the proper way!
When Next.js data falters, we search and we adapt,
Brand-aware slugs now flourish—no hardcoding entrapped!
Thump thump 🎉

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/shopify-multi-brand-ingest-quality

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

@anand-testcompare anand-testcompare enabled auto-merge (squash) February 19, 2026 07:10
@anand-testcompare anand-testcompare merged commit deeeb5c into main Feb 19, 2026
3 of 4 checks passed
@anand-testcompare anand-testcompare deleted the feat/shopify-multi-brand-ingest-quality branch February 19, 2026 07:10
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