Skip to content

Reviews Recap: Move proposals recap in its own adapter - #4677

Open
marcoacierno wants to merge 5 commits into
mainfrom
cleanup-reviews-recap-structure
Open

Reviews Recap: Move proposals recap in its own adapter#4677
marcoacierno wants to merge 5 commits into
mainfrom
cleanup-reviews-recap-structure

Conversation

@marcoacierno

@marcoacierno marcoacierno commented Jun 20, 2026

Copy link
Copy Markdown
Member

What

Currently the proposal recap is implemented outside the adpater pattern that we have for the review system, meaning that it shows itself in the grants as well and in general leaks again the implementation details into the admin class

@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
pycon Error Error Aug 15, 2026 5:24pm

@claude

claude Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Moves the proposals recap logic (stats, context building, compute-analysis view/URL) out of the generic ReviewSessionAdmin and into ProposalsReviewAdapter, so grants review sessions no longer expose the recap screen/URL.

Breaks the existing test suite (not updated in this PR):

  • reviews/tests/test_recap.py calls admin.review_recap_compute_analysis_view(...) in 5+ tests, but this method was moved to ProposalsReviewAdapter.review_recap_compute_analysis_view and no longer exists on ReviewSessionAdmin — these tests will now raise AttributeError.
  • test_recap_view_returns_correct_context asserts compute_analysis_url == ".../review/recap/compute-analysis/", but the new URL (registered via get_extra_urls) is .../review/proposals-recap/compute-analysis/ — this assertion will fail.

Missing admin_site.admin_view() wrapping on the new extra URLs: in admin.py get_urls(), the four core paths (shortlist, recap, start, vote view) are all wrapped with self.admin_site.admin_view(...), but get_all_review_adapters_extra_urls() is appended unwrapped. This drops the admin site's staff/active-user enforcement and never_cache handling that every other admin URL in this class gets, so the compute-analysis endpoint is reachable outside the normal admin auth path (it happens to still 403 anonymous users via has_perms, but it's inconsistent with the rest of the class and loses the admin_view protections).

Minor: import block at the top of adapters.py is unsorted/split (e.g. from django.http import JsonResponse on line 8 and from django.http import HttpRequest on line 28) — ruff check --fix would normally consolidate this.

@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 63.41463% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.68%. Comparing base (5aadf24) to head (46fc35c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4677      +/-   ##
==========================================
- Coverage   93.08%   92.68%   -0.40%     
==========================================
  Files         360      360              
  Lines       11202    11284      +82     
  Branches      902      911       +9     
==========================================
+ Hits        10427    10459      +32     
- Misses        663      713      +50     
  Partials      112      112              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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