Skip to content

Conversation

@nishika26
Copy link
Collaborator

@nishika26 nishika26 commented Apr 15, 2025

Summary

Target issue is #141
Explain the motivation for making this change. What existing problem does the pull request solve?

This pull request refactors the onboarding process endpoint by integrating it with the existing create_organization, create_project, create_user, and create_api_key functions from the app.crud module. Previously, obtaining an API key required interacting with multiple API endpoints, and users also needed to be superusers to access those endpoints. With this update, the process has been streamlined, allowing users to obtain an API key directly through the onboarding flow.

Additionally, the generated API key can be used for authentication once the is_superuser flag is updated from False to True in the database


This pull request introduces a new feature to the main branch of the ProjectTech4DevAI/ai-platform repository, originating from the feature/onboarding branch. The primary focus of this update is the addition of a unified API call for user onboarding.

Key changes include:

  1. API Configuration: The main.py file in the backend/app/api directory has been updated to include an onboarding router, integrating the new onboarding functionalities into the existing API structure.

  2. Onboarding Endpoint: A new FastAPI endpoint has been added in the backend/app/api/routes/onboarding.py file. This endpoint facilitates the onboarding process by managing the creation of organizations, projects, users, and API keys. It includes checks for existing entities and implements basic error handling. However, there are noted areas for potential improvement in terms of clarity, security, and robustness.

  3. CRUD Package Update: The __init__.py file in the backend/app/crud directory has been modified to expose new functionalities related to organizations, projects, and API keys. This is achieved by importing the necessary functions from their respective submodules, enhancing the CRUD operations available in the application.


This pull request introduces a new feature to the ai-platform repository, specifically targeting the onboarding process. The changes are made in the feature/onboarding branch and are intended to be merged into the main branch. The key updates include:

  1. API Configuration: The main.py file in the API configuration has been updated to include a new onboarding router.

  2. Onboarding Endpoint: A new FastAPI endpoint has been added in the onboarding.py file. This endpoint facilitates the onboarding process by handling the creation of organizations, projects, users, and API keys. It includes checks for existing entities and implements basic error handling. However, there are noted areas for potential improvement in terms of clarity, security, and robustness.

  3. CRUD Operations: The __init__.py file in the CRUD directory has been updated to import new CRUD operations for organization, project, and API key modules.

These changes aim to streamline the onboarding process by providing a unified API call, enhancing the overall functionality of the platform.


This pull request, titled "Onboarding: Unified API call," is aimed at merging changes from the feature/onboarding branch into the main branch of the ProjectTech4DevAI/ai-platform repository. The specific file changes or modifications are not detailed in the provided summaries.

@nishika26 nishika26 self-assigned this Apr 15, 2025
@nishika26 nishika26 moved this to In progress in Kaapi-dev Apr 15, 2025
@nishika26 nishika26 requested review from AkhileshNegi, avirajsingh7, jerome-white and sourabhlodha and removed request for AkhileshNegi April 15, 2025 18:58
@codecov
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 98.26087% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/app/models/organization.py 50.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kody-ai
Copy link

kody-ai bot commented Apr 15, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

1 similar comment
@kody-ai
Copy link

kody-ai bot commented Apr 15, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@kody-ai
Copy link

kody-ai bot commented Apr 18, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@kody-ai
Copy link

kody-ai bot commented Apr 19, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@kody-ai
Copy link

kody-ai bot commented Apr 19, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@kody-ai
Copy link

kody-ai bot commented Apr 19, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@kody-ai
Copy link

kody-ai bot commented Apr 19, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@AkhileshNegi AkhileshNegi linked an issue Apr 23, 2025 that may be closed by this pull request
@kody-ai
Copy link

kody-ai bot commented Apr 23, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@kody-ai
Copy link

kody-ai bot commented Apr 23, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@kody-ai
Copy link

kody-ai bot commented Apr 23, 2025

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

@kody-ai
Copy link

kody-ai bot commented Apr 24, 2025

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Security
Code Style
Kody Rules
Refactoring
Error Handling
Maintainability
Potential Issues
Documentation And Comments
Performance And Optimization
Breaking Changes

Access your configuration settings here.

Comment on lines 98 to 103
return {
"organization_id": organization.id,
"project_id": project.id,
"user_id": user.id,
"api_key": api_key_public.key,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not use the standard API response type?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it common practice to include DB calls within the routes? I thought this was what the CRUD module was for. @AkhileshNegi what are your thoughts?

@kody-ai
Copy link

kody-ai bot commented May 2, 2025

Your trial has ended! 😢

To keep getting reviews, activate your plan here.

Got questions about plans or want to see if we can extend your trial? Talk to our founders here.😎

@nishika26 nishika26 removed the request for review from sourabhlodha May 2, 2025 07:26
@nishika26 nishika26 merged commit bde9d2c into main May 2, 2025
2 checks passed
@nishika26 nishika26 deleted the feature/onboarding branch May 2, 2025 07:32
@github-project-automation github-project-automation bot moved this from In progress to Closed in Kaapi-dev May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Onboarding: Process Flow

4 participants