Skip to content

Conversation

@ruiichen
Copy link
Collaborator

@ruiichen ruiichen commented Nov 26, 2025

Notion ticket link

Ticket Name

Implementation description

  • Added the delegation algorithm.
  • Added the GraphQL endpoint to trigger the delegation algorithm

Steps to test

  1. Drop everything from your reviewed_applicant_records table: DELETE FROM reviewed_applicant_records;
  2. Take a look at the applicant_records table: SELECT * FROM applicant_records WHERE position='VP Engineering';
  3. Take a look at the users table: SELECT * FROM users WHERE position='VP Engineering';
  4. Run the GQL mutator
mutation {
  delegateReviewers(
    positions: ["VP Engineering"]
  ) {
    applicantRecordId
  }
}
image ``` mutation { delegateReviewers( positions: ["Developer"] ) { applicantRecordId } } ``` image

What should reviewers focus on?

  • 💀 if it works
  • Note: if there are an odd number of users with a position, the corresponding applicant record will only have one reviewed applicant record. This is intentional. We will just let the VPEs decide what to do.

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@ruiichen ruiichen self-assigned this Nov 26, 2025
ruiichen added 5 commits November 29, 2025 13:50
# Conflicts:
#	backend/typescript/graphql/resolvers/reviewDashboardResolvers.ts
#	backend/typescript/services/implementations/reviewDashboardService.ts
#	backend/typescript/services/interfaces/IReviewDashboardService.ts
@ruiichen ruiichen force-pushed the INTF25-create-delegation-algorithm branch from 72a8eb8 to 353409d Compare November 29, 2025 19:03
Copy link
Collaborator

@isabellehuangg isabellehuangg left a comment

Choose a reason for hiding this comment

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

Algorithm makes sense to me! Just added a comment for code clarity

/* eslint-disable @typescript-eslint/no-non-null-assertion */
const [count, userIds] = FSM.get(record.position)!;
let newCount = count;
const assignedReviewer1 = FSM.get(record.position)![1][newCount];
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: Could FSM.get(record.position)![1] be replaced by userIds from line 220?

Copy link
Contributor

@mxc-maggiechen mxc-maggiechen left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

3 participants