Skip to content

Add non-persoanlized recommendation digest#1086

Merged
zhenghaoz merged 6 commits intomasterfrom
hash
Nov 7, 2025
Merged

Add non-persoanlized recommendation digest#1086
zhenghaoz merged 6 commits intomasterfrom
hash

Conversation

@zhenghaoz
Copy link
Collaborator

No description provided.

@zhenghaoz zhenghaoz marked this pull request as ready for review November 7, 2025 12:41
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 72.27723% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.81%. Comparing base (e3d7faf) to head (2220dd4).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
logics/recommend.go 64.61% 16 Missing and 7 partials ⚠️
master/rest.go 33.33% 0 Missing and 2 partials ⚠️
worker/worker.go 81.81% 0 Missing and 2 partials ⚠️
master/tasks.go 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1086      +/-   ##
==========================================
+ Coverage   70.79%   70.81%   +0.02%     
==========================================
  Files          87       87              
  Lines       15028    15081      +53     
==========================================
+ Hits        10639    10680      +41     
- Misses       3348     3355       +7     
- Partials     1041     1046       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhenghaoz zhenghaoz requested a review from Copilot November 7, 2025 13:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the recommendation caching system by renaming cache keys for consistency and introducing digest-based cache validation to track configuration changes. The changes consolidate various offline recommendation cache keys under a unified Recommend namespace and add digest tracking to detect when recommendation configurations have changed.

Key Changes

  • Renamed cache constants from OfflineRecommend* to Recommend* and similar naming improvements for consistency
  • Modified recommender functions to return digests alongside scores for cache validation
  • Added new util.MD5() function that computes order-independent hashes of strings

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
storage/cache/database.go Consolidated and renamed cache key constants for recommendations, added digest constants for all recommender types
logics/recommend.go Updated all recommender functions to return digests, added external recommender support with recommendExternal()
logics/recommend_test.go Added test coverage for digest returns in all recommender functions and new external recommender test
worker/worker.go Integrated digest capture and storage when generating recommendations
worker/worker_test.go Updated all tests to use new cache key names and added digest validation test
config/config.go Refactored Hash() to use new util.MD5() for order-independent digest computation
common/util/util.go Added new MD5() utility function for computing order-independent hashes
server/rest.go Updated REST endpoints to use new cache key names
server/rest_test.go Updated test assertions to use new cache key names
master/tasks.go Added digest storage for non-personalized recommenders
master/tasks_test.go Added digest validation tests for item-to-item and user-to-user recommenders
master/rest.go Updated REST endpoints to use new cache key names and handle digest returns
client/client_test.go Updated test to use new recommend cache key name
.github/workflows/dockerhub-description.yml Added checkout step before resolving images in README

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zhenghaoz zhenghaoz merged commit f24083a into master Nov 7, 2025
12 checks passed
@zhenghaoz zhenghaoz deleted the hash branch November 7, 2025 13:37
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.

2 participants