Commit Graph

182 Commits

Author SHA1 Message Date
Nate Kelley 23411f25c6
report editor updates 2025-08-11 13:40:01 -06:00
dal 9156e7a06e
merge staging 2025-08-08 13:17:58 -06:00
Nate Kelley 51f896d19e
Add title skeletons 2025-08-07 23:24:28 -06:00
Nate Kelley 0969a1cbd3
Merge branch 'staging' into cursor/add-report-menu-options-and-stub-functions-e636 2025-08-07 17:22:18 -06:00
Nate Kelley 216e610aa8
Added some additional safe parse element stuff 2025-08-07 17:21:38 -06:00
dal 8c8d1f37cc
big migration of tools 2025-08-07 17:10:24 -06:00
Nate Kelley 75950ae108
super nested list items 2025-08-07 17:01:45 -06:00
dal 468cf44cca
done tool 2025-08-07 16:36:01 -06:00
dal 91290530ba
tons of changes 2025-08-07 16:09:45 -06:00
dal 8e624a2c50
fixing migrations 2025-08-07 15:57:01 -06:00
Nate Kelley 4006852efa
Add comment to content 2025-08-07 14:12:32 -06:00
Nate Kelley 40a44cf1f9
Merge branch 'staging' into dallin-bus-1589-create-and-modify-report-tools 2025-08-07 14:05:44 -06:00
Nate Kelley 9ba4750a65
Adjust add metric modal 2025-08-05 17:05:27 -06:00
dal ba1da07473
Add new report content manipulation functions
Introduce 'replace-report-content' and 'append-report-content' exports to enhance report content management capabilities, allowing for more flexible report updates and modifications.
2025-08-05 14:30:22 -06:00
dal a26242c46d
Enhance report handling by integrating markdown to PlateJS conversion in the report retrieval process, improving content formatting and error handling. Update report update schema to accept string content for markdown streaming. 2025-08-05 12:02:40 -06:00
dal b8ad52cf28
change the schema content to be text for markdown streaming 2025-08-05 11:38:43 -06:00
Nate Kelley 1ef0d18c61
Report playground updates for fixed toolbar 2025-08-05 10:15:22 -06:00
Nate Kelley 44787f5478
Add additional asset queries 2025-08-04 22:13:09 -06:00
Nate Kelley 124523ade9
add a version number to reports 2025-08-04 21:37:23 -06:00
Nate Kelley 4a6c36c4b0
update report version logic 2025-08-04 21:10:03 -06:00
Nate Kelley 43af5fdb4d
add a fix for broken migrate 2025-08-04 20:45:30 -06:00
Nate Kelley c6834bdfeb
update 2025-08-04 18:20:06 -06:00
Nate Kelley 87ea87e963
collection and assets queries 2025-08-04 16:45:49 -06:00
Nate Kelley 1a955d786b
Get report 2025-08-04 15:25:22 -06:00
Nate Kelley b3b759bd26
addded collection query 2025-08-04 15:20:15 -06:00
Nate Kelley ddff671040
Update get report 2025-08-04 15:13:21 -06:00
Nate Kelley a3198003a3
get report 2025-08-04 15:05:18 -06:00
Nate Kelley 5f6524581b
created list database query 2025-08-04 14:21:49 -06:00
Nate Kelley aae819e151
create new schema for reports 2025-08-04 14:03:52 -06:00
Nate Kelley fad6670e83
fix type assertion
added safe guards around report_fule

pass generics through

fix list pass throughs
2025-08-04 10:06:59 -06:00
dal 273fbc36c4
fix: address non-critical PR review comments
- Optimized N+1 query in get-permissioned-datasets.ts using inArray for batch lookup
- Removed unused bulkRemoveAssetPermissions import
- Fixed import organization in find-user-by-email.ts
- Updated CLAUDE.md to reflect tests are written and fixed API example
- Clarified TODO comment in lookup.ts to prevent potential infinite recursion

These are style and performance improvements that don't affect functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:29:02 -06:00
dal 2e04af1785
fix: address additional critical PR review comments
- Fixed permission hierarchy: full_access (5) now correctly ranks higher than viewer (3)
- Removed 'querier' role from admin permission check as it was too permissive
- Added organizationId parameter to dashboard access checks to prevent unauthorized access
- Fixed public dashboard expiry date check to verify dates are in the future
- Added cycle detection for collection permissions to prevent infinite recursion
- Fixed bulk remove permissions to correctly filter by identityIds array
- Updated date comparison to use ISO string format for PostgreSQL timestamp columns

These fixes address critical security and logic issues identified in the PR review.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:28:58 -06:00
dal d078830a18
fix: address PR review comments for access control migration
- Fixed AssetTypeSchema to include all active asset types (excluding deprecated 'metric' and 'dashboard')
- Added missing 'restricted_querier' role to UserOrganizationRole type
- Fixed dataset access caching to store full result object including accessPath and userRole
- Updated count query to use SQL COUNT for better performance
- Fixed IdentityType consistency across dataset permissions
- Removed unused 'ne' import from list-asset-permissions.ts
- Updated comments to correctly reference 6 access paths instead of 5

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-29 12:28:52 -06:00
dal 4bef4205f3
feat(access-controls): migrate Rust access control libraries to TypeScript
This PR migrates the Rust  and  libraries to TypeScript in the new  package.

## Changes

### New Access Controls Package
- Implemented complete asset permissions system with CRUD operations
- Added dataset permissions with all 5 access paths (admin, direct user, user→group, team→direct, team→group, org→default)
- Implemented cascading permissions (metrics inherit from dashboards/chats/collections)
- Added LRU caching to replace Redis (30-second TTL)
- Comprehensive test coverage (148 tests passing, 3 skipped pending createUser)

### Database Package Updates
- Fixed AssetType enum to include all 14 asset types
- Added missing database queries for permissions
- Fixed timestamp fields to use ISO strings
- Added getUserOrganizationsByUserId function
- Created organized query structure by table

### AI Package Updates
- Updated getPermissionedDatasets API calls to new format
- Changed property references from ymlFile to ymlContent
- Fixed all test mocks to match new API structure

### Trigger App Updates
- Updated to use new access controls API
- Fixed test mocks to match DatasetListResult structure
- Added proper type imports

### Server Shared Updates
- Added request/response types for access control endpoints
- Exported types for API consistency

## Testing
- All packages build successfully with turbo build:dry-run
- All tests pass with turbo test:unit
- Full type safety maintained throughout

## Migration Notes
- Drop-in replacement for Rust libraries
- Same permission model and roles
- Cache invalidation strategies implemented
- Soft delete pattern maintained

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-28 10:17:35 -06:00
dal 2833c6bb0c
dry run 2025-07-25 18:29:35 -06:00
dal 1f52bd9b69
Enhance asset chat handling by introducing `handleAssetChatWithPrompt` for processing user prompts alongside asset imports. Update `createChatHandler` to manage asset-only and asset+prompt scenarios, ensuring correct message order and preventing unnecessary analyst task triggers. Add tests for new functionality and refactor related services for improved clarity and maintainability. 2025-07-25 12:47:01 -06:00
Nate Kelley 5e6eb76f5b
move get asset types around 2025-07-24 17:41:36 -06:00
Nate Kelley b2cf1725fc
Merge branch 'staging' into devin/BUS-1494-1753276227 2025-07-24 17:21:04 -06:00
Nate Kelley e6d4062847
Merge branch 'staging' into big-nate/bus-1483-quick-win-for-filter-dashboard-drill-downexplore-metric 2025-07-23 22:45:54 -06:00
Nate Kelley df3533ffc7
pass in better props 2025-07-23 17:18:45 -06:00
dal 482564528a
lint fixes 2025-07-23 16:56:32 -06:00
dal 42d1da5389
context fixes on messages 2025-07-23 16:56:06 -06:00
Devin AI 5b40205275 Implement /api/v2/title endpoint for BUS-1494
- Add server-shared types for GetTitleRequest and GetTitleResponse with Zod validation
- Create database query functions for each asset type (chat, metric, collection, dashboard)
- Implement GET endpoint with zValidator middleware and exhaustive switch statement
- Add proper permission checks (publiclyAccessible OR organizationId match)
- Export new functions from database query index files
- Add title route to v2 API index
- Follow existing Hono API patterns with standardErrorHandler

