ProjectsCROP Frontend
Tire Implementation: Deployment Plan
The tire pages are broken because:
Tire Implementation: Deployment Plan
Problem Summary
The tire pages are broken because:
- Search service not deployed - Revision
search-service-00310-mrris missing the multi-index fix (commit77744e8) - ES tire slugs use OLD format - Index has
kmt-*slugs but frontend expectsct-kmt-*
Evidence
# Tire index EXISTS and has 7091 documents:
curl 'https://api.crop-dev.app/ready' | jq '.indices.tires'
# → { alias: "tires_current", target: "tires_v2026_01_21", docCount: 7091 }
# Search works with manufacturer=KMT:
curl 'https://api.crop-dev.app/api/search?manufacturer=KMT&limit=1' | jq '.parts[0]'
# → { id: "...", slug: "kmt-04493560000", partNumber: "04493560000" }
# BUT parts endpoint returns 404 (even for OLD slug format):
curl 'https://api.crop-dev.app/api/parts/kmt-04493560000'
# → {"error":"not_found"}
# Deployed revision is OUTDATED:
curl 'https://api.crop-dev.app/ready' | jq '.revision'
# → "search-service-00310-mrr"Root Cause
The /api/parts/:id endpoint in deployed revision uses only env.SEARCH_INDEX_NAME (parts index), not getAllSearchIndices() which searches both indices. The fix exists in commit 77744e8 but is NOT deployed.
Deployment Steps
Step 1: Deploy Search Service (CRITICAL)
cd /Users/vova/Code/CROP/CROP-parts-services
# Deploy to stage
gcloud run deploy search-service \
--source . \
--region us-east1 \
--project noted-bliss-466410-q6
# Verify deployment
curl 'https://api.crop-dev.app/ready' | jq '.revision'
# Should show new revision number
# Test parts endpoint
curl 'https://api.crop-dev.app/api/parts/kmt-04493560000' | jq '{found: (.part != null), slug: .part.slug}'
# Should return: { found: true, slug: "kmt-04493560000" }Step 2: Rebuild Tire ES Index with New Slugs (RECOMMENDED)
cd /Users/vova/Code/CROP/CROP-parts-services
# Run the GCP rebuild script
bash services/search/scripts/gcp-rebuild-tires-index.sh
# Verify new slugs
curl 'https://api.crop-dev.app/api/search?manufacturer=KMT&limit=1' | jq '.parts[0].slug'
# Should return: "ct-kmt-04493560000"Step 3: Verify End-to-End
# Test tire detail page via parts endpoint
curl 'https://api.crop-dev.app/api/parts/ct-kmt-04493560000' | jq '{found: (.part != null)}'
# Open in browser
open 'http://localhost:3000/tires/ct-kmt-04493560000'Timeline
| Step | Action | Time | Blocker |
|---|---|---|---|
| 1 | Deploy search service | ~5 min | None |
| 2 | Rebuild tires index | ~15 min | Step 1 |
| 3 | Verify frontend | ~2 min | Steps 1, 2 |
Rollback Plan
If deployment causes issues:
# Rollback to previous revision
gcloud run services update-traffic search-service \
--to-revisions search-service-00310-mrr=100 \
--region us-east1 \
--project noted-bliss-466410-q6Summary
Why tire pages show "Tire not found":
- Frontend calls
/api/parts/ct-kmt-04493560000 - Backend (old revision) only searches
parts_currentindex - Tire exists in
tires_currentindex with slugkmt-04493560000 - Backend returns 404 because it doesn't search tire index
- Frontend fallback tries
kmt-04493560000but also fails (same reason)
After deployment:
- Frontend calls
/api/parts/ct-kmt-04493560000 - Backend (new revision) searches BOTH
parts_currentANDtires_current - Tire found in
tires_current(with OLD slugkmt-04493560000) - Frontend shows tire page!
Notes
- MongoDB migration already done (7091 tires have new slugs
ct-kmt-*) - ES index rebuild will sync slugs between MongoDB and ES
- Frontend has fallback for OLD slug format (temporary, until ES rebuild)
CROP Documentation
Centralized reference for the CROP front-end. Every guide below reflects the current Next.js 16 + React 19 implementation that powers the parts catalog...
Clerk Authentication Setup
Application: CROP Public App (crop-front-mu.vercel.app) Last Updated: 2025-12-03 Status: ✅ Implemented (Basic Auth) Provider: Clerk(https://clerk.com/)