GCTC-NTGC / gc-digital-talent

GC Digital Talent is the new recruitment platform for digital and tech jobs in the Government of Canada. // Talents numériques du GC est la nouvelle plateforme de recrutement pour les emplois numériques et technologiques au gouvernement du Canada.
https://talent.canada.ca
GNU Affero General Public License v3.0
22 stars 9 forks source link

🐛 Pool candidate category sorting and display inconsistent #10977

Closed vd1992 closed 1 month ago

vd1992 commented 3 months ago

🐛 Bug

Right now our "Category" property for pool candidates is handled inconsistently. Sometimes the sorting uses a scope that takes validation into account, sometimes it doesn't, sometimes it handles it on the frotnend only. Usually the sorting happens on the backend and calculating the display name happens on the frontend. The whole system uses a numeric weight value that gets introduced into the business logic, making it harder to maintain.

🦋 Expected Behaviour

Sorting and naming should be happening on the backend. Backend sorting is mandatory to support paginated queries and the naming should happen with the same logic. Now that we have localized enums it should make the naming easier on the backend and we may even be able to get rid of the numeric weights. The three big pool candidate tables (pool candidate search, talent placement, screening and assessment) should be using shared logic for sorting and naming category.

🕵️ Details

https://github.com/GCTC-NTGC/gc-digital-talent/issues/10901#issuecomment-2225733446

📋 Steps to Reproduce

  1. Do a "CI seed" to get a mostly empty database
  2. Create a "regular user" who is a citizen with no veteran or priority status.
  3. Have the regular user apply to the CMO pool
  4. Create a "special user" who is not a citizen but claims veteran and priority status.
  5. Have the special user apply to the CMO pool
  6. Login as an admin and view the two pool candidates in the CMO pool
  7. Try accepting and rejecting the veteran and priority claims on the special user to observer category naming and sorting
  8. Compare the three pool candidate tables

📸 Screenshot

image

🙋‍♀️ Proposed Solution

  1. Align all three table queries on the same backend sorting logic for category
  2. Return a localized enum for the category from the same backend logic that is driving the sorting
  3. Remove numeric weight column from database? Refactor to a dynamically updated enum? What does this do to the orderByClaimVerification scope?
  4. Ensure that the backend logic for category properly handles claim verficiation
  5. Fix any bugs found in that logic, eg "fallback to citizen"
  6. Write some phpunit tests around this
  7. Delete any frontend code for calculating effective category sort or name

✅ Acceptance Criteria

vd1992 commented 3 months ago

Just to make sure your findings aren't lost @petertgiles This can be used to refine and create an issue to work on or edited as needed

petertgiles commented 3 months ago

I'm less confident about this plan for the "screening and assessment plan" kanban board due to the unusual "sort of paginated" nature. Maybe we scope that one out?

vd1992 commented 3 months ago

Seems reasonable to me, might not work having a unified query including that board/page

brindasasi commented 3 months ago

This issue needs more through reviewing with @vd1992 , @esizer & @Jerryescandon to sort out more stuff.

esizer commented 3 months ago

Things to update:

vd1992 commented 3 months ago

Use verified priority refers to the pool candidate fields, avoid drawing from the user model. As a clarification