feat: Enhance skill service and technical task submission handling#134
Merged
feat: Enhance skill service and technical task submission handling#134
Conversation
Contributor
RansfordGenesis
commented
Apr 2, 2026
- Updated SkillService to handle role and signup endpoint creation gracefully.
- Modified search_skills method to include image_url in the response.
- Improved TechnicalTaskService to validate user profile before submission.
- Added detailed error messages for task not found and invalid experience.
- Enhanced user activation upon status change to ACCEPTED.
- Updated email templates for password reset and task assignment with improved styling.
- Added tests for project manager validation and skill service response format.
- Implemented error handling for technical task submissions with context.
There was a problem hiding this comment.
Pull request overview
This PR enhances several core services and API schemas around skills, projects, org chart, authentication, and technical task submissions, alongside updating related email templates and tests.
Changes:
- Expands project and org-chart responses/behavior (member team enrichment, org-chart filtering, updated token payload).
- Improves technical task submission validation and error messaging, and updates skill search responses to include
image_url. - Updates email templates styling and adds/updates tests to cover the new/changed behavior.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/utils.py | Updates experience-level mapping to use ExperienceLevel enum values. |
| utils/permissions.py | Adds admin bypass for project manager checks; tightens accepted-user gating; introduces additional permission helpers. |
| utils/oauth2.py | Clarifies get_current_user as auth-only and removes inactive redirect logic. |
| utils/email_templates/task_template.html | Refreshes task assignment email styling and content. |
| utils/email_templates/password-reset.html | Refreshes password reset email styling and content. |
| services/user_service.py | Activates users automatically when status changes to ACCEPTED. |
| services/technical_task_service.py | Adds profile validation, improved error messaging, and submission duplicate checks. |
| services/skill_service.py | Makes role/signup endpoint creation in populate_skills best-effort; adds image_url to search results. |
| services/project_service.py | Adds member team enrichment and changes create/update/get flows to return enriched members. |
| services/org_chart_service.py | Adds optional active/accepted filtering for org chart reads and introduces filtered tree builder. |
| services/auth_service.py | Includes role in login token response. |
| db/repository/users.py | Defaults role_id on user creation; adjusts active-directory/applicant filtering logic. |
| db/repository/projects.py | Ensures join-table cleanup when deleting projects (memberships/stacks/skills). |
| db/repository/org_chart.py | Adds optional active/accepted filtering for roots and direct subordinate queries. |
| api/routes/project.py | Enriches paginated project list items with member team. |
| api/api_models/user.py | Adds status and is_active to OrgChartNode; adds role to Token. |
| api/api_models/technical_task.py | Makes submission base fields optional; adds nested minimal user/task/stack models to submission response. |
| api/api_models/projects.py | Adds member-with-team response schema and includes manager in ProjectResponse. |
| test/test_technical_task_submissions.py | Adds service/error-handling and response-shape tests for task submissions. |
| test/test_skill_service_response.py | Adds tests asserting skill search response includes image_url. |
| test/test_projects.py | Updates authorization tests for add/remove member endpoints. |
| test/test_project_manager_validation.py | Adds tests for manager validation and update payload handling. |
| test/test_profile_page.py | Adjusts directory-related test setup to set user status to ACCEPTED. |
| test/test_org_chart.py | Adjusts org chart tests to ensure users are ACCEPTED before querying. |
| scripts/url_mapping.json | Removes large URL mapping JSON file from the repo. |
Comments suppressed due to low confidence (1)
utils/utils.py:47
get_key_by_valuereturnsNonewhen the years-of-experience value is out of the supported ranges. Downstream code (e.g.,TechnicalTaskService.create_submission) now expects invalid experience to raise an error, so this will silently propagateNoneand typically turn into a misleading “task not found” 404 instead of a 400 validation error. Consider raisingValueError(or returning a sentinel) when the value is not mapped, and include the valid ranges in the message.
def get_key_by_value(value):
# Map years of experience to ExperienceLevel enum values
from utils.enums import ExperienceLevel
experience_level_map = {
ExperienceLevel.JUNIOR.value: [0, 1, 2],
ExperienceLevel.MID_LEVEL.value: [3, 4],
ExperienceLevel.SENIOR.value: [5, 6, 7, 8, 9, 10, 11, 12]
}
for key, values in experience_level_map.items():
if value in values:
return key
return None
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…s and project permissions
TMCreme
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.