Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement]: Add 'app_type' column for AppDB model with updated API responses #1994

Merged
merged 35 commits into from
Nov 22, 2024

Conversation

aybruhm
Copy link
Member

@aybruhm aybruhm commented Aug 16, 2024

Description

This PR introduces a new app_type column in the AppDB model and updates the corresponding API responses. The changes include defining an AppType enum, specifying the enum type for the app_type column, and updating the backend to properly handle and return the new app type in API responses. Additionally, a schema migration script has been generated and applied using Alembic.

Related Issue

Closes AGE-540

Sibling PRs

Changes Included:

  • Added the AppType enum and extended support for other app types.
  • Updated the AppDB model to include the app_type column.
  • Modified the create_app_and_envs and app_type_from_template functions to support the new enum.
  • Applied a schema migration script to reflect the updated app_type column.

What to QA

  • Creating Apps:
    • Create an app via the UI and ensure it includes the correct app_type.
    • Create an app via the CLI and check that the app_type is correctly reflected (should be set to 'custom').
  • Database Migration:
    • Verify that the schema migration was applied successfully and the app_type column has been added with the correct enum type.

Acceptance Tests

  1. UI-based Tests:
    • Create an app from both templates in the UI and check that the app_type is correctly reflected in the playground.
  2. CLI-based Tests:
    • Create an app via the CLI and verify that the app_type is correctly set to 'custom' and the app works as expected.
  3. Schema Validation:
    • Check the database schema to confirm that the app_type column is added to the app_db table and mapped correctly with the enum type.

…pe enum with RAG, and update App API response
- Create DB function to get 'app_type' from template
- Update DB function 'create_app_and_envs' to include 'app_type'
Copy link

vercel bot commented Aug 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agenta ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 4:41pm
agenta-documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 4:41pm

@aybruhm aybruhm requested a review from mmabrouk August 16, 2024 07:04
@aybruhm aybruhm marked this pull request as ready for review August 16, 2024 07:06
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Backend CLI enhancement New feature or request labels Aug 16, 2024
Copy link
Contributor

@jp-agenta jp-agenta left a comment

Choose a reason for hiding this comment

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

@aybruhm @mmabrouk -- Left some notes here.

agenta-backend/agenta_backend/models/shared_models.py Outdated Show resolved Hide resolved
agenta-backend/agenta_backend/services/db_manager.py Outdated Show resolved Hide resolved
…atest migration head

- Refactored the migration check to compare the current database migration head against the latest migration script head.
- Enhanced `get_current_migration_head_from_db` to ensure only one migration head is tracked.
- Updated logic in `get_pending_migration_head` to reduce unnecessary checks and handle first-time setup more efficiently.
- Improved error handling and clarified logging messages for better debugging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend CLI enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants