@datarecce/ui 0.1.30 → 0.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.mts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/components.d.mts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/{index-BNUP2V_N.d.ts → index-B9lSPJTi.d.ts} +184 -2
- package/dist/index-B9lSPJTi.d.ts.map +1 -0
- package/dist/{index-DOPZuhD8.d.mts → index-IIXVIoOL.d.mts} +253 -71
- package/dist/index-IIXVIoOL.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +4 -0
- package/dist/theme.d.mts +2 -185
- package/dist/theme.d.ts +2 -185
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +4 -2
- package/recce-source/.editorconfig +26 -0
- package/recce-source/.flake8 +37 -0
- package/recce-source/.github/ISSUE_TEMPLATE/bug_report.yml +67 -0
- package/recce-source/.github/ISSUE_TEMPLATE/custom.md +10 -0
- package/recce-source/.github/ISSUE_TEMPLATE/feature_request.yml +42 -0
- package/recce-source/.github/PULL_REQUEST_TEMPLATE.md +21 -0
- package/recce-source/.github/copilot-instructions.md +331 -0
- package/recce-source/.github/instructions/backend-instructions.md +541 -0
- package/recce-source/.github/instructions/frontend-instructions.md +317 -0
- package/recce-source/.github/workflows/build-statics.yaml +72 -0
- package/recce-source/.github/workflows/bump.yaml +48 -0
- package/recce-source/.github/workflows/integration-tests-cloud.yaml +92 -0
- package/recce-source/.github/workflows/integration-tests-sqlmesh.yaml +33 -0
- package/recce-source/.github/workflows/integration-tests.yaml +52 -0
- package/recce-source/.github/workflows/nightly.yaml +246 -0
- package/recce-source/.github/workflows/release.yaml +196 -0
- package/recce-source/.github/workflows/tests-js.yaml +58 -0
- package/recce-source/.github/workflows/tests-python.yaml +128 -0
- package/recce-source/.pre-commit-config.yaml +26 -0
- package/recce-source/CLAUDE.md +483 -0
- package/recce-source/CODE_OF_CONDUCT.md +128 -0
- package/recce-source/CONTRIBUTING.md +107 -0
- package/recce-source/LICENSE +201 -0
- package/recce-source/Makefile +126 -0
- package/recce-source/README.md +182 -0
- package/recce-source/RECCE_CLOUD.md +81 -0
- package/recce-source/SECURITY.md +25 -0
- package/recce-source/docs/PACKAGING.md +340 -0
- package/recce-source/docs/README.md +1 -0
- package/recce-source/integration_tests/dbt/dbt_project.yml +26 -0
- package/recce-source/integration_tests/dbt/models/customers.sql +69 -0
- package/recce-source/integration_tests/dbt/models/docs.md +14 -0
- package/recce-source/integration_tests/dbt/models/orders.sql +56 -0
- package/recce-source/integration_tests/dbt/models/schema.yml +82 -0
- package/recce-source/integration_tests/dbt/models/staging/schema.yml +31 -0
- package/recce-source/integration_tests/dbt/models/staging/stg_customers.sql +22 -0
- package/recce-source/integration_tests/dbt/models/staging/stg_orders.sql +23 -0
- package/recce-source/integration_tests/dbt/models/staging/stg_payments.sql +25 -0
- package/recce-source/integration_tests/dbt/packages.yml +7 -0
- package/recce-source/integration_tests/dbt/profiles.yml +8 -0
- package/recce-source/integration_tests/dbt/seeds/raw_customers.csv +101 -0
- package/recce-source/integration_tests/dbt/seeds/raw_orders.csv +100 -0
- package/recce-source/integration_tests/dbt/seeds/raw_payments.csv +114 -0
- package/recce-source/integration_tests/dbt/seeds/raw_statuses.csv +5 -0
- package/recce-source/integration_tests/dbt/smoke_test.sh +72 -0
- package/recce-source/integration_tests/dbt/smoke_test_cloud.sh +71 -0
- package/recce-source/integration_tests/sqlmesh/__init__.py +0 -0
- package/recce-source/integration_tests/sqlmesh/audits/assert_item_price_above_zero.sql +9 -0
- package/recce-source/integration_tests/sqlmesh/audits/items.sql +7 -0
- package/recce-source/integration_tests/sqlmesh/audits/order_items.sql +7 -0
- package/recce-source/integration_tests/sqlmesh/config.py +171 -0
- package/recce-source/integration_tests/sqlmesh/helper.py +20 -0
- package/recce-source/integration_tests/sqlmesh/hooks/__init__.py +0 -0
- package/recce-source/integration_tests/sqlmesh/macros/__init__.py +0 -0
- package/recce-source/integration_tests/sqlmesh/macros/macros.py +8 -0
- package/recce-source/integration_tests/sqlmesh/macros/macros.sql +8 -0
- package/recce-source/integration_tests/sqlmesh/macros/utils.py +11 -0
- package/recce-source/integration_tests/sqlmesh/metrics/metrics.sql +25 -0
- package/recce-source/integration_tests/sqlmesh/models/customer_revenue_by_day.sql +41 -0
- package/recce-source/integration_tests/sqlmesh/models/customer_revenue_lifetime.sql +60 -0
- package/recce-source/integration_tests/sqlmesh/models/customers.sql +32 -0
- package/recce-source/integration_tests/sqlmesh/models/items.py +95 -0
- package/recce-source/integration_tests/sqlmesh/models/marketing.sql +15 -0
- package/recce-source/integration_tests/sqlmesh/models/order_items.py +95 -0
- package/recce-source/integration_tests/sqlmesh/models/orders.py +70 -0
- package/recce-source/integration_tests/sqlmesh/models/raw_marketing.py +62 -0
- package/recce-source/integration_tests/sqlmesh/models/top_waiters.sql +23 -0
- package/recce-source/integration_tests/sqlmesh/models/waiter_as_customer_by_day.sql +29 -0
- package/recce-source/integration_tests/sqlmesh/models/waiter_names.sql +10 -0
- package/recce-source/integration_tests/sqlmesh/models/waiter_revenue_by_day.sql +29 -0
- package/recce-source/integration_tests/sqlmesh/models/waiters.py +62 -0
- package/recce-source/integration_tests/sqlmesh/prep_env.sh +16 -0
- package/recce-source/integration_tests/sqlmesh/schema.yaml +5 -0
- package/recce-source/integration_tests/sqlmesh/seeds/waiter_names.csv +11 -0
- package/recce-source/integration_tests/sqlmesh/test_server.sh +29 -0
- package/recce-source/integration_tests/sqlmesh/tests/test_customer_revenue_by_day.yaml +63 -0
- package/recce-source/integration_tests/sqlmesh/tests/test_order_items.yaml +72 -0
- package/recce-source/js/.editorconfig +27 -0
- package/recce-source/js/.env.development +5 -0
- package/recce-source/js/.husky/pre-commit +29 -0
- package/recce-source/js/.nvmrc +1 -0
- package/recce-source/js/README.md +39 -0
- package/recce-source/js/app/(mainComponents)/DisplayModeToggle.tsx +65 -0
- package/recce-source/js/app/(mainComponents)/NavBar.tsx +228 -0
- package/recce-source/js/app/(mainComponents)/RecceVersionBadge.tsx +107 -0
- package/recce-source/js/app/(mainComponents)/TopBar.tsx +252 -0
- package/recce-source/js/app/@lineage/default.tsx +20 -0
- package/recce-source/js/app/@lineage/page.tsx +14 -0
- package/recce-source/js/app/MainLayout.tsx +170 -0
- package/recce-source/js/app/Providers.tsx +49 -0
- package/recce-source/js/app/checks/page.tsx +296 -0
- package/recce-source/js/app/error.tsx +93 -0
- package/recce-source/js/app/favicon.ico +0 -0
- package/recce-source/js/app/global-error.tsx +115 -0
- package/recce-source/js/app/global.css +82 -0
- package/recce-source/js/app/layout.tsx +48 -0
- package/recce-source/js/app/lineage/page.tsx +15 -0
- package/recce-source/js/app/page.tsx +12 -0
- package/recce-source/js/app/query/page.tsx +8 -0
- package/recce-source/js/biome.json +313 -0
- package/recce-source/js/jest.config.js +34 -0
- package/recce-source/js/jest.globals.d.ts +32 -0
- package/recce-source/js/jest.setup.js +91 -0
- package/recce-source/js/next.config.js +16 -0
- package/recce-source/js/package-lock.json +13843 -0
- package/recce-source/js/package.json +123 -0
- package/recce-source/js/pnpm-lock.yaml +9235 -0
- package/recce-source/js/pnpm-workspace.yaml +6 -0
- package/recce-source/js/postcss.config.js +5 -0
- package/recce-source/js/public/auth_callback.html +68 -0
- package/recce-source/js/public/imgs/feedback/thumbs-down.png +0 -0
- package/recce-source/js/public/imgs/feedback/thumbs-up.png +0 -0
- package/recce-source/js/public/imgs/reload-image.svg +4 -0
- package/recce-source/js/public/logo/recce-logo-white.png +0 -0
- package/recce-source/js/src/components/AuthModal/AuthModal.tsx +202 -0
- package/recce-source/js/src/components/app/AvatarDropdown.tsx +159 -0
- package/recce-source/js/src/components/app/EnvInfo.tsx +357 -0
- package/recce-source/js/src/components/app/Filename.tsx +388 -0
- package/recce-source/js/src/components/app/SetupConnectionPopover.tsx +91 -0
- package/recce-source/js/src/components/app/StateExporter.tsx +57 -0
- package/recce-source/js/src/components/app/StateImporter.tsx +198 -0
- package/recce-source/js/src/components/app/StateSharing.tsx +145 -0
- package/recce-source/js/src/components/app/StateSynchronizer.tsx +205 -0
- package/recce-source/js/src/components/charts/HistogramChart.tsx +291 -0
- package/recce-source/js/src/components/charts/SquareIcon.tsx +51 -0
- package/recce-source/js/src/components/charts/TopKSummaryList.tsx +457 -0
- package/recce-source/js/src/components/charts/chartTheme.ts +74 -0
- package/recce-source/js/src/components/check/CheckBreadcrumb.tsx +97 -0
- package/recce-source/js/src/components/check/CheckDescription.tsx +134 -0
- package/recce-source/js/src/components/check/CheckDetail.tsx +797 -0
- package/recce-source/js/src/components/check/CheckEmptyState.tsx +84 -0
- package/recce-source/js/src/components/check/CheckList.tsx +320 -0
- package/recce-source/js/src/components/check/LineageDiffView.tsx +32 -0
- package/recce-source/js/src/components/check/PresetCheckTemplateView.tsx +48 -0
- package/recce-source/js/src/components/check/SchemaDiffView.tsx +290 -0
- package/recce-source/js/src/components/check/check.ts +25 -0
- package/recce-source/js/src/components/check/timeline/CheckTimeline.tsx +163 -0
- package/recce-source/js/src/components/check/timeline/CommentInput.tsx +84 -0
- package/recce-source/js/src/components/check/timeline/TimelineEvent.tsx +468 -0
- package/recce-source/js/src/components/check/timeline/index.ts +12 -0
- package/recce-source/js/src/components/check/utils.ts +12 -0
- package/recce-source/js/src/components/data-grid/ScreenshotDataGrid.tsx +333 -0
- package/recce-source/js/src/components/data-grid/agGridStyles.css +55 -0
- package/recce-source/js/src/components/data-grid/agGridTheme.ts +43 -0
- package/recce-source/js/src/components/editor/CodeEditor.tsx +107 -0
- package/recce-source/js/src/components/editor/DiffEditor.tsx +162 -0
- package/recce-source/js/src/components/editor/index.ts +12 -0
- package/recce-source/js/src/components/errorboundary/ErrorBoundary.tsx +87 -0
- package/recce-source/js/src/components/histogram/HistogramDiffForm.tsx +147 -0
- package/recce-source/js/src/components/histogram/HistogramDiffResultView.tsx +63 -0
- package/recce-source/js/src/components/icons/index.tsx +142 -0
- package/recce-source/js/src/components/lineage/ActionControl.tsx +63 -0
- package/recce-source/js/src/components/lineage/ActionTag.tsx +141 -0
- package/recce-source/js/src/components/lineage/ChangeStatusLegend.tsx +46 -0
- package/recce-source/js/src/components/lineage/ColumnLevelLineageControl.tsx +327 -0
- package/recce-source/js/src/components/lineage/ColumnLevelLineageLegend.tsx +57 -0
- package/recce-source/js/src/components/lineage/GraphColumnNode.tsx +199 -0
- package/recce-source/js/src/components/lineage/GraphEdge.tsx +59 -0
- package/recce-source/js/src/components/lineage/GraphNode.tsx +555 -0
- package/recce-source/js/src/components/lineage/LineagePage.tsx +10 -0
- package/recce-source/js/src/components/lineage/LineageView.tsx +1384 -0
- package/recce-source/js/src/components/lineage/LineageViewContext.tsx +86 -0
- package/recce-source/js/src/components/lineage/LineageViewContextMenu.tsx +637 -0
- package/recce-source/js/src/components/lineage/LineageViewNotification.tsx +64 -0
- package/recce-source/js/src/components/lineage/LineageViewTopBar.tsx +596 -0
- package/recce-source/js/src/components/lineage/NodeSqlView.tsx +136 -0
- package/recce-source/js/src/components/lineage/NodeTag.tsx +278 -0
- package/recce-source/js/src/components/lineage/NodeView.tsx +642 -0
- package/recce-source/js/src/components/lineage/SandboxView.tsx +436 -0
- package/recce-source/js/src/components/lineage/ServerDisconnectedModalContent.tsx +105 -0
- package/recce-source/js/src/components/lineage/SetupConnectionBanner.tsx +52 -0
- package/recce-source/js/src/components/lineage/SingleEnvironmentQueryView.tsx +152 -0
- package/recce-source/js/src/components/lineage/graph.test.ts +31 -0
- package/recce-source/js/src/components/lineage/graph.ts +58 -0
- package/recce-source/js/src/components/lineage/lineage.test.ts +169 -0
- package/recce-source/js/src/components/lineage/lineage.ts +521 -0
- package/recce-source/js/src/components/lineage/styles.css +42 -0
- package/recce-source/js/src/components/lineage/styles.tsx +165 -0
- package/recce-source/js/src/components/lineage/useMultiNodesAction.ts +352 -0
- package/recce-source/js/src/components/lineage/useValueDiffAlertDialog.tsx +108 -0
- package/recce-source/js/src/components/onboarding-guide/Notification.tsx +62 -0
- package/recce-source/js/src/components/profile/ProfileDiffForm.tsx +134 -0
- package/recce-source/js/src/components/profile/ProfileDiffResultView.tsx +245 -0
- package/recce-source/js/src/components/query/ChangedOnlyCheckbox.tsx +29 -0
- package/recce-source/js/src/components/query/DiffText.tsx +120 -0
- package/recce-source/js/src/components/query/QueryDiffResultView.tsx +470 -0
- package/recce-source/js/src/components/query/QueryForm.tsx +80 -0
- package/recce-source/js/src/components/query/QueryPage.tsx +282 -0
- package/recce-source/js/src/components/query/QueryResultView.tsx +180 -0
- package/recce-source/js/src/components/query/SetupConnectionGuide.tsx +57 -0
- package/recce-source/js/src/components/query/SqlEditor.tsx +245 -0
- package/recce-source/js/src/components/query/ToggleSwitch.tsx +84 -0
- package/recce-source/js/src/components/query/styles.css +21 -0
- package/recce-source/js/src/components/routing/DirectUrlAccess.test.tsx +428 -0
- package/recce-source/js/src/components/routing/LineageStatePreservation.test.tsx +311 -0
- package/recce-source/js/src/components/routing/Navigation.test.tsx +256 -0
- package/recce-source/js/src/components/rowcount/RowCountDiffResultView.tsx +109 -0
- package/recce-source/js/src/components/rowcount/delta.ts +11 -0
- package/recce-source/js/src/components/run/RunList.tsx +303 -0
- package/recce-source/js/src/components/run/RunModal.tsx +191 -0
- package/recce-source/js/src/components/run/RunPage.tsx +26 -0
- package/recce-source/js/src/components/run/RunResultPane.tsx +454 -0
- package/recce-source/js/src/components/run/RunStatusAndDate.tsx +106 -0
- package/recce-source/js/src/components/run/RunToolbar.tsx +70 -0
- package/recce-source/js/src/components/run/RunView.tsx +196 -0
- package/recce-source/js/src/components/run/registry.ts +214 -0
- package/recce-source/js/src/components/run/types.ts +14 -0
- package/recce-source/js/src/components/schema/ColumnNameCell.test.tsx +169 -0
- package/recce-source/js/src/components/schema/ColumnNameCell.tsx +198 -0
- package/recce-source/js/src/components/schema/SchemaView.tsx +337 -0
- package/recce-source/js/src/components/schema/schemaDiff.ts +32 -0
- package/recce-source/js/src/components/schema/style.css +134 -0
- package/recce-source/js/src/components/screenshot/ScreenshotBox.tsx +39 -0
- package/recce-source/js/src/components/shared/HistoryToggle.tsx +35 -0
- package/recce-source/js/src/components/split/Split.tsx +40 -0
- package/recce-source/js/src/components/split/styles.css +24 -0
- package/recce-source/js/src/components/summary/ChangeSummary.tsx +264 -0
- package/recce-source/js/src/components/summary/SchemaSummary.tsx +123 -0
- package/recce-source/js/src/components/summary/SummaryView.tsx +29 -0
- package/recce-source/js/src/components/timeout/IdleTimeoutBadge.tsx +48 -0
- package/recce-source/js/src/components/top-k/TopKDiffForm.tsx +58 -0
- package/recce-source/js/src/components/top-k/TopKDiffResultView.tsx +73 -0
- package/recce-source/js/src/components/ui/dataGrid/DataFrameColumnGroupHeader.tsx +228 -0
- package/recce-source/js/src/components/ui/dataGrid/DataFrameColumnHeader.tsx +113 -0
- package/recce-source/js/src/components/ui/dataGrid/defaultRenderCell.tsx +72 -0
- package/recce-source/js/src/components/ui/dataGrid/index.ts +23 -0
- package/recce-source/js/src/components/ui/dataGrid/inlineRenderCell.test.tsx +607 -0
- package/recce-source/js/src/components/ui/dataGrid/inlineRenderCell.tsx +211 -0
- package/recce-source/js/src/components/ui/dataGrid/schemaCells.test.tsx +452 -0
- package/recce-source/js/src/components/ui/dataGrid/schemaCells.tsx +142 -0
- package/recce-source/js/src/components/ui/dataGrid/valueDiffCells.test.tsx +178 -0
- package/recce-source/js/src/components/ui/dataGrid/valueDiffCells.tsx +275 -0
- package/recce-source/js/src/components/ui/markdown/ExternalLinkConfirmDialog.tsx +134 -0
- package/recce-source/js/src/components/ui/markdown/MarkdownContent.tsx +364 -0
- package/recce-source/js/src/components/ui/mui/index.ts +13 -0
- package/recce-source/js/src/components/ui/mui-provider.tsx +67 -0
- package/recce-source/js/src/components/ui/mui-theme.ts +1039 -0
- package/recce-source/js/src/components/ui/mui-utils.ts +113 -0
- package/recce-source/js/src/components/ui/toaster.tsx +288 -0
- package/recce-source/js/src/components/valuediff/ValueDiffDetailResultView.tsx +217 -0
- package/recce-source/js/src/components/valuediff/ValueDiffForm.tsx +246 -0
- package/recce-source/js/src/components/valuediff/ValueDiffResultView.tsx +82 -0
- package/recce-source/js/src/components/valuediff/shared.ts +33 -0
- package/recce-source/js/src/constants/tooltipMessage.ts +3 -0
- package/recce-source/js/src/constants/urls.ts +1 -0
- package/recce-source/js/src/lib/UrlHash.ts +12 -0
- package/recce-source/js/src/lib/api/adhocQuery.ts +70 -0
- package/recce-source/js/src/lib/api/axiosClient.ts +9 -0
- package/recce-source/js/src/lib/api/cacheKeys.ts +13 -0
- package/recce-source/js/src/lib/api/checkEvents.ts +252 -0
- package/recce-source/js/src/lib/api/checks.ts +129 -0
- package/recce-source/js/src/lib/api/cll.ts +53 -0
- package/recce-source/js/src/lib/api/connectToCloud.ts +13 -0
- package/recce-source/js/src/lib/api/flag.ts +37 -0
- package/recce-source/js/src/lib/api/info.ts +198 -0
- package/recce-source/js/src/lib/api/instanceInfo.ts +25 -0
- package/recce-source/js/src/lib/api/keepAlive.ts +108 -0
- package/recce-source/js/src/lib/api/lineagecheck.ts +35 -0
- package/recce-source/js/src/lib/api/localStorageKeys.ts +7 -0
- package/recce-source/js/src/lib/api/models.ts +59 -0
- package/recce-source/js/src/lib/api/profile.ts +65 -0
- package/recce-source/js/src/lib/api/rowcount.ts +19 -0
- package/recce-source/js/src/lib/api/runs.ts +174 -0
- package/recce-source/js/src/lib/api/schemacheck.ts +31 -0
- package/recce-source/js/src/lib/api/select.ts +25 -0
- package/recce-source/js/src/lib/api/sessionStorageKeys.ts +8 -0
- package/recce-source/js/src/lib/api/state.ts +117 -0
- package/recce-source/js/src/lib/api/track.ts +281 -0
- package/recce-source/js/src/lib/api/types.ts +284 -0
- package/recce-source/js/src/lib/api/user.ts +42 -0
- package/recce-source/js/src/lib/api/valuediff.ts +46 -0
- package/recce-source/js/src/lib/api/version.ts +40 -0
- package/recce-source/js/src/lib/const.ts +9 -0
- package/recce-source/js/src/lib/dataGrid/crossFunctionConsistency.test.ts +626 -0
- package/recce-source/js/src/lib/dataGrid/dataGridFactory.test.ts +2140 -0
- package/recce-source/js/src/lib/dataGrid/dataGridFactory.ts +397 -0
- package/recce-source/js/src/lib/dataGrid/generators/rowCountUtils.test.ts +132 -0
- package/recce-source/js/src/lib/dataGrid/generators/rowCountUtils.ts +126 -0
- package/recce-source/js/src/lib/dataGrid/generators/toDataDiffGrid.test.ts +1627 -0
- package/recce-source/js/src/lib/dataGrid/generators/toDataDiffGrid.ts +140 -0
- package/recce-source/js/src/lib/dataGrid/generators/toDataGrid.ts +67 -0
- package/recce-source/js/src/lib/dataGrid/generators/toRowCountDataGrid.test.ts +142 -0
- package/recce-source/js/src/lib/dataGrid/generators/toRowCountDataGrid.ts +71 -0
- package/recce-source/js/src/lib/dataGrid/generators/toRowCountDiffDataGrid.test.ts +258 -0
- package/recce-source/js/src/lib/dataGrid/generators/toRowCountDiffDataGrid.ts +153 -0
- package/recce-source/js/src/lib/dataGrid/generators/toSchemaDataGrid.test.ts +951 -0
- package/recce-source/js/src/lib/dataGrid/generators/toSchemaDataGrid.ts +221 -0
- package/recce-source/js/src/lib/dataGrid/generators/toValueDataGrid.test.ts +395 -0
- package/recce-source/js/src/lib/dataGrid/generators/toValueDataGrid.ts +184 -0
- package/recce-source/js/src/lib/dataGrid/generators/toValueDiffGrid.test.ts +884 -0
- package/recce-source/js/src/lib/dataGrid/generators/toValueDiffGrid.ts +113 -0
- package/recce-source/js/src/lib/dataGrid/index.ts +51 -0
- package/recce-source/js/src/lib/dataGrid/propertyBased.test.ts +858 -0
- package/recce-source/js/src/lib/dataGrid/shared/columnBuilders.test.ts +482 -0
- package/recce-source/js/src/lib/dataGrid/shared/columnBuilders.ts +345 -0
- package/recce-source/js/src/lib/dataGrid/shared/dataTypeEdgeCases.test.ts +698 -0
- package/recce-source/js/src/lib/dataGrid/shared/diffColumnBuilder.test.tsx +820 -0
- package/recce-source/js/src/lib/dataGrid/shared/diffColumnBuilder.tsx +277 -0
- package/recce-source/js/src/lib/dataGrid/shared/gridUtils.test.ts +785 -0
- package/recce-source/js/src/lib/dataGrid/shared/gridUtils.ts +370 -0
- package/recce-source/js/src/lib/dataGrid/shared/index.ts +81 -0
- package/recce-source/js/src/lib/dataGrid/shared/rowBuilders.test.ts +909 -0
- package/recce-source/js/src/lib/dataGrid/shared/rowBuilders.ts +325 -0
- package/recce-source/js/src/lib/dataGrid/shared/simpleColumnBuilder.tsx +240 -0
- package/recce-source/js/src/lib/dataGrid/shared/toDiffColumn.test.tsx +719 -0
- package/recce-source/js/src/lib/dataGrid/shared/toDiffColumn.tsx +231 -0
- package/recce-source/js/src/lib/dataGrid/shared/validation.test.ts +559 -0
- package/recce-source/js/src/lib/dataGrid/shared/validation.ts +367 -0
- package/recce-source/js/src/lib/dataGrid/warehouseNamingConventions.test.ts +1117 -0
- package/recce-source/js/src/lib/formatSelect.ts +50 -0
- package/recce-source/js/src/lib/hooks/ApiConfigContext.tsx +181 -0
- package/recce-source/js/src/lib/hooks/IdleTimeoutContext.tsx +177 -0
- package/recce-source/js/src/lib/hooks/LineageGraphContext.tsx +512 -0
- package/recce-source/js/src/lib/hooks/RecceActionContext.tsx +269 -0
- package/recce-source/js/src/lib/hooks/RecceCheckContext.tsx +33 -0
- package/recce-source/js/src/lib/hooks/RecceContextProvider.tsx +54 -0
- package/recce-source/js/src/lib/hooks/RecceInstanceContext.tsx +129 -0
- package/recce-source/js/src/lib/hooks/RecceQueryContext.tsx +98 -0
- package/recce-source/js/src/lib/hooks/RecceShareStateContext.tsx +59 -0
- package/recce-source/js/src/lib/hooks/ScreenShot.tsx +399 -0
- package/recce-source/js/src/lib/hooks/useAppRouter.test.ts +211 -0
- package/recce-source/js/src/lib/hooks/useAppRouter.ts +200 -0
- package/recce-source/js/src/lib/hooks/useCheckEvents.ts +99 -0
- package/recce-source/js/src/lib/hooks/useCheckToast.tsx +14 -0
- package/recce-source/js/src/lib/hooks/useClipBoardToast.tsx +27 -0
- package/recce-source/js/src/lib/hooks/useCountdownToast.tsx +102 -0
- package/recce-source/js/src/lib/hooks/useFeedbackCollectionToast.tsx +130 -0
- package/recce-source/js/src/lib/hooks/useGuideToast.tsx +45 -0
- package/recce-source/js/src/lib/hooks/useIdleDetection.tsx +185 -0
- package/recce-source/js/src/lib/hooks/useModelColumns.tsx +113 -0
- package/recce-source/js/src/lib/hooks/useRecceInstanceInfo.tsx +13 -0
- package/recce-source/js/src/lib/hooks/useRecceServerFlag.tsx +13 -0
- package/recce-source/js/src/lib/hooks/useRun.tsx +89 -0
- package/recce-source/js/src/lib/hooks/useThemeColors.ts +115 -0
- package/recce-source/js/src/lib/mergeKeys.test.ts +89 -0
- package/recce-source/js/src/lib/mergeKeys.ts +86 -0
- package/recce-source/js/src/lib/result/ResultErrorFallback.tsx +9 -0
- package/recce-source/js/src/lib/utils/formatTime.ts +84 -0
- package/recce-source/js/src/lib/utils/urls.ts +16 -0
- package/recce-source/js/src/utils/DropdownValuesInput.tsx +297 -0
- package/recce-source/js/src/utils/formatters.tsx +237 -0
- package/recce-source/js/src/utils/transforms.ts +81 -0
- package/recce-source/js/tsconfig.json +47 -0
- package/recce-source/macros/README.md +8 -0
- package/recce-source/macros/recce_athena.sql +73 -0
- package/recce-source/pyproject.toml +109 -0
- package/recce-source/recce/VERSION +1 -0
- package/recce-source/recce/__init__.py +84 -0
- package/recce-source/recce/adapter/__init__.py +0 -0
- package/recce-source/recce/adapter/base.py +109 -0
- package/recce-source/recce/adapter/dbt_adapter/__init__.py +1699 -0
- package/recce-source/recce/adapter/dbt_adapter/dbt_version.py +42 -0
- package/recce-source/recce/adapter/sqlmesh_adapter.py +141 -0
- package/recce-source/recce/apis/__init__.py +0 -0
- package/recce-source/recce/apis/check_api.py +203 -0
- package/recce-source/recce/apis/check_events_api.py +353 -0
- package/recce-source/recce/apis/check_func.py +130 -0
- package/recce-source/recce/apis/run_api.py +130 -0
- package/recce-source/recce/apis/run_func.py +258 -0
- package/recce-source/recce/artifact.py +266 -0
- package/recce-source/recce/cli.py +1846 -0
- package/recce-source/recce/config.py +127 -0
- package/recce-source/recce/connect_to_cloud.py +138 -0
- package/recce-source/recce/core.py +334 -0
- package/recce-source/recce/diff.py +26 -0
- package/recce-source/recce/event/CONFIG +1 -0
- package/recce-source/recce/event/SENTRY_DNS +1 -0
- package/recce-source/recce/event/__init__.py +304 -0
- package/recce-source/recce/event/collector.py +184 -0
- package/recce-source/recce/event/track.py +158 -0
- package/recce-source/recce/exceptions.py +21 -0
- package/recce-source/recce/git.py +77 -0
- package/recce-source/recce/github.py +222 -0
- package/recce-source/recce/mcp_server.py +861 -0
- package/recce-source/recce/models/__init__.py +6 -0
- package/recce-source/recce/models/check.py +473 -0
- package/recce-source/recce/models/run.py +46 -0
- package/recce-source/recce/models/types.py +218 -0
- package/recce-source/recce/pull_request.py +124 -0
- package/recce-source/recce/run.py +390 -0
- package/recce-source/recce/server.py +877 -0
- package/recce-source/recce/state/__init__.py +31 -0
- package/recce-source/recce/state/cloud.py +644 -0
- package/recce-source/recce/state/const.py +26 -0
- package/recce-source/recce/state/local.py +56 -0
- package/recce-source/recce/state/state.py +119 -0
- package/recce-source/recce/state/state_loader.py +174 -0
- package/recce-source/recce/summary.py +575 -0
- package/recce-source/recce/tasks/__init__.py +23 -0
- package/recce-source/recce/tasks/core.py +134 -0
- package/recce-source/recce/tasks/dataframe.py +170 -0
- package/recce-source/recce/tasks/histogram.py +433 -0
- package/recce-source/recce/tasks/lineage.py +19 -0
- package/recce-source/recce/tasks/profile.py +298 -0
- package/recce-source/recce/tasks/query.py +450 -0
- package/recce-source/recce/tasks/rowcount.py +277 -0
- package/recce-source/recce/tasks/schema.py +65 -0
- package/recce-source/recce/tasks/top_k.py +172 -0
- package/recce-source/recce/tasks/utils.py +147 -0
- package/recce-source/recce/tasks/valuediff.py +497 -0
- package/recce-source/recce/util/__init__.py +4 -0
- package/recce-source/recce/util/api_token.py +80 -0
- package/recce-source/recce/util/breaking.py +330 -0
- package/recce-source/recce/util/cache.py +25 -0
- package/recce-source/recce/util/cll.py +355 -0
- package/recce-source/recce/util/cloud/__init__.py +15 -0
- package/recce-source/recce/util/cloud/base.py +115 -0
- package/recce-source/recce/util/cloud/check_events.py +190 -0
- package/recce-source/recce/util/cloud/checks.py +242 -0
- package/recce-source/recce/util/io.py +120 -0
- package/recce-source/recce/util/lineage.py +83 -0
- package/recce-source/recce/util/logger.py +25 -0
- package/recce-source/recce/util/onboarding_state.py +45 -0
- package/recce-source/recce/util/perf_tracking.py +85 -0
- package/recce-source/recce/util/pydantic_model.py +22 -0
- package/recce-source/recce/util/recce_cloud.py +454 -0
- package/recce-source/recce/util/singleton.py +18 -0
- package/recce-source/recce/util/startup_perf.py +121 -0
- package/recce-source/recce/yaml/__init__.py +58 -0
- package/recce-source/recce_cloud/README.md +780 -0
- package/recce-source/recce_cloud/VERSION +1 -0
- package/recce-source/recce_cloud/__init__.py +24 -0
- package/recce-source/recce_cloud/api/__init__.py +17 -0
- package/recce-source/recce_cloud/api/base.py +132 -0
- package/recce-source/recce_cloud/api/client.py +186 -0
- package/recce-source/recce_cloud/api/exceptions.py +26 -0
- package/recce-source/recce_cloud/api/factory.py +63 -0
- package/recce-source/recce_cloud/api/github.py +106 -0
- package/recce-source/recce_cloud/api/gitlab.py +111 -0
- package/recce-source/recce_cloud/artifact.py +57 -0
- package/recce-source/recce_cloud/ci_providers/__init__.py +9 -0
- package/recce-source/recce_cloud/ci_providers/base.py +82 -0
- package/recce-source/recce_cloud/ci_providers/detector.py +147 -0
- package/recce-source/recce_cloud/ci_providers/github_actions.py +136 -0
- package/recce-source/recce_cloud/ci_providers/gitlab_ci.py +130 -0
- package/recce-source/recce_cloud/cli.py +434 -0
- package/recce-source/recce_cloud/download.py +230 -0
- package/recce-source/recce_cloud/hatch_build.py +20 -0
- package/recce-source/recce_cloud/pyproject.toml +49 -0
- package/recce-source/recce_cloud/upload.py +214 -0
- package/recce-source/test.py +0 -0
- package/recce-source/tests/__init__.py +0 -0
- package/recce-source/tests/adapter/__init__.py +0 -0
- package/recce-source/tests/adapter/dbt_adapter/__init__.py +0 -0
- package/recce-source/tests/adapter/dbt_adapter/conftest.py +17 -0
- package/recce-source/tests/adapter/dbt_adapter/dbt_test_helper.py +298 -0
- package/recce-source/tests/adapter/dbt_adapter/test_dbt_adapter.py +25 -0
- package/recce-source/tests/adapter/dbt_adapter/test_dbt_cll.py +717 -0
- package/recce-source/tests/adapter/dbt_adapter/test_proj/dbt_project.yml +4 -0
- package/recce-source/tests/adapter/dbt_adapter/test_proj/manifest.json +1 -0
- package/recce-source/tests/adapter/dbt_adapter/test_proj/package-lock.yml +8 -0
- package/recce-source/tests/adapter/dbt_adapter/test_proj/packages.yml +7 -0
- package/recce-source/tests/adapter/dbt_adapter/test_proj/profiles.yml +6 -0
- package/recce-source/tests/adapter/dbt_adapter/test_selector.py +205 -0
- package/recce-source/tests/apis/__init__.py +0 -0
- package/recce-source/tests/apis/row_count_diff.json +59 -0
- package/recce-source/tests/apis/test_check_events_api.py +615 -0
- package/recce-source/tests/apis/test_run_func.py +433 -0
- package/recce-source/tests/catalog.json +527 -0
- package/recce-source/tests/data/manifest/base/catalog.json +1 -0
- package/recce-source/tests/data/manifest/base/manifest.json +1 -0
- package/recce-source/tests/data/manifest/pr2/catalog.json +1 -0
- package/recce-source/tests/data/manifest/pr2/manifest.json +1 -0
- package/recce-source/tests/manifest.json +10655 -0
- package/recce-source/tests/models/__init__.py +0 -0
- package/recce-source/tests/models/test_check.py +731 -0
- package/recce-source/tests/models/test_run_models.py +295 -0
- package/recce-source/tests/recce_cloud/__init__.py +0 -0
- package/recce-source/tests/recce_cloud/test_ci_providers.py +351 -0
- package/recce-source/tests/recce_cloud/test_cli.py +735 -0
- package/recce-source/tests/recce_cloud/test_client.py +379 -0
- package/recce-source/tests/recce_cloud/test_platform_clients.py +483 -0
- package/recce-source/tests/recce_state.json +1 -0
- package/recce-source/tests/state/test_cloud.py +719 -0
- package/recce-source/tests/state/test_local.py +164 -0
- package/recce-source/tests/state/test_state_loader.py +211 -0
- package/recce-source/tests/tasks/__init__.py +0 -0
- package/recce-source/tests/tasks/conftest.py +4 -0
- package/recce-source/tests/tasks/test_histogram.py +129 -0
- package/recce-source/tests/tasks/test_lineage.py +55 -0
- package/recce-source/tests/tasks/test_preset_checks.py +64 -0
- package/recce-source/tests/tasks/test_profile.py +397 -0
- package/recce-source/tests/tasks/test_query.py +528 -0
- package/recce-source/tests/tasks/test_row_count.py +133 -0
- package/recce-source/tests/tasks/test_schema.py +122 -0
- package/recce-source/tests/tasks/test_top_k.py +77 -0
- package/recce-source/tests/tasks/test_utils.py +439 -0
- package/recce-source/tests/tasks/test_valuediff.py +361 -0
- package/recce-source/tests/test_cli.py +236 -0
- package/recce-source/tests/test_cli_mcp_optional.py +45 -0
- package/recce-source/tests/test_cloud_listing_cli.py +324 -0
- package/recce-source/tests/test_config.py +43 -0
- package/recce-source/tests/test_connect_to_cloud.py +82 -0
- package/recce-source/tests/test_core.py +174 -0
- package/recce-source/tests/test_dbt.py +36 -0
- package/recce-source/tests/test_mcp_server.py +505 -0
- package/recce-source/tests/test_pull_request.py +130 -0
- package/recce-source/tests/test_server.py +202 -0
- package/recce-source/tests/test_server_lifespan.py +138 -0
- package/recce-source/tests/test_summary.py +73 -0
- package/recce-source/tests/util/__init__.py +0 -0
- package/recce-source/tests/util/cloud/__init__.py +0 -0
- package/recce-source/tests/util/cloud/test_check_events.py +255 -0
- package/recce-source/tests/util/cloud/test_checks.py +204 -0
- package/recce-source/tests/util/test_api_token.py +119 -0
- package/recce-source/tests/util/test_breaking.py +1427 -0
- package/recce-source/tests/util/test_cll.py +706 -0
- package/recce-source/tests/util/test_lineage.py +122 -0
- package/recce-source/tests/util/test_onboarding_state.py +84 -0
- package/recce-source/tests/util/test_recce_cloud.py +231 -0
- package/recce-source/tox.ini +40 -0
- package/recce-source/uv.lock +3928 -0
- package/src/api/index.ts +32 -0
- package/src/components/index.ts +154 -0
- package/src/global.d.ts +14 -0
- package/src/hooks/index.ts +56 -0
- package/src/index.ts +17 -0
- package/src/lib/hooks/RouteConfigContext.ts +139 -0
- package/src/lib/hooks/useAppRouter.ts +240 -0
- package/src/mui-augmentation.d.ts +139 -0
- package/src/theme/index.ts +13 -0
- package/src/theme.ts +23 -0
- package/src/types/index.ts +23 -0
- package/dist/index-BNUP2V_N.d.ts.map +0 -1
- package/dist/index-DOPZuhD8.d.mts.map +0 -1
- package/dist/theme.d.mts.map +0 -1
- package/dist/theme.d.ts.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "recce-cloud"
|
|
3
|
+
dynamic = ["version", "readme"]
|
|
4
|
+
description = "Lightweight CLI for Recce Cloud operations"
|
|
5
|
+
authors = [{name = "InfuseAI Dev Team", email = "dev@infuseai.io"}]
|
|
6
|
+
requires-python = ">=3.9"
|
|
7
|
+
license = {text = "Apache-2.0"}
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
"click>=7.1",
|
|
11
|
+
"requests>=2.28.1",
|
|
12
|
+
"rich>=12.0.0",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3.9",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Programming Language :: Python :: 3.13",
|
|
21
|
+
"License :: OSI Approved :: Apache Software License",
|
|
22
|
+
"Operating System :: OS Independent",
|
|
23
|
+
"Development Status :: 4 - Beta",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
[project.scripts]
|
|
27
|
+
recce-cloud = "recce_cloud.cli:cloud_cli"
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
"Bug Tracker" = "https://github.com/InfuseAI/recce/issues"
|
|
31
|
+
|
|
32
|
+
[build-system]
|
|
33
|
+
requires = ["hatchling"]
|
|
34
|
+
build-backend = "hatchling.build"
|
|
35
|
+
|
|
36
|
+
[tool.hatch.version]
|
|
37
|
+
path = "VERSION"
|
|
38
|
+
pattern = "(?P<version>.+)"
|
|
39
|
+
|
|
40
|
+
[tool.hatch.metadata]
|
|
41
|
+
allow-direct-references = true
|
|
42
|
+
|
|
43
|
+
[tool.hatch.metadata.hooks.custom]
|
|
44
|
+
|
|
45
|
+
[tool.hatch.build.targets.wheel]
|
|
46
|
+
packages = ["."]
|
|
47
|
+
|
|
48
|
+
[tool.hatch.build.targets.wheel.sources]
|
|
49
|
+
"." = "recce_cloud"
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Upload helper functions for recce-cloud CLI.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
import requests
|
|
9
|
+
|
|
10
|
+
from recce_cloud.api.client import RecceCloudClient
|
|
11
|
+
from recce_cloud.api.exceptions import RecceCloudException
|
|
12
|
+
from recce_cloud.api.factory import create_platform_client
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def upload_to_existing_session(
|
|
16
|
+
console, token: str, session_id: str, manifest_path: str, catalog_path: str, adapter_type: str, target_path: str
|
|
17
|
+
):
|
|
18
|
+
"""
|
|
19
|
+
Upload artifacts to an existing Recce Cloud session using session ID.
|
|
20
|
+
|
|
21
|
+
This is the generic workflow that requires a pre-existing session ID.
|
|
22
|
+
"""
|
|
23
|
+
try:
|
|
24
|
+
client = RecceCloudClient(token)
|
|
25
|
+
except Exception as e:
|
|
26
|
+
console.print("[red]Error:[/red] Failed to initialize API client")
|
|
27
|
+
console.print(f"Reason: {e}")
|
|
28
|
+
sys.exit(2)
|
|
29
|
+
|
|
30
|
+
# Get session info (org_id, project_id)
|
|
31
|
+
console.print(f'Uploading artifacts for session ID "{session_id}"')
|
|
32
|
+
try:
|
|
33
|
+
session = client.get_session(session_id)
|
|
34
|
+
if session.get("status") == "error":
|
|
35
|
+
console.print(f"[red]Error:[/red] {session.get('message')}")
|
|
36
|
+
sys.exit(2)
|
|
37
|
+
|
|
38
|
+
org_id = session.get("org_id")
|
|
39
|
+
if org_id is None:
|
|
40
|
+
console.print(f"[red]Error:[/red] Session ID {session_id} does not belong to any organization.")
|
|
41
|
+
sys.exit(2)
|
|
42
|
+
|
|
43
|
+
project_id = session.get("project_id")
|
|
44
|
+
if project_id is None:
|
|
45
|
+
console.print(f"[red]Error:[/red] Session ID {session_id} does not belong to any project.")
|
|
46
|
+
sys.exit(2)
|
|
47
|
+
|
|
48
|
+
except RecceCloudException as e:
|
|
49
|
+
console.print("[red]Error:[/red] Failed to get session info")
|
|
50
|
+
console.print(f"Reason: {e.reason}")
|
|
51
|
+
sys.exit(2)
|
|
52
|
+
except Exception as e:
|
|
53
|
+
console.print("[red]Error:[/red] Failed to get session info")
|
|
54
|
+
console.print(f"Reason: {e}")
|
|
55
|
+
sys.exit(2)
|
|
56
|
+
|
|
57
|
+
# Get presigned URLs
|
|
58
|
+
try:
|
|
59
|
+
presigned_urls = client.get_upload_urls_by_session_id(org_id, project_id, session_id)
|
|
60
|
+
except RecceCloudException as e:
|
|
61
|
+
console.print("[red]Error:[/red] Failed to get upload URLs")
|
|
62
|
+
console.print(f"Reason: {e.reason}")
|
|
63
|
+
sys.exit(4)
|
|
64
|
+
except Exception as e:
|
|
65
|
+
console.print("[red]Error:[/red] Failed to get upload URLs")
|
|
66
|
+
console.print(f"Reason: {e}")
|
|
67
|
+
sys.exit(4)
|
|
68
|
+
|
|
69
|
+
# Upload manifest.json
|
|
70
|
+
console.print(f'Uploading manifest from path "{manifest_path}"')
|
|
71
|
+
try:
|
|
72
|
+
with open(manifest_path, "rb") as f:
|
|
73
|
+
response = requests.put(presigned_urls["manifest_url"], data=f.read())
|
|
74
|
+
if response.status_code not in [200, 204]:
|
|
75
|
+
raise Exception(f"Upload failed with status {response.status_code}: {response.text}")
|
|
76
|
+
except Exception as e:
|
|
77
|
+
console.print("[red]Error:[/red] Failed to upload manifest.json")
|
|
78
|
+
console.print(f"Reason: {e}")
|
|
79
|
+
sys.exit(4)
|
|
80
|
+
|
|
81
|
+
# Upload catalog.json
|
|
82
|
+
console.print(f'Uploading catalog from path "{catalog_path}"')
|
|
83
|
+
try:
|
|
84
|
+
with open(catalog_path, "rb") as f:
|
|
85
|
+
response = requests.put(presigned_urls["catalog_url"], data=f.read())
|
|
86
|
+
if response.status_code not in [200, 204]:
|
|
87
|
+
raise Exception(f"Upload failed with status {response.status_code}: {response.text}")
|
|
88
|
+
except Exception as e:
|
|
89
|
+
console.print("[red]Error:[/red] Failed to upload catalog.json")
|
|
90
|
+
console.print(f"Reason: {e}")
|
|
91
|
+
sys.exit(4)
|
|
92
|
+
|
|
93
|
+
# Update session metadata
|
|
94
|
+
try:
|
|
95
|
+
client.update_session(org_id, project_id, session_id, adapter_type)
|
|
96
|
+
except RecceCloudException as e:
|
|
97
|
+
console.print("[red]Error:[/red] Failed to update session metadata")
|
|
98
|
+
console.print(f"Reason: {e.reason}")
|
|
99
|
+
sys.exit(4)
|
|
100
|
+
except Exception as e:
|
|
101
|
+
console.print("[red]Error:[/red] Failed to update session metadata")
|
|
102
|
+
console.print(f"Reason: {e}")
|
|
103
|
+
sys.exit(4)
|
|
104
|
+
|
|
105
|
+
# Success!
|
|
106
|
+
console.rule("Uploaded Successfully", style="green")
|
|
107
|
+
console.print(
|
|
108
|
+
f'Uploaded dbt artifacts to Recce Cloud for session ID "{session_id}" from "{os.path.abspath(target_path)}"'
|
|
109
|
+
)
|
|
110
|
+
sys.exit(0)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def upload_with_platform_apis(
|
|
114
|
+
console, token: str, ci_info, manifest_path: str, catalog_path: str, adapter_type: str, target_path: str
|
|
115
|
+
):
|
|
116
|
+
"""
|
|
117
|
+
Upload artifacts using platform-specific APIs (GitHub Actions or GitLab CI).
|
|
118
|
+
|
|
119
|
+
This workflow uses touch-recce-session to create a session automatically.
|
|
120
|
+
"""
|
|
121
|
+
# Validate platform support
|
|
122
|
+
if ci_info.platform not in ["github-actions", "gitlab-ci"]:
|
|
123
|
+
console.print("[red]Error:[/red] Platform-specific upload requires GitHub Actions or GitLab CI environment")
|
|
124
|
+
console.print(f"Detected platform: {ci_info.platform or 'unknown'}")
|
|
125
|
+
console.print(
|
|
126
|
+
"Either run this command in a supported CI environment or provide --session-id for generic upload"
|
|
127
|
+
)
|
|
128
|
+
sys.exit(1)
|
|
129
|
+
|
|
130
|
+
# Create platform-specific client
|
|
131
|
+
try:
|
|
132
|
+
client = create_platform_client(token, ci_info)
|
|
133
|
+
except ValueError as e:
|
|
134
|
+
console.print("[red]Error:[/red] Failed to create platform client")
|
|
135
|
+
console.print(f"Reason: {e}")
|
|
136
|
+
sys.exit(2)
|
|
137
|
+
|
|
138
|
+
# Touch session to create or get session ID
|
|
139
|
+
console.rule("Creating/touching session", style="blue")
|
|
140
|
+
try:
|
|
141
|
+
session_response = client.touch_recce_session(
|
|
142
|
+
branch=ci_info.source_branch or ci_info.base_branch or "main",
|
|
143
|
+
adapter_type=adapter_type,
|
|
144
|
+
cr_number=ci_info.cr_number,
|
|
145
|
+
commit_sha=ci_info.commit_sha,
|
|
146
|
+
session_type=ci_info.session_type,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
session_id = session_response.get("session_id")
|
|
150
|
+
manifest_upload_url = session_response.get("manifest_upload_url")
|
|
151
|
+
catalog_upload_url = session_response.get("catalog_upload_url")
|
|
152
|
+
|
|
153
|
+
if not session_id or not manifest_upload_url or not catalog_upload_url:
|
|
154
|
+
console.print("[red]Error:[/red] Incomplete response from touch-recce-session API")
|
|
155
|
+
console.print(f"Response: {session_response}")
|
|
156
|
+
sys.exit(4)
|
|
157
|
+
|
|
158
|
+
console.print(f"[green]Session ID:[/green] {session_id}")
|
|
159
|
+
|
|
160
|
+
except RecceCloudException as e:
|
|
161
|
+
console.print("[red]Error:[/red] Failed to create/touch session")
|
|
162
|
+
console.print(f"Reason: {e.reason}")
|
|
163
|
+
sys.exit(4)
|
|
164
|
+
except Exception as e:
|
|
165
|
+
console.print("[red]Error:[/red] Failed to create/touch session")
|
|
166
|
+
console.print(f"Reason: {e}")
|
|
167
|
+
sys.exit(4)
|
|
168
|
+
|
|
169
|
+
# Upload manifest.json
|
|
170
|
+
console.print(f'Uploading manifest from path "{manifest_path}"')
|
|
171
|
+
try:
|
|
172
|
+
with open(manifest_path, "rb") as f:
|
|
173
|
+
response = requests.put(manifest_upload_url, data=f.read())
|
|
174
|
+
if response.status_code not in [200, 204]:
|
|
175
|
+
raise Exception(f"Upload failed with status {response.status_code}: {response.text}")
|
|
176
|
+
except Exception as e:
|
|
177
|
+
console.print("[red]Error:[/red] Failed to upload manifest.json")
|
|
178
|
+
console.print(f"Reason: {e}")
|
|
179
|
+
sys.exit(4)
|
|
180
|
+
|
|
181
|
+
# Upload catalog.json
|
|
182
|
+
console.print(f'Uploading catalog from path "{catalog_path}"')
|
|
183
|
+
try:
|
|
184
|
+
with open(catalog_path, "rb") as f:
|
|
185
|
+
response = requests.put(catalog_upload_url, data=f.read())
|
|
186
|
+
if response.status_code not in [200, 204]:
|
|
187
|
+
raise Exception(f"Upload failed with status {response.status_code}: {response.text}")
|
|
188
|
+
except Exception as e:
|
|
189
|
+
console.print("[red]Error:[/red] Failed to upload catalog.json")
|
|
190
|
+
console.print(f"Reason: {e}")
|
|
191
|
+
sys.exit(4)
|
|
192
|
+
|
|
193
|
+
# Notify upload completion
|
|
194
|
+
console.print("Notifying upload completion...")
|
|
195
|
+
try:
|
|
196
|
+
client.upload_completed(session_id=session_id, commit_sha=ci_info.commit_sha)
|
|
197
|
+
except RecceCloudException as e:
|
|
198
|
+
console.print("[yellow]Warning:[/yellow] Failed to notify upload completion")
|
|
199
|
+
console.print(f"Reason: {e.reason}")
|
|
200
|
+
# Non-fatal, continue
|
|
201
|
+
except Exception as e:
|
|
202
|
+
console.print("[yellow]Warning:[/yellow] Failed to notify upload completion")
|
|
203
|
+
console.print(f"Reason: {e}")
|
|
204
|
+
# Non-fatal, continue
|
|
205
|
+
|
|
206
|
+
# Success!
|
|
207
|
+
console.rule("Uploaded Successfully", style="green")
|
|
208
|
+
console.print(f'Uploaded dbt artifacts to Recce Cloud for session ID "{session_id}"')
|
|
209
|
+
console.print(f'Artifacts from: "{os.path.abspath(target_path)}"')
|
|
210
|
+
|
|
211
|
+
if ci_info.cr_url:
|
|
212
|
+
console.print(f"Change request: {ci_info.cr_url}")
|
|
213
|
+
|
|
214
|
+
sys.exit(0)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from unittest.mock import patch
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
|
|
5
|
+
from recce.core import set_default_context
|
|
6
|
+
|
|
7
|
+
from .dbt_test_helper import DbtTestHelper
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@pytest.fixture
|
|
11
|
+
def dbt_test_helper():
|
|
12
|
+
with patch("recce.adapter.dbt_adapter.log_performance"):
|
|
13
|
+
helper = DbtTestHelper()
|
|
14
|
+
context = helper.context
|
|
15
|
+
set_default_context(context)
|
|
16
|
+
yield helper
|
|
17
|
+
helper.cleanup()
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import textwrap
|
|
3
|
+
import uuid
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from io import StringIO
|
|
6
|
+
|
|
7
|
+
from dbt.contracts.graph.nodes import (
|
|
8
|
+
ModelNode,
|
|
9
|
+
SeedNode,
|
|
10
|
+
SnapshotNode,
|
|
11
|
+
SourceDefinition,
|
|
12
|
+
)
|
|
13
|
+
from dbt.contracts.results import (
|
|
14
|
+
CatalogArtifact,
|
|
15
|
+
CatalogTable,
|
|
16
|
+
ColumnMetadata,
|
|
17
|
+
TableMetadata,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
from recce.adapter.dbt_adapter import DbtAdapter, as_manifest, load_manifest
|
|
21
|
+
from recce.core import RecceContext
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class DbtTestHelper:
|
|
25
|
+
|
|
26
|
+
def __init__(self):
|
|
27
|
+
schema_prefix = "schema_" + uuid.uuid4().hex
|
|
28
|
+
self.base_schema = f"{schema_prefix}_base"
|
|
29
|
+
self.curr_schema = f"{schema_prefix}_curr"
|
|
30
|
+
|
|
31
|
+
current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
32
|
+
project_dir = os.path.join(current_dir, "test_proj")
|
|
33
|
+
profiles_dir = project_dir
|
|
34
|
+
manifest_path = os.path.join(project_dir, "manifest.json")
|
|
35
|
+
|
|
36
|
+
dbt_adapter = DbtAdapter.load(
|
|
37
|
+
no_artifacts=True,
|
|
38
|
+
project_dir=project_dir,
|
|
39
|
+
profiles_dir=profiles_dir,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
context = RecceContext()
|
|
43
|
+
context.adapter_type = "dbt"
|
|
44
|
+
context.adapter = dbt_adapter
|
|
45
|
+
context.schema_prefix = schema_prefix
|
|
46
|
+
self.adapter = dbt_adapter
|
|
47
|
+
self.context = context
|
|
48
|
+
curr_writable_manifest = load_manifest(manifest_path)
|
|
49
|
+
base_writable_manifest = load_manifest(manifest_path)
|
|
50
|
+
|
|
51
|
+
self.curr_manifest = as_manifest(curr_writable_manifest)
|
|
52
|
+
self.base_manifest = as_manifest(base_writable_manifest)
|
|
53
|
+
now = datetime.now()
|
|
54
|
+
self.curr_catalog = CatalogArtifact.from_results(
|
|
55
|
+
generated_at=now,
|
|
56
|
+
nodes={},
|
|
57
|
+
sources={},
|
|
58
|
+
compile_results=None,
|
|
59
|
+
errors=None,
|
|
60
|
+
)
|
|
61
|
+
self.base_catalog = CatalogArtifact.from_results(
|
|
62
|
+
generated_at=now,
|
|
63
|
+
nodes={},
|
|
64
|
+
sources={},
|
|
65
|
+
compile_results=None,
|
|
66
|
+
errors=None,
|
|
67
|
+
)
|
|
68
|
+
self.context = context
|
|
69
|
+
|
|
70
|
+
self.adapter.execute(f"CREATE schema IF NOT EXISTS {self.base_schema}")
|
|
71
|
+
self.adapter.execute(f"CREATE schema IF NOT EXISTS {self.curr_schema}")
|
|
72
|
+
self.adapter.set_artifacts(
|
|
73
|
+
base_writable_manifest,
|
|
74
|
+
curr_writable_manifest,
|
|
75
|
+
self.curr_manifest,
|
|
76
|
+
self.base_manifest,
|
|
77
|
+
self.base_catalog,
|
|
78
|
+
self.curr_catalog,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
def create_model(
|
|
82
|
+
self,
|
|
83
|
+
model_name,
|
|
84
|
+
base_csv=None,
|
|
85
|
+
curr_csv=None,
|
|
86
|
+
base_sql=None,
|
|
87
|
+
curr_sql=None,
|
|
88
|
+
depends_on=None,
|
|
89
|
+
disabled=False,
|
|
90
|
+
unique_id=None,
|
|
91
|
+
resource_type="model",
|
|
92
|
+
package_name="recce_test",
|
|
93
|
+
base_columns: dict[str, str] = None,
|
|
94
|
+
curr_columns: dict[str, str] = None,
|
|
95
|
+
patch_func=None,
|
|
96
|
+
):
|
|
97
|
+
# unique_id = f"model.{package_name}.{model_name}"
|
|
98
|
+
unique_id = unique_id if unique_id else model_name
|
|
99
|
+
if depends_on is None:
|
|
100
|
+
depends_on = []
|
|
101
|
+
|
|
102
|
+
def _add_model_to_manifest(base):
|
|
103
|
+
if base:
|
|
104
|
+
schema = self.base_schema
|
|
105
|
+
manifest = self.base_manifest
|
|
106
|
+
catalog = self.base_catalog
|
|
107
|
+
csv = base_csv
|
|
108
|
+
sql = base_sql
|
|
109
|
+
columns = base_columns
|
|
110
|
+
else:
|
|
111
|
+
schema = self.curr_schema
|
|
112
|
+
manifest = self.curr_manifest
|
|
113
|
+
catalog = self.curr_catalog
|
|
114
|
+
csv = curr_csv
|
|
115
|
+
sql = curr_sql
|
|
116
|
+
columns = curr_columns
|
|
117
|
+
|
|
118
|
+
if csv:
|
|
119
|
+
dbt_adapter = self.adapter
|
|
120
|
+
csv = textwrap.dedent(csv)
|
|
121
|
+
with dbt_adapter.connection_named("create model"):
|
|
122
|
+
import pandas as pd
|
|
123
|
+
|
|
124
|
+
df = pd.read_csv(StringIO(csv)) # noqa: F841
|
|
125
|
+
# DuckDB disables python_scan_all_frames by default after 1.1,
|
|
126
|
+
# ref: https://github.com/duckdb/duckdb/pull/13896
|
|
127
|
+
dbt_adapter.execute("SET python_scan_all_frames=true")
|
|
128
|
+
dbt_adapter.execute(f"CREATE TABLE {schema}.{model_name} AS SELECT * FROM df")
|
|
129
|
+
raw_code = sql if sql else csv
|
|
130
|
+
|
|
131
|
+
if columns:
|
|
132
|
+
index = 1
|
|
133
|
+
table = CatalogTable(TableMetadata(type="BASE TABLE", schema=schema, name=model_name), {}, {})
|
|
134
|
+
catalog.nodes[unique_id] = table
|
|
135
|
+
for column, column_type in columns.items():
|
|
136
|
+
col_data = ColumnMetadata(type=column_type, index=index, name=column)
|
|
137
|
+
catalog.nodes[unique_id].columns[column] = col_data
|
|
138
|
+
index = index + 1
|
|
139
|
+
|
|
140
|
+
node_dict = {
|
|
141
|
+
"resource_type": resource_type,
|
|
142
|
+
"name": model_name,
|
|
143
|
+
"package_name": package_name,
|
|
144
|
+
"path": "",
|
|
145
|
+
"original_file_path": "",
|
|
146
|
+
"unique_id": unique_id,
|
|
147
|
+
"fqn": [
|
|
148
|
+
package_name,
|
|
149
|
+
model_name,
|
|
150
|
+
],
|
|
151
|
+
"schema": schema,
|
|
152
|
+
"alias": model_name,
|
|
153
|
+
"checksum": {
|
|
154
|
+
"name": "sha256",
|
|
155
|
+
"checksum": hash(raw_code),
|
|
156
|
+
},
|
|
157
|
+
"raw_code": raw_code,
|
|
158
|
+
"config": {
|
|
159
|
+
"materialized": "table",
|
|
160
|
+
"tags": ["test_tag"],
|
|
161
|
+
},
|
|
162
|
+
"tags": ["test_tag"],
|
|
163
|
+
"depends_on": {"nodes": depends_on},
|
|
164
|
+
}
|
|
165
|
+
if patch_func:
|
|
166
|
+
patch_func(node_dict)
|
|
167
|
+
|
|
168
|
+
if resource_type == "snapshot":
|
|
169
|
+
node = SnapshotNode.from_dict(node_dict)
|
|
170
|
+
elif resource_type == "seed":
|
|
171
|
+
node = SeedNode.from_dict(node_dict)
|
|
172
|
+
else:
|
|
173
|
+
node = ModelNode.from_dict(node_dict)
|
|
174
|
+
|
|
175
|
+
if disabled:
|
|
176
|
+
manifest.add_disabled_nofile(node)
|
|
177
|
+
else:
|
|
178
|
+
manifest.add_node_nofile(node)
|
|
179
|
+
return node
|
|
180
|
+
|
|
181
|
+
if base_csv or base_sql:
|
|
182
|
+
_add_model_to_manifest(True)
|
|
183
|
+
|
|
184
|
+
if curr_csv or curr_sql:
|
|
185
|
+
_add_model_to_manifest(False)
|
|
186
|
+
|
|
187
|
+
self.adapter.set_artifacts(
|
|
188
|
+
self.base_manifest.writable_manifest(),
|
|
189
|
+
self.curr_manifest.writable_manifest(),
|
|
190
|
+
self.curr_manifest,
|
|
191
|
+
self.base_manifest,
|
|
192
|
+
self.base_catalog,
|
|
193
|
+
self.curr_catalog,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
def remove_model(self, model_name):
|
|
197
|
+
dbt_adapter = self.adapter
|
|
198
|
+
with dbt_adapter.connection_named("cleanup"):
|
|
199
|
+
dbt_adapter.execute(f"DROP TABLE IF EXISTS {self.base_schema}.{model_name}")
|
|
200
|
+
dbt_adapter.execute(f"DROP TABLE IF EXISTS {self.curr_schema}.{model_name} ")
|
|
201
|
+
|
|
202
|
+
def create_source(
|
|
203
|
+
self,
|
|
204
|
+
source_name,
|
|
205
|
+
table_name,
|
|
206
|
+
base_csv=None,
|
|
207
|
+
curr_csv=None,
|
|
208
|
+
unique_id=None,
|
|
209
|
+
package_name="recce_test",
|
|
210
|
+
base_columns: dict[str, str] = None,
|
|
211
|
+
curr_columns: dict[str, str] = None,
|
|
212
|
+
patch_func=None,
|
|
213
|
+
):
|
|
214
|
+
unique_id = unique_id if unique_id else f"source.{package_name}.{source_name}.{table_name}"
|
|
215
|
+
|
|
216
|
+
def _add_source_to_manifest(base):
|
|
217
|
+
if base:
|
|
218
|
+
schema = self.base_schema
|
|
219
|
+
manifest = self.base_manifest
|
|
220
|
+
catalog = self.base_catalog
|
|
221
|
+
csv = base_csv
|
|
222
|
+
columns = base_columns
|
|
223
|
+
else:
|
|
224
|
+
schema = self.curr_schema
|
|
225
|
+
manifest = self.curr_manifest
|
|
226
|
+
catalog = self.curr_catalog
|
|
227
|
+
csv = curr_csv
|
|
228
|
+
columns = curr_columns
|
|
229
|
+
|
|
230
|
+
if csv:
|
|
231
|
+
dbt_adapter = self.adapter
|
|
232
|
+
csv = textwrap.dedent(csv)
|
|
233
|
+
with dbt_adapter.connection_named("create source"):
|
|
234
|
+
import pandas as pd
|
|
235
|
+
|
|
236
|
+
df = pd.read_csv(StringIO(csv)) # noqa: F841
|
|
237
|
+
# DuckDB disables python_scan_all_frames by default after 1.1,
|
|
238
|
+
# ref: https://github.com/duckdb/duckdb/pull/13896
|
|
239
|
+
dbt_adapter.execute("SET python_scan_all_frames=true")
|
|
240
|
+
dbt_adapter.execute(f"CREATE TABLE {schema}.{table_name} AS SELECT * FROM df")
|
|
241
|
+
|
|
242
|
+
if columns:
|
|
243
|
+
index = 1
|
|
244
|
+
table = CatalogTable(TableMetadata(type="BASE TABLE", schema=schema, name=table_name), {}, {})
|
|
245
|
+
catalog.sources[unique_id] = table
|
|
246
|
+
for column, column_type in columns.items():
|
|
247
|
+
col_data = ColumnMetadata(type=column_type, index=index, name=column)
|
|
248
|
+
catalog.sources[unique_id].columns[column] = col_data
|
|
249
|
+
index = index + 1
|
|
250
|
+
|
|
251
|
+
node_dict = {
|
|
252
|
+
"resource_type": "source",
|
|
253
|
+
"source_name": source_name,
|
|
254
|
+
"name": table_name,
|
|
255
|
+
"identifier": table_name,
|
|
256
|
+
"source_description": "test source",
|
|
257
|
+
"loader": "",
|
|
258
|
+
"package_name": package_name,
|
|
259
|
+
"path": "",
|
|
260
|
+
"original_file_path": "",
|
|
261
|
+
"unique_id": unique_id,
|
|
262
|
+
"fqn": [
|
|
263
|
+
package_name,
|
|
264
|
+
source_name,
|
|
265
|
+
table_name,
|
|
266
|
+
],
|
|
267
|
+
"schema": schema,
|
|
268
|
+
}
|
|
269
|
+
if patch_func:
|
|
270
|
+
patch_func(node_dict)
|
|
271
|
+
|
|
272
|
+
source = SourceDefinition.from_dict(node_dict)
|
|
273
|
+
manifest.sources[unique_id] = source
|
|
274
|
+
return source
|
|
275
|
+
|
|
276
|
+
if base_csv:
|
|
277
|
+
_add_source_to_manifest(True)
|
|
278
|
+
|
|
279
|
+
if curr_csv:
|
|
280
|
+
_add_source_to_manifest(False)
|
|
281
|
+
|
|
282
|
+
self.adapter.set_artifacts(
|
|
283
|
+
self.base_manifest.writable_manifest(),
|
|
284
|
+
self.curr_manifest.writable_manifest(),
|
|
285
|
+
self.curr_manifest,
|
|
286
|
+
self.base_manifest,
|
|
287
|
+
self.base_catalog,
|
|
288
|
+
self.curr_catalog,
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
def cleanup(self):
|
|
292
|
+
dbt_adapter = self.adapter
|
|
293
|
+
with dbt_adapter.connection_named("cleanup"):
|
|
294
|
+
dbt_adapter.execute(f"DROP SCHEMA IF EXISTS {self.base_schema} CASCADE")
|
|
295
|
+
dbt_adapter.execute(f"DROP SCHEMA IF EXISTS {self.curr_schema} CASCADE")
|
|
296
|
+
|
|
297
|
+
def create_snapshot(self, sanpshot_name, base_csv, curr_csv, depends_on=[]):
|
|
298
|
+
self.create_model(sanpshot_name, base_csv, curr_csv, depends_on=depends_on, resource_type="snapshot")
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from recce.adapter.dbt_adapter import DbtAdapter, dbt_supported_registry
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_dbt_adapter_support_tasks(dbt_test_helper):
|
|
5
|
+
adapter: DbtAdapter = dbt_test_helper.context.adapter
|
|
6
|
+
|
|
7
|
+
# Test dbt task support
|
|
8
|
+
support_tasks = adapter.support_tasks()
|
|
9
|
+
|
|
10
|
+
for task_type in dbt_supported_registry:
|
|
11
|
+
task = task_type.value
|
|
12
|
+
assert task in support_tasks
|
|
13
|
+
assert support_tasks[task] is True
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def test_dbt_adapter_support_tasks_without_required_dbt_package(dbt_test_helper):
|
|
17
|
+
adapter: DbtAdapter = dbt_test_helper.context.adapter
|
|
18
|
+
# Mock the macros in manifest to simulate no required dbt package installed
|
|
19
|
+
adapter.manifest.macros = {}
|
|
20
|
+
|
|
21
|
+
support_tasks = adapter.support_tasks()
|
|
22
|
+
|
|
23
|
+
for task_type in dbt_supported_registry:
|
|
24
|
+
task = task_type.value
|
|
25
|
+
assert task in support_tasks
|