← Back to Pull requests

fix(ingestion): merge the split Bee's Knees and LOUD brand rows #512

Closed
unknown closed this pull request without merging on Nov 12, 2026 18:50 UTC
View on GitHub
unknown unknown commented on Nov 12, 2026 02:46 UTC
Author

What

A data migration that folds two split brands back into one row each.

On dev, all 565 Bee's Knees shades sit on a brand row named Bee's Knees (the store's vendor spelling), while the seeded Bee's Knees Lacquer row is empty. LOUD (61 shades) / Loud Lacquer (empty) is the same case.

Why an alias alone does not fix it

  • A vendor resolves by exact name_canonical before brand_alias (ingestion-repo.ts), so the vendor-named row keeps winning.

  • Migration 20261106120000000 seeds the alias only when no brand already has the vendor's exact name, so it skipped both.
  • What the migration does, per pair

  • Both rows exist and the canonical one holds nothing (no shade, sku or product line): its aliases and ingest profile move to the vendor row, the empty row is deleted, the vendor row takes the canonical name. Shades keep their brand_id.

  • Only the vendor row exists: it takes the canonical name.

  • The canonical row holds data too: nothing changes, a NOTICE is raised.

  • The vendor spelling ends up as a brand_alias in every handled case. Idempotent. Down is a no-op (the deleted row was empty).
  • Tested

    Run against the local database inside rolled-back transactions:

  • simulated dev state (vendor row with 565 shades, empty canonical row carrying a profile): one row named Bee's Knees Lacquer with 565 shades, alias Bee's Knees, profile kept; second run changes nothing

  • local as it is (canonical row only): only the LOUD alias is added

  • both rows holding shades: NOTICE, nothing merged
  • Full test suite green in the commit hook.

    After deploy

  • Check on dev that Bee's Knees Lacquer has 565 active shades and Loud Lacquer 61.

  • Le Mini Macaron is a separate fix with no migration: re-run LeMiniMacaronShopify from the Sources tab so the brand-store correction moves its shades from Le Mini Macaron Europe to Le Mini Macaron.
  • 🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Bug Fixes
    Improved consistency for Bee’s Knees and Loud Lacquer brand listings by consolidating eligible duplicate entries and preserving their aliases and ingest information.
    When only one spelling exists, the listing is updated or its alternate spelling is recorded as an alias.
    When consolidation isn’t possible because the canonical listing contains products or both entries have ingest profiles, the existing entries remain unchanged.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 327 lines (+245 / -82) across 4 files Reviewer: mattmck Review duration: 963m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.42) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 327 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.347
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #512"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42% (MEDIUM) · Higher = larger blast radius
    42%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 18.2% · Safe to merge
    18.2%