Skip to content

Feat: bypass google account picker on sign in#261

Merged
cirex-web merged 10 commits into
mainfrom
staging
May 18, 2026
Merged

Feat: bypass google account picker on sign in#261
cirex-web merged 10 commits into
mainfrom
staging

Conversation

@cirex-web
Copy link
Copy Markdown
Collaborator

@cirex-web cirex-web commented May 18, 2026

Also adds report data on both the primary v2/locations endpoint and a new endpoint for fetching the reports of a single location

Copilot AI review requested due to automatic review settings May 18, 2026 20:07
Copy link
Copy Markdown
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

The PR's stated goal is to bypass the Google account picker on sign-in by removing the prompt: "select_account" parameter and adding an hd: "andrew.cmu.edu" hosted-domain hint to the OIDC authorization URL. However, it also includes a sizable set of unrelated changes: a new QueryUtils.getReportsAfter query helper, a refactor of the /v2/locations/:locationId/reports endpoint to use it with a 1-day window, a new reportCount field on the locations API response, a new pnpm-workspace.yaml, and pure formatting churn in auth.ts (trailing commas).

Changes:

  • Replace prompt: "select_account" with hd: "andrew.cmu.edu" in the OIDC auth URL.
  • Add QueryUtils.getReportsAfter, wire it into the reports endpoint and into getAllLocationsFromDB to expose a new reportCount per location.
  • Add a pnpm-workspace.yaml workspace config and apply formatting tweaks across auth.ts.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
src/endpoints/auth.ts Core PR change: swap prompt: "select_account" for hd: "andrew.cmu.edu"; otherwise formatting-only edits.
src/endpoints/reviews.ts Refactor /v2/locations/:locationId/reports to use QueryUtils.getReportsAfter with a 1-day window; leaves several unused imports.
src/db/dbQueryUtils.ts New getReportsAfter(start_time, for_location_id?) helper using gt + optional eq filter on reportsTable.
src/db/getLocations.ts Fetch reports since timeSearchCutoff, aggregate by location, attach reportCount to each location object.
pnpm-workspace.yaml New pnpm workspace file declaring packages: [.] and strictDepBuilds: false.
Comments suppressed due to low confidence (1)

src/endpoints/reviews.ts:154

  • The endpoint's response schema (lines 145–154) declares createdAt: t.Date(), but getReportsAfter returns rows from reportsTable directly, which typically yields a JS Date from drizzle but serializes over HTTP as an ISO string or number depending on the schema column type. Please double‑check that the reportsTable.createdAt column type produces a value compatible with t.Date() (Elysia validates outgoing payloads), otherwise responses may fail validation at runtime. Note the other endpoint above uses createdAt: t.Number() for review timestamps — confirm the inconsistency is intentional.
      response: t.Array(
        t.Object({
          id: t.Number(),
          userId: t.Nullable(t.Number()),
          createdAt: t.Date(),
          locationId: t.String(),
          message: t.String()
        })
      )
    }

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

Comment thread src/endpoints/reviews.ts Outdated
Comment thread src/endpoints/auth.ts
Comment thread src/endpoints/auth.ts
Comment thread src/endpoints/reviews.ts Outdated
Comment thread src/db/dbQueryUtils.ts
Comment thread src/db/getLocations.ts Outdated
Comment thread src/db/getLocations.ts Outdated
Comment thread src/db/getLocations.ts Outdated
Comment thread src/db/getLocations.ts Outdated
Comment thread src/db/dbQueryUtils.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@railway-app railway-app Bot temporarily deployed to CMU Eats / searchable_menus May 18, 2026 20:12 Inactive
@railway-app railway-app Bot temporarily deployed to CMU Eats / staging May 18, 2026 20:12 Inactive
@github-actions
Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 82.69% 478 / 578
🔵 Statements 81.9% 498 / 608
🔵 Functions 80% 128 / 160
🔵 Branches 72.42% 260 / 359
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/db/dbQueryUtils.ts 83.72% 88.88% 78.94% 85.36% 167-170, 187-190, 234-245
src/db/getLocations.ts 94.11% 90.9% 87.5% 93.75% 32-33
Generated in workflow #517 for commit 348f5e9 by the Vitest Coverage Report Action

@cirex-web cirex-web merged commit 024438a into main May 18, 2026
6 checks passed
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.

3 participants