Skip to content

feat: refresh auth providers and score precision#196

Merged
quan0715 merged 6 commits into
devfrom
codex/auth-experience-refresh
Jun 26, 2026
Merged

feat: refresh auth providers and score precision#196
quan0715 merged 6 commits into
devfrom
codex/auth-experience-refresh

Conversation

@quan0715

Copy link
Copy Markdown
Owner

變更目標

  • 將登入 provider 設定收斂到單一 provider registry / register_oauth_provider contract
  • 收斂 NYCU provider key,遷移舊 nycu-oauth identity 資料
  • 補齊 NYCU login showcase 與 QAuth 身份認證擴充文件
  • 合併目前分支上的考試監控與分數精度調整

影響範圍

  • backend/apps/users/auth, backend/apps/users/views/auth.py, users migrations/tests
  • backend/apps/contests score / anticheat 相關服務與 migration
  • frontend auth entry screens、contest score display、docs pages

驗證

  • Pre-push hook: ESLint 通過(399 warnings, 0 errors)
  • Pre-push hook: TypeScript 編譯通過
  • Pre-push hook: frontend production build 通過
  • Pre-push hook: Docker Compose config 通過
  • backend users tests: pytest -q apps/users/tests tests/test_users.py 通過(150 passed)
  • migration check: python manage.py makemigrations --check --dry-run 通過
  • docs build: npm run build:docs 通過

風險與回滾

  • 涉及 auth provider registry、users migration、contest score precision migration;若上版後異常,回滾此 PR 並回復 migration 狀態。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c491538085

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

return 0;
}

return Math.round(numeric * 100) / 100;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use half-up decimal rounding for scores

When value is a valid score such as 1.005 (which can be produced by redistribution ratios before persistence), binary floating-point makes numeric * 100 fall just below the half, so this returns 1 and formats 1.00; the backend scorer now persists totals with Decimal(..., ROUND_HALF_UP), so admin previews/UI formatting can disagree with saved totals by 0.01. Please use a backend-equivalent decimal/string rounding path here rather than raw Math.round on a float.

Useful? React with 👍 / 👎.

@quan0715 quan0715 merged commit f22dd6f into dev Jun 26, 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.

1 participant