feat(certifications): shared certificationLabelKey so producer and importer resolve one key path per certification (CEL-1702) - #20
Conversation
…porter resolve one key path per certification (CEL-1702)
|
Warning Review limit reachedNext included review available in 42 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughChangesCertification utilities
Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Feature Merge Risk: ⚪ Minimal · up to This adds shared certification translation-key utilities with stable fallbacks and public package exports. Canonical, unknown, and prototype-name inputs are covered, with no current merge-readiness risk identified. Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks each label key, Comment |
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Adds a shared certificationLabelKey helper and constants with tests, consolidating i18n key resolution to prevent drift between dashboards. Bounded additive change with no behavior impact on existing consumers.
Re-trigger cubic
…ertification, separator-safe keys, frozen id list (CEL-1702 review)
What
New src/certifications.ts exporting CERTIFICATION_TYPES (organic, fairtrade, sustainable), isCertificationType, and certificationLabelKey(type) returning a stable key certification. plus the English fallback (raw id for unknown types; Object.hasOwn keeps prototype names out). Re-exported from the package index.
Why
Producer renders the certification chips via offers:form.certification.* and importer via opportunities:certifications.*, identical English on two key paths, so the seven machine-translated locales can drift between surfaces (found in the CEL-1699 review). Both consumers will resolve the key through this helper and carry certification. in their own locale file.
Release and consumers
No version bump on the branch; after merge, make release-minor on main (0.12.1 to 0.13.0) and the OIDC workflow publishes. Then producer (replace the local helper in src/lib/offer-form-i18n-labels.ts) and importer (opportunity-detail.tsx inline keys) bump to ^0.13.0 in separate PRs.
Tests
tests/certifications.test.ts: canonical keys and fallbacks, unknown id keeps a stable key, prototype names rejected, canonical id list. Full suite green.
Gates
npm run typecheck 0, vitest run green, make build 0 (dist orphan check OK).
Implemented by the orchestrator because agent spawns were denied.
Summary by cubic
Adds a shared
certificationLabelKeyhelper to@cellarnode/beverage-utilsso the producer and importer dashboards resolve one stable i18n key path per certification. Previously each dashboard kept its own key path (offers:form.certification.*vscertifications.*), which could drift in the machine-translated locales.CERTIFICATION_TYPES,certificationLabelKey,isCertification, andnormalizeAndCheckCertificationfrom the package index.certification.<type>key with i18next separators neutralized and the raw id as fallback, and prototype names likeconstructorare rejected..reposkein/decisions/2026-09-08-one-certification-i18n-key-contract-for-every-dashboard.json).Migration
^0.13.0replacing their local helpers/inline keys.Written for commit 9600a63. Summary will update on new commits.