Skip to content

fix: recompute global leaderboard tags on post approval#4974

Open
aseckin wants to merge 2 commits into
mainfrom
claude/issue-1820-duplicated-questions-dont-trigger-global
Open

fix: recompute global leaderboard tags on post approval#4974
aseckin wants to merge 2 commits into
mainfrom
claude/issue-1820-duplicated-questions-dont-trigger-global

Conversation

@aseckin

@aseckin aseckin commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Closes #1820.

Summary

  • approve_post now calls update_global_leaderboard_tags after finalizing each question's timing fields, so duplicated (and any newly-created) posts get their global leaderboard tag attached at approval time instead of waiting for a close/resolve/unresolve recompute.

Test plan

  • pytest tests/unit/test_posts/test_views.py::test_approve_post__updates_global_leaderboard_tags
  • Manually duplicate a question, approve it, confirm the global leaderboard tag appears on the post detail page

Generated with Claude Code

Global leaderboard tag computation depends on each question's open_time
and scheduled_close_time. For newly created posts (in particular
duplicated ones, whose timing fields the frontend clears) these fields
are null at create time, so the tag pass in create_post produces no
tags. Approval finalizes the times but did not re-run the tag pass,
leaving duplicated posts without a global leaderboard tag until another
lifecycle transition (close/resolve/unresolve) triggered a recompute.

Co-authored-by: aseckin <aseckin@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@aseckin, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c49f7f1b-31f9-4eb6-ad0a-cac6f4f1bc13

📥 Commits

Reviewing files that changed from the base of the PR and between 3d039d0 and 9f6bc25.

📒 Files selected for processing (2)
  • posts/services/common.py
  • tests/unit/test_posts/test_views.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/issue-1820-duplicated-questions-dont-trigger-global

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview Environment

Your preview environment is ready!

Resource Details
🌐 Preview URL https://metaculus-pr-4974-claude-issue-1820-duplicated-q-preview.mtcl.cc
📦 Docker Image ghcr.io/metaculus/metaculus:claude-issue-1820-duplicated-questions-dont-trigger-global-9f6bc25
🗄️ PostgreSQL NeonDB branch preview/pr-4974-claude-issue-1820-duplicated-q
Redis Fly Redis mtc-redis-pr-4974-claude-issue-1820-duplicated-q

Details

  • Commit: 9f6bc25ee1f80b8ee34d360b30b126888c6a0f17
  • Branch: claude/issue-1820-duplicated-questions-dont-trigger-global
  • Fly App: metaculus-pr-4974-claude-issue-1820-duplicated-q

ℹ️ Preview Environment Info

Isolation:

  • PostgreSQL and Redis are fully isolated from production
  • Each PR gets its own database branch and Redis instance
  • Changes pushed to this PR will trigger a new deployment

Limitations:

  • Background workers and cron jobs are not deployed in preview environments
  • If you need to test background jobs, use Heroku staging environments

Cleanup:

  • This preview will be automatically destroyed when the PR is closed

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@aseckin aseckin requested a review from lsabor July 1, 2026 11:13
@aseckin aseckin marked this pull request as ready for review July 1, 2026 11:13
@aseckin

aseckin commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@lsabor would appreciate a review

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.

Duplicated questions don't trigger global leaderboard tag update

1 participant