Skip to content

Remove v1 endpoints superseded by v2#207

Merged
jenul-ferdinand merged 3 commits into
refactor/v1-routes-into-domainsfrom
refactor/remove-dead-v1-endpoints
Jul 5, 2026
Merged

Remove v1 endpoints superseded by v2#207
jenul-ferdinand merged 3 commits into
refactor/v1-routes-into-domainsfrom
refactor/remove-dead-v1-endpoints

Conversation

@jenul-ferdinand

Copy link
Copy Markdown
Member

Stacked on #201 (targets its branch; retargets to main automatically once #201 merges). Part of #148.

What

Removes the v1 endpoints the frontend no longer calls, verified against the actual frontend service code (not just the #148 checklist):

  • /api/v1/reviews — GET /, GET /:unit, GET /user/:userId, POST /:unit/create, PUT /update/:reviewId, DELETE /delete/:reviewId, PATCH /toggle-reaction/:reviewId. Only POST /send-report remains (report-review component still calls it). This also deletes the update-averages no-op bug path (v1 review update never refreshes unit averages (updates keyed by review id) #204) rather than fixing it.
  • /api/v1/units — GET /, GET /popular, GET /filter. Kept: /unit/:unitcode and /:unitCode/required-by (unit-map + unit-review-header still call the v1 versions) and the admin write ops (no v2 replacement).
  • /api/v1/auth — POST /google/authenticate, GET /validate, POST /upload-avatar. Kept: /refresh and /logout (live via the auth interceptor) and GET /, /delete/:userId, /update/:userId (no v2 replacement yet).
  • Orphaned v1 controller/service/repository methods removed with their endpoints — review.v1.service.ts deleted outright, and review.repository.ts is back to exactly its pre-refactor v2 surface.
  • Perf harness: the v1-vs-v2 /popular comparison lost its baseline, so units.api.test.ts is now a v2-only load smoke (all requests must 200).

How usage was verified

  • Traced every environment API URL constant (apiUrl/authUrl/setuUrl/githubUrl) through the frontend services, then grepped every service method for component/interceptor/config call sites (.ts + .html, specs excluded).
  • Checked non-frontend consumers: scrapers make no API calls; the artillery perf suite was the only other v1 caller (handled above).
  • Left alone: notifications, github, setus, admin routers (all still live or admin-only with no v2 equivalent).

Untouched on purpose

  • Endpoints that are frontend-dead but have NO v2 replacement (auth GET /, delete/update user, setus list/average/season, units admin writes) — removing those is a product decision, listed in the API v1 → v2 Migration Checklist #148 comment.
  • The dead frontend methods that used to call the removed endpoints (getAllReviewsGET, toggleReactionPATCH, authService.googleAuthenticate, …) — frontend cleanup is API v1 → v2 Migration Checklist #148's remit.

Verification

  • 59/59 tests (was 81: the 22 removed tests covered exactly the removed endpoints; remaining v1 characterization tests unchanged and green).
  • Typecheck, eslint (0 errors), prettier, clean build, dist boot smoke all pass.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
monstar Ready Ready Preview, Comment Jul 5, 2026 11:07am

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 removes deprecated /api/v1 endpoints that have been superseded by /api/v2, keeping only the remaining v1 surfaces that the frontend still calls (notably v1 reviews send-report, plus selected v1 auth/units routes with no v2 replacement yet). It also updates the characterization/performance harness to align with the reduced v1 surface.

Changes:

  • Removed v1 auth/reviews/units endpoints (and their corresponding v1 domain-layer service/repository/controller code paths) that are no longer used.
  • Pruned v1 characterization tests that covered removed endpoints and consolidated remaining v1 review coverage into a send-report-only test file.
  • Retired the v1-vs-v2 /units/popular performance comparison and converted it into a v2-only load smoke test.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
backend/src/shared/testing/performance/v1.units.popular.yml Deletes the Artillery script for the removed v1 /units/popular endpoint.
backend/src/shared/testing/performance/v1.units.popular.report.json Removes the checked-in v1 Artillery report baseline tied to the deleted v1 endpoint.
backend/src/shared/testing/performance/units.api.test.ts Updates perf test to run v2-only load smoke and assert all requests return 200.
backend/src/domains/identity/users/user.v1.service.ts Removes v1 auth flows (Google auth/validate/upload-avatar) from the v1 service layer.
backend/src/domains/identity/users/user.repository.ts Removes repository helpers that were only needed for the removed v1 auth flows.
backend/src/domains/identity/users/auth.v1.routes.ts Unmounts removed v1 auth routes (google/authenticate, validate, upload-avatar).
backend/src/domains/identity/users/auth.v1.controller.ts Removes controller handlers for deleted v1 auth routes.
backend/src/domains/identity/users/auth.v1.api.test.ts Removes v1 characterization tests for deleted auth endpoints; keeps refresh/logout coverage.
backend/src/domains/academics/units/units.v1.routes.ts Unmounts removed v1 units routes (list/popular/filter).
backend/src/domains/academics/units/units.v1.api.test.ts Removes tests for deleted units endpoints; keeps tests for still-live v1 endpoints.
backend/src/domains/academics/units/unit.v1.service.ts Removes v1 orchestration methods for deleted units endpoints.
backend/src/domains/academics/units/unit.v1.controller.ts Removes handlers for deleted v1 units endpoints and cleans up related imports.
backend/src/domains/academics/units/unit.repository.ts Removes v1-only filtered-with-reviews aggregation method.
backend/src/domains/academics/reviews/reviews.v1.write.api.test.ts Deletes v1 write endpoint tests for endpoints that are now removed.
backend/src/domains/academics/reviews/reviews.v1.routes.ts Unmounts all removed v1 reviews routes; keeps only POST /send-report.
backend/src/domains/academics/reviews/reviews.v1.read.api.test.ts Deletes v1 read endpoint tests for endpoints that are now removed.
backend/src/domains/academics/reviews/reviews.v1.api.test.ts Adds a focused characterization test file for the remaining v1 send-report endpoint.
backend/src/domains/academics/reviews/review.v1.service.ts Deletes the v1 review service implementation now that its endpoints are removed.
backend/src/domains/academics/reviews/review.v1.controller.ts Removes handlers for deleted v1 review endpoints; keeps only sendReport.
backend/src/domains/academics/reviews/review.repository.ts Removes v1-only repository helpers used exclusively by deleted v1 review endpoints.
backend/src/domains/academics/reviews/index.ts Stops exporting ReviewV1Service after deletion.

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

Comment on lines +19 to +20
// Every request must succeed under load.
expect(counters['http.codes.200']).toBe(counters['http.requests']);
@jenul-ferdinand jenul-ferdinand merged commit de2b64f into refactor/v1-routes-into-domains Jul 5, 2026
3 checks passed
@jenul-ferdinand jenul-ferdinand deleted the refactor/remove-dead-v1-endpoints branch July 5, 2026 11:41
jenul-ferdinand added a commit that referenced this pull request Jul 5, 2026
@jenul-ferdinand jenul-ferdinand added the refactor Restructure or clean up code without changing behaviour. Covers tech debt. label Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend refactor Restructure or clean up code without changing behaviour. Covers tech debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants