Skip to content

chore(release): promote dev to main - #1578

Merged
JOY (JOY) merged 5 commits into
mainfrom
dev
Nov 2, 2026
Merged

JOY (JOY) merged 5 commits into
mainfrom
dev

Conversation

@JOY

@JOY JOY (JOY) commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Promote dev to main.

Merge with a merge commit, never squash (Docs/Resources/RELEASE.md).


📌 TL;DR

This PR aligns the catalog search RPC and client-side rating logic to use the unified "shown rating" (prioritizing rating_score over weighted/average ratings) and implements the full write path for the v2 review form, including category validation, RPC error mapping, and localized field-level error handling.

🎯 Type of Change

  • 🚀 New feature
  • 🐛 Bugfix
  • 🧹 Refactor
  • 📚 Documentation
  • ⚙️ CI / Configuration

🔍 Changes Walkthrough

File Summary of Changes
.github/workflows/ci.yml Adds a CI step to replay the search rating score proposal test script.
.gitignore Un-ignores the new SQL proposal files for the search rating score migration.
Docs/Proposals/2026-11-01-dos-me-review-submission-v2-rollback.sql Updates the rollback script to drop the rate.review_text_stored function.
Docs/Proposals/2026-11-02-dos-me-search-rating-score.sql New Migration: Replaces rate.search_master_products to sort/filter using the unified "shown rating" logic (rating_score → weighted → average) instead of raw/expert ratings.
Docs/Proposals/2026-11-02-dos-me-search-rating-score-rollback.sql New Rollback: Restores the previous search_master_products function definition.
Docs/Proposals/2026-11-02-dos-me-search-rating-score-verify.sql New Verification: Read-only SQL checks to validate the new function's behavior, permissions, and rating consistency.
Docs/Proposals/2026-11-02-dos-me-search-rating-score.md New Documentation: Explains the rationale, diff, and rollout plan for the search rating alignment.
apps/web/locales/{cs,en,vi}.json Adds the v2ErrRejected translation key for generic field validation errors.
apps/web/src/app/[locale]/smartphones/[slug]/page.tsx Fetches the product's category slug when v2 review form is enabled and passes it to the reviews section.
apps/web/src/app/api/v1/rate/__tests__/write-paths.test.ts Extends tests to cover v2 review submission success, field-level RPC errors, category validation, and error mapping.
apps/web/src/app/api/v1/rate/reviews/route.ts Implements the v2 review submission logic: validates category criteria, maps RPC errors to field-level UI errors, handles 404/503/502 cases, and revalidates cache tags.
apps/web/src/components/reviews/JReviewsSection.tsx Hides the "Write Review" button if the product's category lacks rating criteria (v2 mode) and passes the correct category slug to the form.
apps/web/src/components/reviews/ReviewFormV2.tsx Adds UI support for displaying field-level errors on the comment field and accepts a generic string for categorySlug.
apps/web/src/lib/__tests__/leaderboard-criteria.test.ts Adds tests ensuring the leaderboard engine uses the unified rating resolution logic.
apps/web/src/lib/__tests__/review-form-v2.test.ts Adds a test case for criterion line length validation with special characters.
apps/web/src/lib/leaderboard-engine.ts Refactors scoreMasterProductForLeaderboard to use resolveCompareEffectiveUserRating for consistent rating calculation.
apps/web/src/lib/rate-api.ts Updates getMasterProducts to use the unified rating resolver and 1-decimal rounding for min-rating filters. Refactors getPublishedMasterProductCategorySlug to return a structured object with published and category status.

📊 Architectural Flow

sequenceDiagram
    participant User
    participant Web_UI as Web UI (ReviewFormV2)
    participant API as API Route (reviews/route.ts)
    participant DB as Supabase (RPC)
    participant Cache as Next.js Cache

    User->>Web_UI: Submits v2 Review
    Web_UI->>API: POST /api/v1/rate/reviews
    API->>API: Validate Category & Criteria (hasRatingCriteria)
    alt Category Invalid
        API-->>Web_UI: 400 INVALID_REVIEW (fieldErrors)
    else Category Valid
        API->>DB: submit_community_review_v2 (RPC)
        alt RPC Success
            DB-->>API: Review Record
            API->>Cache: revalidateTag (Reviews, Products, Stats)
            API-->>Web_UI: 200 OK (Review Item)
        else RPC Field Error (22023)
            DB-->>API: Error with details
            API->>API: Map details to field (reviewV2FieldFromRpcDetail)
            API-->>Web_UI: 400 INVALID_REVIEW (fieldErrors)
        else RPC Not Found (P0002)
            DB-->>API: Error
            API-->>Web_UI: 404 NOT_FOUND
        else RPC Unavailable
            DB-->>API: 404/500
            API-->>Web_UI: 503 REVIEWS_UNAVAILABLE
        end
    end
