Skip to content

Conversation

@aniket132123
Copy link
Member

@aniket132123 aniket132123 commented Nov 21, 2025

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Ran tests that check whether the promoter has proper perms, if lab manager to be promoted actually exists, and a variety of other tests to ensure integrity of the route. I also fixed some of the previous tests.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (if a larger change)
  • New and existing unit tests pass locally with my changes

@deepsource-io
Copy link

deepsource-io bot commented Nov 21, 2025

Here's the code health analysis summary for commits b50d415..2009d36. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython❌ Failure
❗ 1 occurence introduced
🎯 1 occurence resolved
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

Copy link
Member

@RafaelCenzano RafaelCenzano left a comment

Choose a reason for hiding this comment

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

Some general comments, overall things look good. Also there some ruff linting issues. You can fix these with ruff lint to view the mistakes, ruff lint --fix can resolve some and ruff format as well. Most are lines too long easy enough to just wrap lines around. Also since the pytest github action isn't working, can you confirm your new local tests are working?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a Lab Manager promotion feature and fixes several existing tests. The promotion feature allows super admins to promote users to Lab Manager status by updating their management permissions.

  • Added new promotion endpoint for super admins to promote users to Lab Manager
  • Updated test suite with comprehensive promotion tests and fixed existing test data
  • Modified serializers and route responses to return structured data instead of strings

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/test_manager_promotion.py New test suite for user promotion feature with fixtures and comprehensive test cases
tests/test_general.py Fixed test data, removed obsolete discover test, updated years list, and added JWT authentication to profile test
tests/test_departments.py Updated test assertions to match corrected spelling, field names, and data structures
tests/test_authentication.py Uncommented imports for future test development
tests/conftest.py Disabled JWT CSRF protection for testing environment
labconnect/serializers.py Changed serialize_course to return dictionary instead of formatted string
labconnect/main/routes.py Updated departments endpoint to return more fields with standardized field names
labconnect/main/auth_routes.py Added new promotion endpoint with permission checks and validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@RafaelCenzano RafaelCenzano left a comment

Choose a reason for hiding this comment

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

Looks good few small comments. Also check the ruff linting errors besides that should be good to go.

Copy link
Member

@RafaelCenzano RafaelCenzano left a comment

Choose a reason for hiding this comment

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

LGTM

@aniket132123 aniket132123 merged commit f5cd6dc into LabConnect-RCOS:main Dec 11, 2025
2 of 4 checks passed
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.

2 participants