Skip to content
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

Closed
wants to merge 11 commits into from
Closed

Conversation

IanWearsHat
Copy link
Member

@IanWearsHat IanWearsHat commented Dec 20, 2024

  • Affected /applicants, /hackerApplicants, /release, /releaseHackerDecisions, /review, /hackerReview, /setThresholds, route
  • Still needs way to show an applicant's decision on frontend HackerApplicants.tsx
  • Still needs way to filter accepted, waitlisted, rejected and other filter

Testing

  • Create a sample app in the db
  • Navigate to that app, score it in the top right
    • Ensure the score updates in the reviews log on that page, updates in the db, updates the number of reviewers in the applicants overview, and status is still set to pending_review
  • Review that app again with a different account
    • Ensure avg_score updates in db, status is set to reviewed
  • Manually run /releaseHackerDecisions to ensure db status updates

@IanWearsHat IanWearsHat linked an issue Dec 20, 2024 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Dec 20, 2024

Deploy preview for irvinehacks-site-2025 ready!

Name IrvineHacks Site
Preview Visit Preview
Commit ceb7330

Copy link
Member

@taesungh taesungh left a 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:

  1. Setting up placeholder Admin page structure for different applicant types and showing the hacker applicants
  2. Adding the new hacker review logic and indicator
  3. 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")
Copy link
Member

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")
Copy link
Member

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

Comment on lines +189 to +190
applicant: str = Body(),
score: float = Body(),
Copy link
Member

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")
Copy link
Member

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

records = await mongodb_handler.retrieve(
Collection.USERS,
{"status": Status.REVIEWED},
["_id", "avg_score", "first_name"],
Copy link
Member

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?

Comment on lines +108 to +110
_include_num_reviewers(record)
_include_avg_score(record)
_delete_reviews(record)
Copy link
Member

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.

Comment on lines +272 to +274
@router.post("/releaseHackerDecisions", dependencies=[Depends(require_director)])
async def release_hacker_decisions() -> None:
"""Update applicant status based on decision and send decision emails."""
Copy link
Member

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";
Copy link
Member

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.

Copy link
Member Author

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
@waalbert
Copy link
Contributor

waalbert commented Jan 4, 2025

Closing as completed in #514, #526, and #527

@waalbert waalbert closed this Jan 4, 2025
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.

[Admin] Allow 2 reviewers to review Hackers
3 participants