Loading

JOY (JOY) and others added 5 commits November 2, 2026 01:03
* fix(proposals): review v2 rollback drops review_text_stored

The review submission v2 rollback left rate.review_text_stored(text) behind.
gemini found it on the DOS-Me PR (DOS/DOS.Me#1499), which carries the same fix.
The replay now checks that all seven functions are gone after the rollback.

Refs #1544

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1574)

* docs(proposals): dos-me search sorts and filters on the shown rating

Draft DOS-Me migration (not applied): rate.search_master_products orders
rating_desc and filters p_min_rating on rating_score, then the weighted
user rating, then the average, as the web shows them. Built on
DOS/DOS.Me#1497's function; verify, rollback and a Docker replay in CI.

Refs #1545

* docs(proposals): the search rating filter compares at one decimal (#1545 review)

A stored 4.46 shows 4.5, so it now passes a 4.5 minimum; V5 and the replay
follow. The proposal lists the web follow-ups the review found.

Refs #1545

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(web): rating fallbacks follow the shown rating (#1545)

- The catalog's non-RPC path sorts and filters on resolveCompareEffectiveUserRating,
  not expert_rating, and compares a minimum rating at one decimal as pages show it.
- The leaderboard engine's user score uses the same helper, so a 0-100 average
  is 4.5, not 0, and a zero weighted rating falls back to the average.
- The rating helpers move to rate-domain-core (re-exported from rate-domain), so
  the engine imports them without a cycle.
- OpenAPI says minRating and rating_desc use rating_score_5.

Refs #1545

* fix(web): keep the OpenAPI rating text until the search RPC migration (#1545 review)

The live search_master_products still filters and sorts on the older ratings;
the docs change when the DOS-Me migration from #1574 is applied.

Refs #1545

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1576)

* chore(db): mirror the p3 review submission v2 migration from dos-me

DOS/DOS.Me#1499 is applied to production (promote DOS/DOS.Me#1500, 96237029).
Mirror its migration byte for byte into supabase/migrations and regenerate
packages/shared-data/src/database.types.ts, so the web gets the types of
rate.submit_community_review_v2, rate.rating_criteria and the line helpers.
Nothing is applied by this change.

Refs #1544

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1577)

* feat(web): store review form v2 through submit_community_review_v2

Refs #1544. P3 is live (DOS/DOS.Me#1500, mirrored in #1576), so the
stub becomes the real call: rate.submit_community_review_v2 as the
signed-in user, with blank criteria left out and no star or reviewer
type sent. A 22023 rejection whose DETAIL names a field is shown on that
field of the form (criteria.x as criterion.x, criterion_points as
points); 42501, 23505, 54000, P0002 and a bare 22023 keep v1's answers,
a missing RPC is a 503. The review list gets the analysis verdict
(flag_verdict), not the writer's verdict text. The write button is
hidden for a category without a criteria list, and the API refuses one.
The flag stays off by default.

* fix(web): review findings on the v2 rpc wiring

Refs #1544. The review category is the product's category row, as the
RPC reads it, never a guess from metadata or the name: the API and the
write button use it, so no one fills a form the RPC refuses. The stored
item keeps the category's own criteria keys. Criterion lines are counted
on storedPoint (NFC, no invisible characters) like the RPC. A whole
criterion entry the RPC refuses is marked on the criteria box, and
P0002 on the product is a 404.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@vercel

vercel Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
rate Ready Ready Preview Nov 1, 2026 11:58pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b4d50ce5-681e-4837-a178-09e355a373b3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions github-actions Bot added ci CI/CD workflows and pipelines docs Documentation changes area:frontend Frontend / Next.js / UI area:shared Shared packages / contracts / configs area:database labels Nov 1, 2026
@JOY
JOY (JOY) merged commit 523fc89 into main Nov 2, 2026
23 checks passed

This branch was successfully deployed

1 active deployment
Preview — 92d86baa Deployed Nov 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:database area:frontend Frontend / Next.js / UI area:shared Shared packages / contracts / configs ci CI/CD workflows and pipelines docs Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant