Skip to content

Conversation

@cirex-web
Copy link
Collaborator

@cirex-web cirex-web commented Jan 10, 2026

I did write a good number of tests for this (main changes are in src/db/reviews.ts) so it should be fine... pinging @Arom1a and @GhostOf0days in case they to take a look, but otherwise I'll merge this in soon.

Also cleaned up the other endpoints and moved them into separate files.

Copilot AI review requested due to automatic review settings January 10, 2026 20:57
@coderabbitai
Copy link

coderabbitai bot commented Jan 10, 2026

Important

Review skipped

Auto reviews are disabled on this repository.

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.

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


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@cirex-web cirex-web changed the base branch from main to staging January 10, 2026 20:57
@github-actions
Copy link

github-actions bot commented Jan 10, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 82.74% 446 / 539
🔵 Statements 81.89% 466 / 569
🔵 Functions 81.5% 119 / 146
🔵 Branches 71.84% 245 / 341
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/env.ts 80% 100% 50% 80% 20
src/containers/timeBuilder.ts 91.66% 86.95% 100% 91.48% 38, 52-55, 73-75
src/containers/time/parsedTime.ts 77.27% 77.27% 100% 77.27% 25, 29, 33, 36, 54
src/db/auth.ts 87.5% 83.33% 100% 100% 22, 41
src/db/dbQueryUtils.ts 83.33% 93.75% 76.92% 85.71% 146-149, 166-177
src/db/getLocations.ts 100% 100% 100% 100%
src/db/reviews.ts 100% 90% 100% 100%
src/db/schema.ts 64.51% 100% 35.29% 64.51% 32, 56, 72, 90, 103, 136, 160-166, 191-194
src/utils/timeUtils.ts 100% 100% 100% 100%
Generated in workflow #397 for commit bd30268 by the Vitest Coverage Report Action

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 adds a comprehensive review system for locations, including both star ratings and tag-based reviews. The implementation includes new database tables, API endpoints, and comprehensive test coverage. The PR also refactors the server code by organizing endpoints into separate modules and renames some types for better clarity.

Changes:

  • Added complete review system with star ratings (0.5-5.0 scale) and tag-based reviews with upvote/downvote and optional text
  • Refactored server endpoints into modular files (auth, deprecated, misc, reviews)
  • Renamed types for consistency: IParsedTimeRangeITimeSlot, ITimeRangeInternalIDateTimeRange

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/reviews.test.ts Comprehensive test suite for review functionality including edge cases
src/utils/timeUtils.ts Updated type reference from ITimeRangeInternal to IDateTimeRange
src/server.ts Refactored to use modular endpoint files and added API description
src/env.ts Added optional HARDCODE_SESSION_FOR_DEV_TESTING environment variable
src/endpoints/schemas.ts Extracted location schemas from server.ts into separate file
src/endpoints/reviews.ts New review endpoints for star and tag reviews with authentication
src/endpoints/misc.ts Extracted miscellaneous endpoints (locations, emails, slack) with critical import bug
src/endpoints/deprecated.ts Moved deprecated endpoints to separate module
src/endpoints/auth.ts Renamed authPlugin to authEndpoints, added dev session hardcoding, moved /whoami endpoint
src/deprecationNotice.ts Deleted - content moved to endpoints/deprecated.ts
src/db/schema.ts Added three new tables: tag_list, tag_reviews, star_reviews with proper constraints
src/db/reviews.ts New module with CRUD operations for reviews
src/db/getLocations.ts Updated type references
src/db/dbQueryUtils.ts Renamed ITimeRangeInternal to IDateTimeRange
src/db/auth.ts Added DBUser type export, improved return type, added JSDoc, imported env module
src/containers/timeBuilder.ts Updated type references from IParsedTimeRange to ITimeSlot
src/containers/time/parsedTime.ts Renamed IParsedTimeRange interface to ITimeSlot
drizzle/meta/_journal.json Added migration entry for review tables
drizzle/meta/0006_snapshot.json Complete database schema snapshot including new review tables
drizzle/0006_short_pestilence.sql Migration SQL for creating review tables with constraints
Comments suppressed due to low confidence (1)

src/endpoints/auth.ts:115

  • The hardcoded session for dev testing bypasses the normal authentication flow and could be a serious security vulnerability if accidentally enabled in production. Consider adding a check to ensure this is only used when ENV is set to "dev", or better yet, consider using a more secure approach for testing that doesn't bypass authentication in the production code path.

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

@cirex-web cirex-web merged commit 6e84604 into staging Jan 12, 2026
4 checks passed
cirex-web added a commit to ScottyLabs/cmueats that referenced this pull request Jan 12, 2026
Give locations a star rating, tag votes, and additionally add details to
each tag vote!

(styling could be improved, but idk what to change now lmao and this is
good enough for a first release)

(preview deployment will only work once backend PR
ScottyLabs/dining-api#239) is merged)

<img width="1280" height="702" alt="image"
src="https://github.com/user-attachments/assets/9e7c6216-f0f5-4596-972c-a39fdcf7234f"
/>

<img width="270" height="2532" alt="IMG_3337"
src="https://github.com/user-attachments/assets/766e1eb5-1e0e-4901-bef0-31cae3fcd63c"
/>
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