Skip to content

Allow three display name changes through Popcorn - #539

Merged
msaroufim merged 1 commit into
mainfrom
feat/display-name-renames
Dec 1, 2026
Merged

msaroufim merged 1 commit into
mainfrom
feat/display-name-renames

Conversation

@msaroufim

Copy link
Copy Markdown
Member

Add a CLI-authenticated PATCH /user/profile endpoint so users can choose the name shown on their existing leaderboard entries and chart history. Names are trimmed to 1–32 printable characters. Each account gets three successful lifetime changes; invalid requests and unchanged names consume none. The response includes the saved name and remaining changes, and a fourth distinct change returns a clear HTTP 403 error.

One counter on leaderboard.user_info and a row lock keep concurrent requests within the allowance. Historical entries already join the canonical user record, so submission IDs, scores, and ownership stay unchanged. CLI re-registration preserves and returns the chosen name.

Apply migration 20261130_02_display-name-changes before deploying the API. Companion CLI and Kernelboard changes add the command and refresh names in historical caches; no website rename controls or Discord announcement changes.

Validation: 428 tracked non-integration tests pass, including 21 new real-PostgreSQL/API tests for authentication, validation, unchanged names, the three-change boundary, concurrent final-slot requests, historical rankings, and re-registration. Migration apply/rollback/reapply verified locally. Actual Popcorn → local FastAPI → PostgreSQL smoke test verifies three successful changes and the fourth rejection, with no GPU work or production mutations. Ruff and diff checks pass.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/libkernelbot
  leaderboard_db.py 291
  utils.py
Project Total  

This report was generated by python-coverage-comment-action

@msaroufim
msaroufim marked this pull request as ready for review December 1, 2026 03:45
@msaroufim
msaroufim merged commit 539679f into main Dec 1, 2026
4 checks passed
@mtolgacangoz

Copy link
Copy Markdown
Contributor

Thanks for these PRs!

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