Co-Authored-By: nate@buster.so <nate@buster.so>
2025-07-23 13:14:58 +00:00
Nate Kelley 8ee892bf2a
Use tsx and .ts files for validation 2025-07-21 16:07:14 -06:00
Cursor Agent c1c7b37942 Add centralized environment variable management with env-utils package
Co-authored-by: natemkelley <natemkelley@gmail.com>
2025-07-21 21:14:50 +00:00
dal 254e7fc462
default db conn to local when none present 2025-07-21 01:51:33 -06:00
dal ec4262b87c
ci and a random lint 2025-07-21 00:28:39 -06:00
Devin AI 9b9330982a fix: address PR review comments for GitHub integrations
- Make installationId and githubOrgId NOT NULL (required GitHub API fields)
- Change user foreign key to ON DELETE SET NULL to prevent blocking user deletion
- Add index on github_org_id for better query performance
- Maintain unique constraint on organization_id + installation_id pair

Addresses greptile-apps review comments on PR #574

Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
2025-07-21 05:59:39 +00:00
Devin AI 45749b881b fix: replace manual migration with properly formatted Drizzle migration
- Remove manual migration and use proper Drizzle format
- Update journal metadata to track migration 0084
- Follow exact pattern from auto-generated migrations
- Maintain all GitHub integrations table functionality

Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
2025-07-21 05:49:00 +00:00
Devin AI 6bc6602028 feat: add GitHub integrations table and migration
- Add githubIntegrationStatusEnum with states: pending, active, suspended, revoked
- Add githubIntegrations table with GitHub App architecture fields:
  - installationId, appId for GitHub App integration
  - githubOrgId, githubOrgName for GitHub organization info
  - tokenVaultKey, webhookSecretVaultKey for secure token storage
  - repositoryPermissions JSONB field for access control
- Add foreign key constraints to organizations and users tables
- Add indexes for organizationId and installationId for query performance
- Add unique constraints for tokenVaultKey and org-installation pairs
- Create migration 0084_github_integrations.sql following Drizzle pattern

