-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Admin] 2 Hacker reviewers #510
Conversation
Deploy preview for irvinehacks-site-2025 ready!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have some high-level comments for now, but overall, this PR is looking quite hefty. Do you think you could break this down into smaller pieces? Suggested division:
- Setting up placeholder Admin page structure for different applicant types and showing the hacker applicants
- Adding the new hacker review logic and indicator
- Adding the ability to adjust the thresholds
@@ -43,6 +43,16 @@ class ApplicantSummary(BaseRecord): | |||
application_data: ApplicationDataSummary | |||
|
|||
|
|||
class HackerApplicantSummary(BaseRecord): | |||
uid: str = Field(alias="_id") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I think BaseRecord
already includes uid
, so it doesn't need to be specified again here (perhaps doesn't hurt for clarity? but seems redundant).
@@ -73,6 +83,83 @@ async def applicants( | |||
raise RuntimeError("Could not parse applicant data.") | |||
|
|||
|
|||
@router.get("/hackerApplicants") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought: I'm imagining long term you'll also have a similar endpoint for mentor and volunteer applicants? Might make more sense to group the paths, e.g. /applicants/hackers
.
Note: otherwise, let's name the API paths with kebab-case
applicant: str = Body(), | ||
score: float = Body(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chore [can handle later]: I think we can update this to use a model for the Request Body.
@@ -97,6 +184,45 @@ async def applicant_summary() -> dict[ApplicantStatus, int]: | |||
return await summary_handler.applicant_summary() | |||
|
|||
|
|||
@router.post("/hackerReview") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar note on grouping routes, e.g. /review/hacker
apps/api/src/routers/admin.py
Outdated
records = await mongodb_handler.retrieve( | ||
Collection.USERS, | ||
{"status": Status.REVIEWED}, | ||
["_id", "avg_score", "first_name"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: I think it would make more sense for average score to be computed in the API than stored in the database?
_include_num_reviewers(record) | ||
_include_avg_score(record) | ||
_delete_reviews(record) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: given the increasing amount of code in this router file, it might help to move these functions to a separate module, e.g. somewhere like src/admin/applicant_review_processor.py
.
@router.post("/releaseHackerDecisions", dependencies=[Depends(require_director)]) | ||
async def release_hacker_decisions() -> None: | ||
"""Update applicant status based on decision and send decision emails.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I appreciate the eagerness in putting everything together, but it might help to break down the work into smaller pieces so new features can be reviewed incrementally (reduces reviewer fatigue and the possibility of overlooking something in the large amount of changes). Same applies to implementing setting the thresholds.
export { default as default } from "./Applicants"; | ||
export { default as default } from "./HackerApplicants"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: do you have a long-term site structure in mind for the different types of applicants? Currently, this places the hacker applicants page at /admin/applicants
. Similar to the suggestion on grouping the API endpoints, the actual page paths could also be grouped in a similar way, and the base page can be used to show more summary charts (#399). Might help to set up some placeholder pages for how we think things will eventually be laid out before fleshing things out more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe @waalbert is working on making a tab each for Hackers, Mentors, and Volunteers. I will coordinate with him once that has been implemented, but in the meantime I will split up this PR.
- Added admin tests for /hackerApplicants and /submitHacker routes
/applicants
,/hackerApplicants
,/release
,/releaseHackerDecisions
,/review
,/hackerReview
,/setThresholds
, routeHackerApplicants.tsx
Testing
/releaseHackerDecisions
to ensure db status updates