Skip to content

Remove deprecated legacy frontend code, UserProfile, and Twilio SMS#969

Draft
alexdlaird wants to merge 13 commits into
developfrom
feature/legacy-shutdown-2026-08-01-v2
Draft

Remove deprecated legacy frontend code, UserProfile, and Twilio SMS#969
alexdlaird wants to merge 13 commits into
developfrom
feature/legacy-shutdown-2026-08-01-v2

Conversation

@alexdlaird
Copy link
Copy Markdown
Member

Removes everything in platform marked deprecated for the legacy frontend, plus the UserProfile model (only held phone fields) and the Twilio SMS integration. Lands alongside the Aug 1, 2026 frontend-legacy shutdown.

The email-alias rework that originally lived on this branch was cherry-picked out and shipped independently on develop (commits e37a0ab..6599141) so the new frontend could ship the email-keyed wire format ahead of the cutover. Merging that develop work back in is what the latest merge commit does — both halves coexist correctly while legacy code is still here, and stand alone once legacy goes.

API

  • Drop /auth/token/legacy/, deprecated PUT /auth/user/profile/, deprecated GET /auth/user/pushtoken/<pk>/
  • Drop CourseScheduleAsEvents views and the deprecated DELETE on CourseScheduleApiDetailView
  • Drop legacy CSRF/CORS origins, user_legacy throttle, PROJECT_APP_LEGACY_HOST, FRONTEND_LEGACY_VERSION
  • Restore standard DRF UserRateThrottle (the custom helium.common.throttles.UserRateThrottle was legacy-only)
  • Reminder updates: PUT removed, PATCH-only
  • Registration: drop username from UserCreateSerializer (auto-generated from email)
  • material_group made read-only on MaterialSerializer
  • Deprecate POPUP/TEXT reminder types, alias to PUSH, shrink REMINDER_TYPE_CHOICES to (EMAIL, PUSH); import service forward-maps legacy type values

Models / services / CI

  • Delete UserProfile model and User.last_login_legacy field
  • Delete phoneservice, send_text task, process_text_reminders, text_reminders periodic task
  • Drop twilio from requirements.txt
  • Add deprecation comment to User.username (kept only because AbstractBaseUser requires USERNAME_FIELD; auto-generated from email)
  • Drop run_legacy_cluster_tests and the cluster-tests stage from release.yml/deploy.yml/build.yml

Linked PRs — do not merge before Aug 1, 2026

Merge in order — this PR last so the deploy doesn't 404 routes the legacy frontend is still calling:

  1. Move site to www.heliumedu.com; drop Helium Classic links www#2 — marketing site reconfigured for www (supersedes closed Fix build #1)
  2. Tear down legacy frontend hosting and Twilio (phase 1 of 2) infra#52 — infra phase 1 (tears down legacy hosting)
  3. Repoint marketing distribution to www.heliumedu.com (phase 2 of 2) infra#53 — infra phase 2 (points www at the marketing distribution)
  4. Remove heliumcli dependency (infra phase 3) infra#55 — infra phase 3 (removes heliumcli)
  5. This PR

Test plan

  • CI green
  • Migrations helium_auth/0061, helium_auth/0062, helium_planner/0051 apply cleanly on a copy of prod data
  • After deploy, POST /auth/token/legacy/ returns 404
  • After deploy, GET /planner/courseschedules/events/ returns 404

Frees the platform from legacy frontend support ahead of frontend-legacy
shutdown on August 1, 2026.

API surface
- Drop legacy token endpoint, serializer, and longer-TTL token classes
- Drop deprecated PUT on user profile and GET on user push token
- Drop CourseSchedule-as-Events views and DELETE on CourseSchedule
- Drop legacy CSRF/CORS origins, throttle scope, and PROJECT_APP_LEGACY_HOST
- Drop FRONTEND_LEGACY_VERSION setting

Models, services, tasks
- Delete UserProfile model entirely (only held phone fields, all legacy)
- Drop User.last_login_legacy field
- Migration 0060 removes the model and field
- Delete Twilio integration: phoneservice, send_text task, process_text_reminders
- Drop twilio dependency from requirements.txt
- Add deprecation comment to User.username explaining it stays only because
  Django's AbstractBaseUser requires USERNAME_FIELD

CI
- Drop legacy cluster-tests stages from release/deploy/build workflows
- Delete entire testcasecoursescheduleresourceviews.py (tested the
  CourseScheduleAsEvents views removed in this PR)
- Delete test_get_push_token_by_id (tested the deprecated GET removed)
- Update test_delete_course_schedule_by_id to expect 405 (DELETE method
  was removed; DRF now returns Method Not Allowed)
- Drop UserProfile assertions from test_get_user (UserProfile is gone)
Rename Django migration file from 0047_alter_reminder_type.py to 0048_alter_reminder_type.py and update the generated timestamp. Update the migration dependency from ('planner', '0046_alter_category_title_and_more') to ('planner', '0047_alter_category_weight_alter_course_credits_and_more') so the migration ordering remains correct.
Update migration dependency references to match renumbered/renamed migrations: change 0061 to depend on '0060_alter_user_username_and_more' (replacing the old 0059 reference), and update 0062 to depend on '0061_alter_usersettings_default_reminder_type' (was 0060). Keeps the migration chain consistent after migration renames/insertions.
Renamed migration file from 0051_alter_reminder_type.py to 0053_alter_reminder_type.py and updated its dependency from ('planner', '0050_alter_course_credits_and_more') to ('planner', '0052_alter_reminder_start_of_range'). Keeps the migration ordering consistent with the new dependency chain.
Switch the default PROJECT_LANDING_HOST to the www subdomain for non-local environments, import the strip_www utility, and add strip_www(PROJECT_LANDING_HOST) to CSRF_TRUSTED_ORIGINS and CORS_ALLOWED_ORIGINS so both www and non-www variants are accepted. Local fallback remains unchanged.
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 26, 2026

Not up to standards ⛔

🔴 Issues 1 medium

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
Complexity 1 medium

View in Codacy

🟢 Metrics -23 complexity · -25 duplication

Metric Results
Complexity -23
Duplication -25

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sentry
Copy link
Copy Markdown

sentry Bot commented May 27, 2026

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.63%. Comparing base (83d3367) to head (0dabe4f).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
helium/importexport/services/importservice.py 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #969      +/-   ##
===========================================
- Coverage    86.82%   86.63%   -0.19%     
===========================================
  Files          148      143       -5     
  Lines         8045     7747     -298     
  Branches       835      811      -24     
===========================================
- Hits          6985     6712     -273     
+ Misses         852      829      -23     
+ Partials       208      206       -2     

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

Resolve conflict in MaterialSerializer: include notes field from develop alongside material_group read-only from this branch. Renumber helium_auth migrations 0062→0063 (alter_usersettings_default_reminder_type) and 0063→0064 (remove_userprofile_and_last_login_legacy) to follow develop's new 0062_alter_useroauthprovider_provider.
Clarify reminder-related help text and alter user fields. Adds a new auth migration that tightens the User.username field (validators, unique error message, help text, max_length) and updates Usersettings.default_reminder_type help_text/default. Also updates the planner Reminder.type help_text in both the model and its migration to describe it as the notification channel for the reminder.
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.

1 participant