Commit Graph

44 Commits

Author SHA1 Message Date
dal f363caa7a7
middle of working on data metadata stuff 2025-04-03 11:42:30 -06:00
dal 8ccfb0d302
new prd, migration, etc. 2025-04-01 21:41:01 -06:00
dal d5bd1d2ab4
list chat improvements 2025-04-01 13:25:17 -06:00
dal df341a0ac5
Merge branch 'evals' into api_search_rest_endpoint 2025-03-25 14:31:07 -06:00
dal 22322f0711
search functionality 2025-03-25 14:31:02 -06:00
dal 60e54d0257
restore chat assets 2025-03-25 12:55:39 -06:00
dal f5a239f615
added in the message and chat updates 2025-03-20 16:13:02 -06:00
dal 3b959b272a
Implement metric-dashboard association
- Create migration for metric_files_to_dashboard_files association table
- Add MetricFileToDashboardFile model to database/models.rs
- Implement functions to extract metric IDs from dashboards
- Add logic to maintain associations when dashboards are updated
- Add logic to create associations when dashboards are created
- Create integration test for the feature
- Create PRD for the metric-dashboard association feature

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-20 12:06:08 -06:00
dal e9fc5cf9bb
added version history 2025-03-11 15:55:30 -06:00
dal 70121cc629
asset permissions progress 2025-03-11 15:09:19 -06:00
dal 47e1558e2e
ok all is good on the western front 2025-03-07 09:19:47 -07:00
dal 95e3dcfe80
added in the asset sharing permissions and adjusted the existing logic 2025-03-06 16:46:18 -07:00
dal bba0e30b67
added in the user avatar url 2025-03-05 13:22:01 -07:00
dal 4730b78284
commit up update user 2025-03-04 13:09:54 -07:00
dal dc0c316051
update to db and new seed. 2025-03-04 11:51:05 -07:00
dal e5f25a6356
some updates to better align with types 2025-03-04 10:47:16 -07:00
dal fdc4f3b2f1
builds and moved things around 2025-02-28 14:22:55 -07:00
dal 3fec82953c
switched the way we get secrets to be simpler 2025-02-28 12:45:53 -07:00
dal 6604b9789e
updates for chats instead of threads 2025-02-28 09:41:44 -07:00
dal 751a2da463
Merge branch 'staging' into big-nate/bus-939-create-new-structure-for-chats 2025-02-14 15:22:58 -08:00
dal a59e9a26c2
Remove redundant foreign key constraints and joinables for messages_to_files 2025-02-14 13:32:50 -07:00
dal 743c256dbc
added in some testing work and changed some rules 2025-02-14 11:32:33 -07:00
dal 51b6d00159
message fkey error still propagating. 2025-02-14 08:32:06 -07:00
dal 641527114c
refactor(agent): Enhance LLM request handling with improved tool call processing
- Add support for initial non-tool response and subsequent tool-enabled processing
- Implement `PendingToolCall` to manage incremental tool call updates
- Update `Delta` and related types to support more flexible tool call streaming
- Modify agent stream processing to handle tool calls with improved state management
- Add robust handling for tool call deltas and function call arguments
2025-02-10 07:17:14 -07:00
dal 4ec6e78648
refactor(database): Update metric and dashboard file models and migrations
- Rename file type modules from `metric_file` and `dashboard_file` to `metric_yml` and `dashboard_yml`
- Modify metric files migration to use a verification enum instead of boolean
- Update messages_to_files junction table with UUID primary key and additional timestamp columns
- Adjust database models to support new file and message structures
- Refactor file creation utility to use new model structures
2025-02-06 17:07:52 -07:00
dal 33d5990907
feat(datasets): Add database_identifier support for dataset creation and deployment
- Extend Dataset model and schema to include optional database_identifier field
- Update dataset creation and deployment routes to handle new database_identifier parameter
- Modify dataset DDL generation to use database_identifier for schema resolution when available
2025-02-06 15:18:40 -07:00
dal 22d75ae0b6
refactor: Update messages table schema and database references
- Renamed existing messages table to `messages_deprecated`
- Created new `messages` table with updated schema and additional indexes
- Updated Diesel schema to reflect new table structure and relationships
- Added new foreign key constraints for threads and users
- Prepared for migration of existing message data
2025-01-28 12:03:11 -07:00
dal 9624bc33ad
feat: Add file junction table and update database schema
- Created `messages_to_files` junction table to link messages with dashboard and metric files
- Added foreign key constraints and indexes for efficient file-message relationships
- Updated Diesel schema to include new `messages_to_files`, `dashboard_files`, and `metric_files` tables
- Removed unnecessary timestamp triggers from migration files
2025-01-28 11:21:51 -07:00
dal f1879dc15c
new tables 2025-01-28 09:57:40 -07:00
dal e190ff9a14
I apolog 2025-01-28 08:29:43 -07:00
dal af7e969af8
fix permission check on post_dataset rest (#59)
* fix permission check on post_dataset rest

* refactor: enhance dataset overview access lineage and permission checks

- Updated the `get_dataset_overview` function to conditionally add default access lineage based on user roles and existing access paths.
- Simplified the logic for adding user roles to the lineage, ensuring clarity and maintainability.
- Improved handling for the `RestrictedQuerier` role to include checks for existing access before adding default lineage, enhancing permission accuracy.
- Streamlined code by removing redundant checks and consolidating role handling, optimizing overall readability.

* feat: Enhance permission group handling and data retrieval

- Introduced a new `PermissionGroupInfo` struct to encapsulate detailed information about permission groups, including user and dataset counts.
- Updated the `get_permission_group` and `list_permission_groups` functions to improve data retrieval and error handling.
- Refactored SQL queries in `list_permission_groups` to include additional joins for counting users and datasets associated with permission groups, enhancing the overall functionality and clarity of the API.
- Streamlined code for better readability and maintainability, ensuring consistent handling of user and permission group data.

* refactor: Improve dataset access handling and permission checks

- Enhanced the `get_restricted_user_datasets` and `get_restricted_user_datasets_with_metadata` functions to include additional permission checks for dataset groups and permission groups.
- Consolidated SQL queries to ensure proper filtering of deleted records and improved clarity in dataset retrieval logic.
- Introduced new joins and filters to handle dataset group permissions, ensuring accurate access control for users.
- Streamlined code for better readability and maintainability, enhancing overall functionality in dataset access management.

* fix: Update SQL migration and seed data for user attributes

- Modified the SQL migration to specify the schema for the `users` table, ensuring clarity in the update statement.
- Adjusted the seed data for `users_to_organizations` to change the `organization_id` from 'public' to 'none', reflecting a more accurate state for user roles and organization associations.
- Ensured consistency in the formatting of SQL insert statements for better readability.

* fix: Prevent users from updating their own profiles

- Added a check in the `update_user_handler` to prevent users from updating their own information, returning an error if they attempt to do so.
- This change enhances security by ensuring that users cannot modify their own records, which could lead to unauthorized changes.

* refactor: Simplify dashboard permission queries by removing team-based joins

- Removed left joins with `teams_to_users` table in dashboard permission queries
- Simplified permission checks to only filter by direct user ID
- Updated queries in `get_user_dashboard_permission`, `get_bulk_user_dashboard_permission`, and `list_dashboards_handler`
- Streamlined SQL query logic for more direct and efficient permission checks
2025-01-23 15:22:07 -08:00
dal 71c234aa4b
feat: Add DatasetToDatasetGroup model and update schema
- Introduced a new `DatasetToDatasetGroup` struct to represent the relationship between datasets and dataset groups, including fields for timestamps and optional deletion.
- Updated the database schema to include `updated_at` and `deleted_at` fields for the `datasets_to_dataset_groups` table, enhancing data tracking capabilities.
- Refactored the routing in `mod.rs` to include a nested router for assets, improving the organization of dataset group routes.
2025-01-21 11:53:47 -07:00
dal ef5ca25810
feat: Add organization_id to DatasetGroupPermission and update dataset group handler
- Introduced a new `organization_id` field in the `DatasetGroupPermission` struct to associate permissions with specific organizations.
- Updated the `put_dataset_groups_handler` to include `organization_id` when creating or updating dataset group permissions, enhancing the API's capability to manage permissions at the organizational level.
- Improved SQL query formatting for better readability in the handler.
2025-01-21 10:23:22 -07:00
dal b9b5146299
feat: Add DatasetGroupPermission model and schema
- Introduced a new `DatasetGroupPermission` struct in `models.rs` to represent permissions associated with dataset groups.
- Updated the database schema in `schema.rs` to include the `dataset_groups_permissions` table, defining its structure and relationships.
- Modified the `is_user_workspace_admin_or_data_admin` function in `checks.rs` to correctly reference the user's organization role, enhancing role validation logic.
2025-01-20 15:24:34 -07:00
dal 3bc148927f
feat: Add assets module and nest routes in user router
- Introduced a new `assets` module to handle asset-related routes.
- Updated the user router to nest the `assets` routes under the user ID path, enhancing the organization of API endpoints.
- This change improves the structure and maintainability of the user-related routes in the API.
2025-01-20 14:41:31 -07:00
dal acdb260cb4
Refactor user update route to enhance RESTful practices
- Updated the user update route to require a user ID in the URL, ensuring the correct user is updated based on the provided ID.
- Improved clarity and functionality of the `update_user` function by extracting the user ID from the path.

These changes align the user update endpoint with standard REST conventions, enhancing overall API usability.
2025-01-16 08:57:59 -07:00
Nate Kelley c6de0e5bc8
Merge branch 'staging' into big-nate/bus-891-reorganize-and-redo-permissions-tabs 2025-01-10 10:33:49 -07:00
dal fd54b4724d
Update team role handling in migration script to include 'admin' as 'manager' and default to 'member'
- Modified the role adjustment logic in the teams_to_users table to treat 'admin' roles as 'manager'.
- Set the default role to 'member' for all other cases, improving clarity in role assignments.

These changes enhance the migration process for dataset groups and permissions management.
2025-01-09 17:35:54 -07:00
dal 43abb0321e
Refactor dataset deployment logic and enforce unique constraints
- Updated the SQL migration to enforce a unique constraint on the combination of `database_name` and `data_source_id` in the datasets table, ensuring data integrity.
- Refactored the `deploy_datasets_handler` to separate datasets with and without IDs, allowing for concurrent upsert operations based on their presence.
- Enhanced the upsert logic to handle datasets more efficiently, improving performance during dataset deployment.

These changes improve the robustness and efficiency of the dataset deployment process within the API.
2025-01-09 13:05:54 -07:00
dal 79b3df107d
Add support for YAML-based dataset deployment and enhance dataset structures 2025-01-09 11:57:56 -07:00
dal c74016d3bd
Add yml_file field to Dataset model and related API structures
- Introduced a new optional `yml_file` field in the Dataset model to store YAML file references.
- Updated the database schema to include the `yml_file` column in the datasets table.
- Modified various API request and response structures to accommodate the new `yml_file` field.
- Enhanced dataset handling functions to support the inclusion of `yml_file` in dataset operations.

These changes improve the dataset management capabilities by allowing the association of YAML files with datasets, facilitating better data organization and retrieval.
2025-01-08 22:33:14 -07:00
dal 82876e70f4 Add dataset_groups and dataset_permissions tables with organization_id references
- Created dataset_groups and dataset_permissions tables in the database schema, including organization_id as a foreign key with ON DELETE CASCADE.
- Added corresponding indexes for organization_id in both tables to optimize query performance.
- Updated the Rust models and schema to reflect the new tables and their relationships.
- Integrated dataset_groups into the API routes for improved data organization and management.

These changes enhance the database structure and facilitate better handling of dataset-related permissions and groupings.
2025-01-08 12:56:14 -07:00
dal dcfaa43e9e Refactor user organization roles and enhance database schema
- Updated the UserOrganizationRole enum to include new roles: WorkspaceAdmin, DataAdmin, Querier, RestrictedQuerier, and Viewer, replacing the previous roles of Owner, Member, and Admin.
- Modified the TeamToUserRole enum to change the Owner role to Manager.
- Added new database tables for dataset_groups, dataset_permissions, datasets_to_dataset_groups, and permission_groups_to_users to support enhanced data management.
- Introduced UserOrganizationStatusEnum to the schema for better organization status tracking.

These changes improve role management and expand the database schema for better data organization and permissions handling.
2025-01-08 10:53:29 -07:00
dal bdc3c10712 Brought in the bi-api 2025-01-03 14:32:54 -07:00