Implements BUS-1462: GitHub integrations table for tracking GitHub App integrations

Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
2025-07-21 05:45:51 +00:00
dal 8daceae2e3
Add duplicate message check in slack-agent-task
- Introduced a new function `checkForDuplicateMessages` in the database queries to verify if a message already exists in the same chat.
- Integrated the duplicate check in the `slackAgentTask` to prevent processing of duplicate messages, enhancing task efficiency and logging warnings for duplicates detected.
2025-07-18 22:53:02 -06:00
jacob-buster 40a4276125 Added setup script + few new changes to address {{variable}} issues 2025-07-18 14:11:23 -06:00
Nate Kelley d134c06bb8
theme update is working 2025-07-18 13:42:10 -06:00
Nate Kelley 6b85fd3a33
add additional field to database palette package 2025-07-18 13:16:13 -06:00
Nate Kelley aa34a56f40
override cache for defaults 2025-07-18 13:05:50 -06:00
Nate Kelley ec2a3f6238
Update refiner for palettes 2025-07-18 11:57:54 -06:00
dal 3a43e21718
Merge remote-tracking branch 'origin/staging' into dallin/bus-1380-fix-unit-tests 2025-07-18 08:55:35 -06:00
dal 51da02efbb
update package.json pass if no unit tests 2025-07-17 23:03:54 -06:00
Nate Kelley cde45ad869
key iterations and type fixes 2025-07-17 22:42:12 -06:00
dal ba61b6a3ea
Merge remote-tracking branch 'origin/staging' into dallin/bus-1380-fix-unit-tests 2025-07-17 22:31:32 -06:00
Nate Kelley 9f86f337ff
Merge branch 'staging' into dallin/bus-1419-enable-sharing-of-dashboards-or-collections-with-workspace 2025-07-17 22:13:53 -06:00
Nate Kelley 10e37f07de
update all types to work better together 2025-07-17 18:51:45 -06:00
Nate Kelley 09e4b36bf5
add dictionaries for color schemes 2025-07-17 17:16:15 -06:00
dal cd8a50403f
Merge branch 'staging' into dallin/bus-1419-enable-sharing-of-dashboards-or-collections-with-workspace 2025-07-17 17:16:07 -06:00
dal b6cf6539ea
Merge branch 'origin/staging' into dallin/bus-1380-fix-unit-tests - Resolved conflicts in CLAUDE.md 2025-07-17 16:52:03 -06:00
Nate Kelley d2cd4fb173
create default them component 2025-07-17 16:24:46 -06:00
Nate Kelley 5dd7b20f25
fix broken linting 2025-07-17 13:18:32 -06:00
Nate Kelley b8de7a5c51
update rules 2025-07-17 13:12:11 -06:00
Nate Kelley 1ae52ec603
update package readme for database 2025-07-17 13:06:42 -06:00
dal a0a1e11493
update workspace sharing on all assets 2025-07-17 12:54:02 -06:00
Nate Kelley 7b24d167b9
hex values checking before insert into database 2025-07-17 12:17:34 -06:00
Nate Kelley ee8cce71f8
Add additional error handling for endpoint 2025-07-17 12:06:57 -06:00
Nate Kelley e55632e074
initial commits for update org 2025-07-17 11:41:31 -06:00
Devin AI 96d0d219ee Fix remaining unit test issues in AI and data-source packages
- Fixed AI package unit tests that were previously failing
- Updated database package.json with environment variables for tests
- Fixed snowflake adapter test issues in data-source package

Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
2025-07-17 16:14:57 +00:00
Nate Kelley 5c15664b22
Add new column and rules around type safety 2025-07-17 09:51:48 -06:00
Nate Kelley 06d8c1e568
Merge pull request #527 from buster-so/big-nate/bus-1420-add-searchable-menu-to-share-dropdowns
add searchable menu to share dropdowns
2025-07-16 23:48:44 -06:00
Nate Kelley 39a9dc2b5d
update with or condition 2025-07-16 23:08:28 -06:00
dal da380485d9
added in the slack auto-sharing functionality 2025-07-16 16:54:09 -06:00
dal e4630b5cd7
add default slack sharing permissions 2025-07-16 15:14:16 -06:00
dal d4f216cb66
Merge remote-tracking branch 'origin/staging' into dallin/bus-1363-slack-agent-query-buster-from-slack-direct-query 2025-07-16 12:54:18 -06:00
Nate Kelley bd66820792
Update packages/database/package.json
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-07-16 11:25:10 -06:00
dal 0d217714cc
added slack tracking on chats 2025-07-16 11:15:16 -06:00
Nate Kelley 8fe5e9f906
working tests 2025-07-16 10:36:24 -06:00
Nate Kelley 0f7d1c313d
update rules for database folder 2025-07-16 10:29:10 -06:00
Nate Kelley 0d01dfcb4c
array parter 2025-07-16 09:54:28 -06:00
Nate Kelley 5dc31814d8
Simplify the get user endpoint 2025-07-16 09:32:48 -06:00
Nate Kelley d9ed8b1423
finalize pagination endpoint 2025-07-16 09:25:51 -06:00
Nate Kelley b637bf356a
paginated queries 2025-07-15 23:05:12 -06:00
Nate Kelley fdf70abfb8
update database dev 2025-07-15 22:26:13 -06:00
Nate Kelley 094fc4c251
add pagination type responses 2025-07-15 17:23:32 -06:00
Nate Kelley a9b8acbb80
user to organization method 2025-07-15 16:36:14 -06:00
Nate Kelley 2e73d97ffc
create basic user to organization db 2025-07-15 16:20:40 -06:00
Nate Kelley 74993ca556
change folder name 2025-07-15 16:08:01 -06:00
Nate Kelley f23d933cc1
initial commit to move files 2025-07-15 15:44:26 -06:00
Nate Kelley 727e66a630
Fix files on lint 2025-07-14 14:30:07 -06:00
dal 5a971dd8a1
fix on access-control tests 2025-07-14 11:01:53 -06:00
dal 2be9784516
Add unit and integration test scripts to package.json files across multiple packages 2025-07-14 09:11:20 -06:00
Nate Kelley 963bf6b2f2
fix all of the bugs 2025-07-12 22:14:08 -06:00
Nate Kelley 4197cf799e
Update packages/database/src/connection.ts
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2025-07-12 16:33:33 -06:00
Nate Kelley 139a0f52c9
organization camelcase update 2025-07-12 16:31:35 -06:00