mage-ai 0.9.55__py3-none-any.whl → 0.9.57__py3-none-any.whl
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.
Potentially problematic release.
This version of mage-ai might be problematic. Click here for more details.
- mage_ai/api/parsers/ProjectParser.py +29 -0
- mage_ai/api/policies/BlockPolicy.py +1 -0
- mage_ai/api/policies/CustomDesignPolicy.py +3 -0
- mage_ai/api/policies/GitBranchPolicy.py +9 -0
- mage_ai/api/policies/GitCustomBranchPolicy.py +1 -0
- mage_ai/api/policies/GlobalHookPolicy.py +3 -0
- mage_ai/api/policies/ProjectPolicy.py +28 -0
- mage_ai/api/presenters/ProjectPresenter.py +4 -0
- mage_ai/api/resources/BlockResource.py +14 -1
- mage_ai/api/resources/FileResource.py +1 -1
- mage_ai/api/resources/GitFileResource.py +1 -1
- mage_ai/api/resources/GlobalHookResource.py +55 -10
- mage_ai/api/resources/PipelineResource.py +12 -11
- mage_ai/api/resources/ProjectResource.py +95 -7
- mage_ai/authentication/operation_history/models.py +1 -1
- mage_ai/cache/dbt/cache.py +1 -1
- mage_ai/cache/dbt/utils.py +22 -2
- mage_ai/cluster_manager/kubernetes/workload_manager.py +17 -7
- mage_ai/data_preparation/models/block/__init__.py +71 -5
- mage_ai/data_preparation/models/block/dbt/block_sql.py +13 -3
- mage_ai/data_preparation/models/block/dbt/dbt_adapter.py +15 -1
- mage_ai/data_preparation/models/block/dbt/profiles.py +14 -12
- mage_ai/data_preparation/models/block/platform/mixins.py +6 -2
- mage_ai/data_preparation/models/block/platform/utils.py +9 -1
- mage_ai/data_preparation/models/file.py +1 -1
- mage_ai/data_preparation/models/global_hooks/models.py +2 -2
- mage_ai/data_preparation/models/project/__init__.py +74 -4
- mage_ai/data_preparation/models/project/constants.py +1 -0
- mage_ai/data_preparation/repo_manager.py +3 -0
- mage_ai/orchestration/db/models/schedules.py +64 -102
- mage_ai/orchestration/db/models/schedules_project_platform.py +365 -0
- mage_ai/orchestration/pipeline_scheduler.py +5 -1700
- mage_ai/orchestration/pipeline_scheduler_original.py +1635 -0
- mage_ai/orchestration/pipeline_scheduler_project_platform.py +1701 -0
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/_next/static/A7VXVGKgLQCukXcjdysDz/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1557-724bfc3eabd095f7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/161-33f26e485ddef393.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2646-78905b899b68f4eb.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3419-ad674b271b8520ce.js → frontend_dist/_next/static/chunks/3419-b8bd26f5946bec5a.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3437-ce26fc28e114b44e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3540-9bb48b08f439d0a0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3745-61b1c63bb56bb670.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{5729.0f2748e9e6dab951.js → 5189.dca121eccea793be.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5457-b373ebdf4d05d8e2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5533-3455832bc3f8429b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5729-9d8204ab91da631d.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/5810-e26a0768db1cfdba.js → frontend_dist/_next/static/chunks/5810-addfa3491ae6b01c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8264-68db2a8334ad48f1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8432-0ace6fb7bdbc6864.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8731-82571147875a2d58.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/874-d9e1b3c9c00ebac9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9264-5df6e4c7b1e85c02.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{_app-0d183e2f234d52c6.js → _app-4c0239ca6203e827.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-822e66aa2e90cf4c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-373217c5de51aeef.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/{[...slug]-1e4838e534c8f31e.js → [...slug]-0325e76a2f3e08c1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-bb38f73540efeac4.js → global-data-products-927ebbdc29529765.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-a172f5a447bd8925.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-97bec2ac883e0c26.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-02d001d99eeaae3f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-2e577bfd4f0db2b7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-1827574a4ba95a72.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-a913c361bcc0d1a9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-4e6fdcbbfc931d67.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-1c327edcf05df9c9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{oauth-eba7027969034415.js → oauth-bd8494f8875c5c97.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-5a98e6a531410afb.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-1442183d13edec2e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-b526282c8ac49986.js → [...slug]-38b2241cdd10320c.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-515eb343210aa1fb.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-1c646dbef65d6a69.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{dashboard-fe4d1321da8291cb.js → dashboard-35cb916a18ac4e1f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-cd1918632dfef29d.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{logs-c011d465f61138ee.js → logs-67b0572c84db0940.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-46c0dabd155581a0.js → block-runs-40201b626ea3a664.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-f2a052cb8a20fe47.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-d1f23308effebe03.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-579899cbaedcdefc.js → monitors-9a116d88f00916ff.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-7a2265b7e44bed0b.js → [run]-2d5abcd019d4bea1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{runs-9b53da919db959bd.js → runs-5363a7ae9afe8983.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{settings-1839276725bfd757.js → settings-931a1b3112866a72.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{syncs-68d779bc62185470.js → syncs-5ec5367cb877db38.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-01f4528602f4ba2a.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-8366661f8e2b2959.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-358523847fdbf547.js → triggers-378f8dada7d0c1dd.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-627be24ef4963cfb.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks/[...slug]-814bbd11e10c26dc.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks-021ec25e05862f8f.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-00393e67ab1e6788.js → frontend_dist/_next/static/chunks/pages/settings/account/profile-2b0aa123043519b8.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-05186e17c94347c1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/settings-efe8bf1bf3177a7e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-eaeba99f9547a20a.js → [...slug]-aa5d871de1f3f7b0.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-c3140516cc28e467.js → permissions-ce45aad47049d993.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-1bc694b056ff0bcb.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-f6ff0e219a4b9ffd.js → [...slug]-88d29d1774db67e4.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-22ff9d862736b2ec.js → roles-d8ca763e405cd9d1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{sync-data-614925e838d1974c.js → sync-data-42bd909eb8951040.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-5b88dfb1c6d0d16c.js → [...slug]-250dfdf22bfe67e9.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-eb904db7ac7ea57c.js → users-97c4ce119f7238b5.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-dcdd0c71f99aebad.js → frontend_dist/_next/static/chunks/pages/sign-in-1af3ba18ff646dd4.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-ff9d49355393daea.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{templates-5ebfe79c24d8c4b4.js → templates-299a2c8f2dd89cf3.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-fb3f398009a02879.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-59a08e06f4ef6c3a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-551b85802515e313.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-1362aeda4a31dd41.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{webpack-fea697dd168c6d0c.js → webpack-17c3a8f588f14cfd.js} +1 -1
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/compute.html +2 -2
- mage_ai/server/frontend_dist/files.html +2 -2
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-data-products.html +2 -2
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-hooks.html +2 -2
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/files.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +2 -2
- mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist/manage/users.html +2 -2
- mage_ai/server/frontend_dist/manage.html +2 -2
- mage_ai/server/frontend_dist/oauth.html +3 -3
- mage_ai/server/frontend_dist/overview.html +2 -2
- mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +2 -2
- mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +24 -0
- mage_ai/server/frontend_dist/platform/global-hooks.html +24 -0
- mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist/settings/platform/preferences.html +24 -0
- mage_ai/server/frontend_dist/settings/platform/settings.html +24 -0
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +3 -3
- mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist/templates.html +2 -2
- mage_ai/server/frontend_dist/terminal.html +2 -2
- mage_ai/server/frontend_dist/test.html +2 -2
- mage_ai/server/frontend_dist/triggers.html +2 -2
- mage_ai/server/frontend_dist/version-control.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html +4 -4
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-724bfc3eabd095f7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/161-33f26e485ddef393.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2646-78905b899b68f4eb.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/3419-ad674b271b8520ce.js → frontend_dist_base_path_template/_next/static/chunks/3419-b8bd26f5946bec5a.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3437-ce26fc28e114b44e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3540-9bb48b08f439d0a0.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3745-61b1c63bb56bb670.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5729.0f2748e9e6dab951.js → 5189.dca121eccea793be.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-b373ebdf4d05d8e2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5533-3455832bc3f8429b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5729-9d8204ab91da631d.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/5810-e26a0768db1cfdba.js → frontend_dist_base_path_template/_next/static/chunks/5810-addfa3491ae6b01c.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-68db2a8334ad48f1.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8432-0ace6fb7bdbc6864.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8731-82571147875a2d58.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/874-d9e1b3c9c00ebac9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-5df6e4c7b1e85c02.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{_app-0d183e2f234d52c6.js → _app-4c0239ca6203e827.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-822e66aa2e90cf4c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-373217c5de51aeef.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/{[...slug]-1e4838e534c8f31e.js → [...slug]-0325e76a2f3e08c1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-bb38f73540efeac4.js → global-data-products-927ebbdc29529765.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-a172f5a447bd8925.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-97bec2ac883e0c26.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-02d001d99eeaae3f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-2e577bfd4f0db2b7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-1827574a4ba95a72.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-a913c361bcc0d1a9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-4e6fdcbbfc931d67.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-1c327edcf05df9c9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{oauth-eba7027969034415.js → oauth-bd8494f8875c5c97.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-5a98e6a531410afb.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-1442183d13edec2e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-b526282c8ac49986.js → [...slug]-38b2241cdd10320c.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-515eb343210aa1fb.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-1c646dbef65d6a69.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{dashboard-fe4d1321da8291cb.js → dashboard-35cb916a18ac4e1f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-cd1918632dfef29d.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{logs-c011d465f61138ee.js → logs-67b0572c84db0940.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-46c0dabd155581a0.js → block-runs-40201b626ea3a664.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-f2a052cb8a20fe47.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-d1f23308effebe03.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-579899cbaedcdefc.js → monitors-9a116d88f00916ff.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-7a2265b7e44bed0b.js → [run]-2d5abcd019d4bea1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{runs-9b53da919db959bd.js → runs-5363a7ae9afe8983.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{settings-1839276725bfd757.js → settings-931a1b3112866a72.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{syncs-68d779bc62185470.js → syncs-5ec5367cb877db38.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-01f4528602f4ba2a.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-8366661f8e2b2959.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-358523847fdbf547.js → triggers-378f8dada7d0c1dd.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-627be24ef4963cfb.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks/[...slug]-814bbd11e10c26dc.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-021ec25e05862f8f.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/settings/account/profile-00393e67ab1e6788.js → frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-2b0aa123043519b8.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-05186e17c94347c1.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-efe8bf1bf3177a7e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-eaeba99f9547a20a.js → [...slug]-aa5d871de1f3f7b0.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-c3140516cc28e467.js → permissions-ce45aad47049d993.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-1bc694b056ff0bcb.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-f6ff0e219a4b9ffd.js → [...slug]-88d29d1774db67e4.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-22ff9d862736b2ec.js → roles-d8ca763e405cd9d1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{sync-data-614925e838d1974c.js → sync-data-42bd909eb8951040.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-5b88dfb1c6d0d16c.js → [...slug]-250dfdf22bfe67e9.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{users-eb904db7ac7ea57c.js → users-97c4ce119f7238b5.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/sign-in-dcdd0c71f99aebad.js → frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-1af3ba18ff646dd4.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-ff9d49355393daea.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{templates-5ebfe79c24d8c4b4.js → templates-299a2c8f2dd89cf3.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-fb3f398009a02879.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-59a08e06f4ef6c3a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-551b85802515e313.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-1362aeda4a31dd41.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-d30cb09c85b4c4f0.js → webpack-b55fe1e575d8ac9d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/wSRrM15xnvA8lOWcaque7/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/compute.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/files.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/oauth.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/overview.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +24 -0
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +24 -0
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +24 -0
- mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +24 -0
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/templates.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/terminal.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/test.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/version-control.html +5 -5
- mage_ai/server/websocket_server.py +33 -22
- mage_ai/settings/models/configuration_option.py +15 -1
- mage_ai/settings/platform/__init__.py +44 -20
- mage_ai/shared/io.py +3 -0
- mage_ai/streaming/sinks/rabbitmq.py +3 -1
- mage_ai/streaming/sources/rabbitmq.py +5 -2
- mage_ai/tests/api/endpoints/test_pipeline_runs.py +4 -0
- mage_ai/tests/api/endpoints/test_projects.py +1 -0
- mage_ai/tests/api/resources/test_pipeline_resource.py +2 -2
- mage_ai/tests/data_preparation/models/block/platform/test_mixins.py +4 -3
- mage_ai/tests/data_preparation/models/test_block.py +2 -1
- mage_ai/tests/data_preparation/models/test_project.py +27 -7
- mage_ai/tests/orchestration/db/models/test_schedules.py +25 -7
- mage_ai/tests/orchestration/test_pipeline_scheduler.py +6 -261
- mage_ai/tests/orchestration/test_pipeline_scheduler_project_platform.py +286 -0
- mage_ai/tests/shared/mixins.py +1 -0
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/METADATA +1 -1
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/RECORD +309 -286
- mage_ai/server/frontend_dist/_next/static/7yQskzl_RfcpoOQn1DPQV/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1125-fbdaaef471846c61.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1952-c4ba37bc172d7051.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2646-d8612648f7836101.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3437-91f6098316edaf17.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3745-0aacee8ac93a042a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5332-c5abdf5c8d65a52e.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5457-6e700aadac17ceec.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8264-dad1f090c4278137.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8432-ec2b97cbf32ec5a7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8731-9e0ad513b0dfce83.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/874-18d9f33cdd028e9d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9264-4428392376aa9dd4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9626-2627bc34f11b2906.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-5ead3afa88d14721.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-87b31b998e9f1222.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-a7d74042d52c3c38.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-cf7f1ba0b44ec0fb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-899b362caff47d4d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-b9ddd48737fba474.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-1e8731ba2559fef4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-a6307396dfa82c88.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-fc5aafe5085739a9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-c008f0201864d693.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-321f47b2dba4c780.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-bf4d162b5460acc6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-62ee3e957688c725.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-33d9fb90871be84c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-f4ff09cfff8bad46.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-04b0a55e8ad6f814.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-88025dd0ed3051a6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/test-b936dd972db94c6b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-e5e49ac3b9282aaa.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-a5372e488b5f44a2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/2_SHgS8M315ekLG0qkZzC/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1125-fbdaaef471846c61.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-c4ba37bc172d7051.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2646-d8612648f7836101.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3437-91f6098316edaf17.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3745-0aacee8ac93a042a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5332-c5abdf5c8d65a52e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-6e700aadac17ceec.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-dad1f090c4278137.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8432-ec2b97cbf32ec5a7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8731-9e0ad513b0dfce83.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/874-18d9f33cdd028e9d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-4428392376aa9dd4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9626-2627bc34f11b2906.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-5ead3afa88d14721.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-87b31b998e9f1222.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-a7d74042d52c3c38.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-cf7f1ba0b44ec0fb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-899b362caff47d4d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-b9ddd48737fba474.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-1e8731ba2559fef4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-a6307396dfa82c88.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-fc5aafe5085739a9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-c008f0201864d693.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-321f47b2dba4c780.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-bf4d162b5460acc6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-62ee3e957688c725.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-33d9fb90871be84c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-f4ff09cfff8bad46.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-04b0a55e8ad6f814.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-88025dd0ed3051a6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-b936dd972db94c6b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-e5e49ac3b9282aaa.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-a5372e488b5f44a2.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{7yQskzl_RfcpoOQn1DPQV → A7VXVGKgLQCukXcjdysDz}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{2_SHgS8M315ekLG0qkZzC → wSRrM15xnvA8lOWcaque7}/_ssgManifest.js +0 -0
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.55.dist-info → mage_ai-0.9.57.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from typing import Dict
|
|
2
|
+
|
|
3
|
+
from mage_ai.api.constants import AuthorizeStatusType
|
|
4
|
+
from mage_ai.api.oauth_scope import OauthScopeType
|
|
5
|
+
from mage_ai.api.operations.constants import OperationType
|
|
6
|
+
from mage_ai.api.parsers.BaseParser import BaseParser
|
|
7
|
+
from mage_ai.shared.hash import extract
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ProjectParser(BaseParser):
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
async def parse_read(parser, value: Dict, **kwargs) -> Dict:
|
|
15
|
+
return extract(value, ['features'])
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
ProjectParser.parse_read(
|
|
19
|
+
parser=parse_read,
|
|
20
|
+
on_action=[
|
|
21
|
+
OperationType.LIST,
|
|
22
|
+
],
|
|
23
|
+
on_authorize_status=[
|
|
24
|
+
AuthorizeStatusType.FAILED,
|
|
25
|
+
],
|
|
26
|
+
scopes=[
|
|
27
|
+
OauthScopeType.CLIENT_PUBLIC,
|
|
28
|
+
],
|
|
29
|
+
)
|
|
@@ -15,6 +15,7 @@ CustomDesignPolicy.allow_actions(
|
|
|
15
15
|
],
|
|
16
16
|
scopes=[
|
|
17
17
|
OauthScope.CLIENT_PRIVATE,
|
|
18
|
+
OauthScope.CLIENT_PUBLIC,
|
|
18
19
|
],
|
|
19
20
|
condition=lambda policy: policy.has_at_least_viewer_role(),
|
|
20
21
|
override_permission_condition=lambda _policy: True,
|
|
@@ -25,6 +26,7 @@ CustomDesignPolicy.allow_read(
|
|
|
25
26
|
CustomDesignPresenter.default_attributes + [],
|
|
26
27
|
scopes=[
|
|
27
28
|
OauthScope.CLIENT_PRIVATE,
|
|
29
|
+
OauthScope.CLIENT_PUBLIC,
|
|
28
30
|
],
|
|
29
31
|
on_action=[
|
|
30
32
|
OperationType.DETAIL,
|
|
@@ -50,6 +52,7 @@ CustomDesignPolicy.allow_query(
|
|
|
50
52
|
],
|
|
51
53
|
scopes=[
|
|
52
54
|
OauthScope.CLIENT_PRIVATE,
|
|
55
|
+
OauthScope.CLIENT_PUBLIC,
|
|
53
56
|
],
|
|
54
57
|
on_action=[
|
|
55
58
|
OperationType.DETAIL,
|
|
@@ -41,13 +41,22 @@ GitBranchPolicy.allow_write(GitBranchPresenter.default_attributes, scopes=[
|
|
|
41
41
|
], condition=lambda policy: policy.has_at_least_editor_role())
|
|
42
42
|
|
|
43
43
|
GitBranchPolicy.allow_write(GitBranchPresenter.default_attributes + [
|
|
44
|
+
'add',
|
|
45
|
+
'add_remote',
|
|
46
|
+
'add_remote',
|
|
47
|
+
'checkout',
|
|
48
|
+
'clone',
|
|
49
|
+
'commit',
|
|
44
50
|
'delete',
|
|
51
|
+
'fetch',
|
|
45
52
|
'merge',
|
|
46
53
|
'pull',
|
|
47
54
|
'push',
|
|
48
55
|
'rebase',
|
|
49
56
|
'remote',
|
|
57
|
+
'remove_remote',
|
|
50
58
|
'reset',
|
|
59
|
+
'status',
|
|
51
60
|
], scopes=[
|
|
52
61
|
OauthScope.CLIENT_PRIVATE
|
|
53
62
|
], on_action=[
|
|
@@ -42,6 +42,7 @@ GitCustomBranchPolicy.allow_write(GitBranchPresenter.default_attributes, scopes=
|
|
|
42
42
|
], condition=lambda policy: policy.has_at_least_editor_role())
|
|
43
43
|
|
|
44
44
|
GitCustomBranchPolicy.allow_write(GitBranchPresenter.default_attributes + [
|
|
45
|
+
'clone',
|
|
45
46
|
'delete',
|
|
46
47
|
'fetch',
|
|
47
48
|
'merge',
|
|
@@ -10,6 +10,7 @@ WRITEABLE_ATTRIBUTES = [
|
|
|
10
10
|
'pipeline',
|
|
11
11
|
'predicate',
|
|
12
12
|
'resource_type',
|
|
13
|
+
'root_project',
|
|
13
14
|
'run_settings',
|
|
14
15
|
'stages',
|
|
15
16
|
'strategies',
|
|
@@ -92,6 +93,7 @@ GlobalHookPolicy.allow_query(
|
|
|
92
93
|
'include_snapshot_validation',
|
|
93
94
|
'operation_type[]',
|
|
94
95
|
'resource_type[]',
|
|
96
|
+
'root_project',
|
|
95
97
|
],
|
|
96
98
|
scopes=[
|
|
97
99
|
OauthScope.CLIENT_PRIVATE,
|
|
@@ -111,6 +113,7 @@ GlobalHookPolicy.allow_query(
|
|
|
111
113
|
'include_snapshot_validation',
|
|
112
114
|
'operation_type',
|
|
113
115
|
'resource_type',
|
|
116
|
+
'root_project',
|
|
114
117
|
],
|
|
115
118
|
scopes=[
|
|
116
119
|
OauthScope.CLIENT_PRIVATE,
|
|
@@ -12,8 +12,15 @@ ProjectPolicy.allow_actions([
|
|
|
12
12
|
constants.LIST,
|
|
13
13
|
], scopes=[
|
|
14
14
|
OauthScope.CLIENT_PRIVATE,
|
|
15
|
+
OauthScope.CLIENT_PUBLIC,
|
|
15
16
|
], condition=lambda policy: policy.has_at_least_viewer_role())
|
|
16
17
|
|
|
18
|
+
ProjectPolicy.allow_actions([
|
|
19
|
+
constants.CREATE,
|
|
20
|
+
], scopes=[
|
|
21
|
+
OauthScope.CLIENT_PRIVATE,
|
|
22
|
+
], condition=lambda policy: policy.has_at_least_editor_role())
|
|
23
|
+
|
|
17
24
|
ProjectPolicy.allow_actions([
|
|
18
25
|
constants.UPDATE,
|
|
19
26
|
], scopes=[
|
|
@@ -24,10 +31,29 @@ ProjectPolicy.allow_read(ProjectPresenter.default_attributes + [
|
|
|
24
31
|
], scopes=[
|
|
25
32
|
OauthScope.CLIENT_PRIVATE,
|
|
26
33
|
], on_action=[
|
|
34
|
+
constants.CREATE,
|
|
27
35
|
constants.LIST,
|
|
28
36
|
constants.UPDATE,
|
|
29
37
|
], condition=lambda policy: policy.has_at_least_viewer_role())
|
|
30
38
|
|
|
39
|
+
ProjectPolicy.allow_read([
|
|
40
|
+
'features',
|
|
41
|
+
], scopes=[
|
|
42
|
+
OauthScope.CLIENT_PUBLIC,
|
|
43
|
+
], on_action=[
|
|
44
|
+
constants.LIST,
|
|
45
|
+
])
|
|
46
|
+
|
|
47
|
+
ProjectPolicy.allow_write([
|
|
48
|
+
'repo_path',
|
|
49
|
+
'uuid',
|
|
50
|
+
'type',
|
|
51
|
+
], scopes=[
|
|
52
|
+
OauthScope.CLIENT_PRIVATE,
|
|
53
|
+
], on_action=[
|
|
54
|
+
constants.CREATE,
|
|
55
|
+
], condition=lambda policy: policy.has_at_least_editor_role())
|
|
56
|
+
|
|
31
57
|
ProjectPolicy.allow_write([
|
|
32
58
|
'help_improve_mage',
|
|
33
59
|
], scopes=[
|
|
@@ -42,7 +68,9 @@ ProjectPolicy.allow_write([
|
|
|
42
68
|
'features',
|
|
43
69
|
'openai_api_key',
|
|
44
70
|
'pipelines',
|
|
71
|
+
'platform_settings',
|
|
45
72
|
'remote_variables_dir',
|
|
73
|
+
'root_project',
|
|
46
74
|
'spark_config',
|
|
47
75
|
], scopes=[
|
|
48
76
|
OauthScope.CLIENT_PRIVATE,
|
|
@@ -5,11 +5,14 @@ class ProjectPresenter(BasePresenter):
|
|
|
5
5
|
default_attributes = [
|
|
6
6
|
'emr_config',
|
|
7
7
|
'features',
|
|
8
|
+
'features_defined',
|
|
9
|
+
'features_override',
|
|
8
10
|
'help_improve_mage',
|
|
9
11
|
'latest_version',
|
|
10
12
|
'name',
|
|
11
13
|
'openai_api_key',
|
|
12
14
|
'pipelines',
|
|
15
|
+
'platform_settings',
|
|
13
16
|
'project_uuid',
|
|
14
17
|
'projects',
|
|
15
18
|
'remote_variables_dir',
|
|
@@ -18,4 +21,5 @@ class ProjectPresenter(BasePresenter):
|
|
|
18
21
|
'settings',
|
|
19
22
|
'spark_config',
|
|
20
23
|
'version',
|
|
24
|
+
'workspace_config_defaults',
|
|
21
25
|
]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import math
|
|
2
|
+
import os
|
|
2
3
|
import urllib.parse
|
|
3
4
|
from typing import Dict
|
|
4
5
|
|
|
@@ -837,6 +838,7 @@ class BlockResource(GenericResource):
|
|
|
837
838
|
|
|
838
839
|
pipeline = kwargs.get('parent_model')
|
|
839
840
|
if pipeline:
|
|
841
|
+
pk = urllib.parse.unquote(pk)
|
|
840
842
|
block = pipeline.get_block(pk, block_type=block_type, extension_uuid=extension_uuid)
|
|
841
843
|
if block:
|
|
842
844
|
return self(block, user, **kwargs)
|
|
@@ -849,6 +851,17 @@ class BlockResource(GenericResource):
|
|
|
849
851
|
error.update(message=message)
|
|
850
852
|
raise ApiError(error)
|
|
851
853
|
|
|
854
|
+
file_path = query.get('file_path', [None])
|
|
855
|
+
if file_path:
|
|
856
|
+
file_path = file_path[0]
|
|
857
|
+
if file_path:
|
|
858
|
+
block = Block.get_block_from_file_path(urllib.parse.unquote(file_path))
|
|
859
|
+
if block:
|
|
860
|
+
return self(block, user, **kwargs)
|
|
861
|
+
else:
|
|
862
|
+
error.update(ApiError.RESOURCE_NOT_FOUND)
|
|
863
|
+
raise ApiError(error)
|
|
864
|
+
|
|
852
865
|
block_type_and_uuid = urllib.parse.unquote(pk)
|
|
853
866
|
parts = block_type_and_uuid.split('/')
|
|
854
867
|
|
|
@@ -857,7 +870,7 @@ class BlockResource(GenericResource):
|
|
|
857
870
|
raise ApiError(error)
|
|
858
871
|
|
|
859
872
|
block_type = parts[0]
|
|
860
|
-
block_uuid_with_extension =
|
|
873
|
+
block_uuid_with_extension = os.path.sep.join(parts[1:])
|
|
861
874
|
parts2 = block_uuid_with_extension.split('.')
|
|
862
875
|
|
|
863
876
|
language = None
|
|
@@ -107,7 +107,7 @@ class FileResource(GenericResource):
|
|
|
107
107
|
@safe_db_query
|
|
108
108
|
def get_model(self, pk, **kwargs):
|
|
109
109
|
file_path = urllib.parse.unquote(pk)
|
|
110
|
-
return File.from_path(file_path, get_repo_path())
|
|
110
|
+
return File.from_path(file_path, get_repo_path(root_project=True))
|
|
111
111
|
|
|
112
112
|
@safe_db_query
|
|
113
113
|
def delete(self, **kwargs):
|
|
@@ -55,7 +55,7 @@ class GitFileResource(GenericResource):
|
|
|
55
55
|
error = str(err)
|
|
56
56
|
|
|
57
57
|
return self(dict(
|
|
58
|
-
content=file.content(),
|
|
58
|
+
content=file.content() if os.isfile(file.file_path) else None,
|
|
59
59
|
content_from_base=content_from_base,
|
|
60
60
|
content_from_compare=content_from_compare,
|
|
61
61
|
error=error,
|
|
@@ -15,6 +15,7 @@ from mage_ai.data_preparation.models.global_hooks.models import (
|
|
|
15
15
|
)
|
|
16
16
|
from mage_ai.data_preparation.models.pipeline import Pipeline
|
|
17
17
|
from mage_ai.orchestration.db.models.oauth import User
|
|
18
|
+
from mage_ai.settings.utils import base_repo_path
|
|
18
19
|
from mage_ai.shared.array import find
|
|
19
20
|
from mage_ai.shared.hash import ignore_keys
|
|
20
21
|
|
|
@@ -34,7 +35,14 @@ class GlobalHookResource(AsyncBaseResource):
|
|
|
34
35
|
if isinstance(resource_types, str):
|
|
35
36
|
resource_types = [EntityName(m) for m in resource_types.split(',') if m]
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
root_project = query.get('root_project', [False])
|
|
39
|
+
if root_project:
|
|
40
|
+
root_project = root_project[0]
|
|
41
|
+
|
|
42
|
+
global_hooks = GlobalHooks.load_from_file(
|
|
43
|
+
all_global_hooks=False,
|
|
44
|
+
repo_path=base_repo_path() if root_project else None,
|
|
45
|
+
)
|
|
38
46
|
|
|
39
47
|
return self.build_result_set(
|
|
40
48
|
global_hooks.hooks(
|
|
@@ -47,6 +55,14 @@ class GlobalHookResource(AsyncBaseResource):
|
|
|
47
55
|
|
|
48
56
|
@classmethod
|
|
49
57
|
async def create(self, payload: Dict, user: User, **kwargs) -> 'GlobalHookResource':
|
|
58
|
+
query = kwargs.get('query') or {}
|
|
59
|
+
|
|
60
|
+
root_project = query.get('root_project', [False])
|
|
61
|
+
if root_project:
|
|
62
|
+
root_project = root_project[0]
|
|
63
|
+
if not root_project:
|
|
64
|
+
root_project = payload.get('root_project')
|
|
65
|
+
|
|
50
66
|
if user and user.id:
|
|
51
67
|
payload['metadata'] = dict(
|
|
52
68
|
user=dict(
|
|
@@ -54,7 +70,7 @@ class GlobalHookResource(AsyncBaseResource):
|
|
|
54
70
|
),
|
|
55
71
|
)
|
|
56
72
|
|
|
57
|
-
hook = Hook.load(**payload)
|
|
73
|
+
hook = Hook.load(**ignore_keys(payload, ['root_project']))
|
|
58
74
|
|
|
59
75
|
if not hook.uuid or not hook.resource_type or not hook.operation_type:
|
|
60
76
|
missing = []
|
|
@@ -78,7 +94,10 @@ class GlobalHookResource(AsyncBaseResource):
|
|
|
78
94
|
)
|
|
79
95
|
raise ApiError(error)
|
|
80
96
|
|
|
81
|
-
global_hooks = GlobalHooks.load_from_file(
|
|
97
|
+
global_hooks = GlobalHooks.load_from_file(
|
|
98
|
+
all_global_hooks=False,
|
|
99
|
+
repo_path=base_repo_path() if root_project else None,
|
|
100
|
+
)
|
|
82
101
|
if global_hooks.get_hook(
|
|
83
102
|
operation_type=hook.operation_type,
|
|
84
103
|
resource_type=hook.resource_type,
|
|
@@ -92,7 +111,7 @@ class GlobalHookResource(AsyncBaseResource):
|
|
|
92
111
|
raise ApiError(error)
|
|
93
112
|
|
|
94
113
|
global_hooks.add_hook(hook, snapshot=True)
|
|
95
|
-
global_hooks.save()
|
|
114
|
+
global_hooks.save(repo_path=base_repo_path() if root_project else None)
|
|
96
115
|
|
|
97
116
|
return self(hook, user, **kwargs)
|
|
98
117
|
|
|
@@ -104,6 +123,10 @@ class GlobalHookResource(AsyncBaseResource):
|
|
|
104
123
|
if resource_type:
|
|
105
124
|
resource_type = resource_type[0]
|
|
106
125
|
|
|
126
|
+
root_project = query.get('root_project', [False])
|
|
127
|
+
if root_project:
|
|
128
|
+
root_project = root_project[0]
|
|
129
|
+
|
|
107
130
|
operation_type = query.get('operation_type', [None])
|
|
108
131
|
if operation_type:
|
|
109
132
|
operation_type = operation_type[0]
|
|
@@ -116,7 +139,10 @@ class GlobalHookResource(AsyncBaseResource):
|
|
|
116
139
|
if include_resource_types:
|
|
117
140
|
include_resource_types = include_resource_types[0]
|
|
118
141
|
|
|
119
|
-
global_hooks = GlobalHooks.load_from_file(
|
|
142
|
+
global_hooks = GlobalHooks.load_from_file(
|
|
143
|
+
all_global_hooks=False,
|
|
144
|
+
repo_path=base_repo_path() if root_project else None,
|
|
145
|
+
)
|
|
120
146
|
hook = global_hooks.get_hook(
|
|
121
147
|
operation_type=HookOperation(operation_type) if operation_type else operation_type,
|
|
122
148
|
resource_type=EntityName(resource_type) if resource_type else resource_type,
|
|
@@ -129,19 +155,38 @@ class GlobalHookResource(AsyncBaseResource):
|
|
|
129
155
|
return self(hook, user, **kwargs)
|
|
130
156
|
|
|
131
157
|
async def update(self, payload: Dict, **kwargs):
|
|
132
|
-
|
|
158
|
+
query = kwargs.get('query') or {}
|
|
159
|
+
|
|
160
|
+
root_project = query.get('root_project', [False])
|
|
161
|
+
if root_project:
|
|
162
|
+
root_project = root_project[0]
|
|
163
|
+
|
|
164
|
+
global_hooks = GlobalHooks.load_from_file(
|
|
165
|
+
all_global_hooks=False,
|
|
166
|
+
repo_path=base_repo_path() if root_project else None,
|
|
167
|
+
)
|
|
133
168
|
self.model = global_hooks.add_hook(
|
|
134
169
|
self.model,
|
|
135
|
-
payload=ignore_keys(payload, ['snapshot']),
|
|
170
|
+
payload=ignore_keys(payload, ['root_project', 'snapshot']),
|
|
136
171
|
snapshot=payload.get('snapshot') or False,
|
|
137
172
|
update=True,
|
|
138
173
|
)
|
|
139
|
-
global_hooks.save()
|
|
174
|
+
global_hooks.save(repo_path=base_repo_path() if root_project else None)
|
|
140
175
|
|
|
141
176
|
async def delete(self, **kwargs):
|
|
142
|
-
|
|
177
|
+
query = kwargs.get('query') or {}
|
|
178
|
+
|
|
179
|
+
root_project = query.get('root_project', [False])
|
|
180
|
+
if root_project:
|
|
181
|
+
root_project = root_project[0]
|
|
182
|
+
|
|
183
|
+
global_hooks = GlobalHooks.load_from_file(
|
|
184
|
+
all_global_hooks=False,
|
|
185
|
+
repo_path=base_repo_path() if root_project else None,
|
|
186
|
+
)
|
|
187
|
+
|
|
143
188
|
global_hooks.remove_hook(self.model)
|
|
144
|
-
global_hooks.save()
|
|
189
|
+
global_hooks.save(repo_path=base_repo_path() if root_project else None)
|
|
145
190
|
|
|
146
191
|
|
|
147
192
|
async def __load_pipelines(resource: GlobalHookResource):
|
|
@@ -427,18 +427,9 @@ class PipelineResource(BaseResource):
|
|
|
427
427
|
|
|
428
428
|
@classmethod
|
|
429
429
|
@safe_db_query
|
|
430
|
-
async def
|
|
431
|
-
self,
|
|
432
|
-
pk,
|
|
433
|
-
query: Dict = None,
|
|
434
|
-
resource_class=None,
|
|
435
|
-
resource_id: str = None,
|
|
436
|
-
**kwargs,
|
|
437
|
-
):
|
|
430
|
+
async def __fetch_model(self, pipeline_uuid: str, **kqwargs):
|
|
438
431
|
all_projects = project_platform_activated()
|
|
439
432
|
|
|
440
|
-
pipeline_uuid = urllib.parse.unquote(pk)
|
|
441
|
-
|
|
442
433
|
if all_projects:
|
|
443
434
|
return await get_pipeline_from_platform_async(
|
|
444
435
|
pipeline_uuid,
|
|
@@ -446,10 +437,20 @@ class PipelineResource(BaseResource):
|
|
|
446
437
|
|
|
447
438
|
return await Pipeline.get_async(pipeline_uuid, all_projects=all_projects)
|
|
448
439
|
|
|
440
|
+
@classmethod
|
|
441
|
+
@safe_db_query
|
|
442
|
+
async def get_model(
|
|
443
|
+
self,
|
|
444
|
+
pk,
|
|
445
|
+
**kwargs,
|
|
446
|
+
):
|
|
447
|
+
pipeline_uuid = urllib.parse.unquote(pk)
|
|
448
|
+
return await self.__fetch_model(pipeline_uuid, **kwargs)
|
|
449
|
+
|
|
449
450
|
@classmethod
|
|
450
451
|
@safe_db_query
|
|
451
452
|
async def member(self, pk, user, **kwargs):
|
|
452
|
-
pipeline = await
|
|
453
|
+
pipeline = await self.__fetch_model(pk, **kwargs)
|
|
453
454
|
|
|
454
455
|
api_operation_action = kwargs.get('api_operation_action', None)
|
|
455
456
|
if api_operation_action != DELETE:
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess
|
|
1
3
|
import uuid
|
|
2
4
|
|
|
5
|
+
import yaml
|
|
6
|
+
|
|
3
7
|
from mage_ai.api.resources.GenericResource import GenericResource
|
|
4
8
|
from mage_ai.cache.block_action_object import BlockActionObjectCache
|
|
9
|
+
from mage_ai.data_preparation.models.block.dbt.profiles import PROFILES_FILE_NAME
|
|
5
10
|
from mage_ai.data_preparation.models.project import Project
|
|
6
11
|
from mage_ai.data_preparation.models.project.constants import FeatureUUID
|
|
7
|
-
from mage_ai.data_preparation.repo_manager import
|
|
12
|
+
from mage_ai.data_preparation.repo_manager import (
|
|
13
|
+
ProjectType,
|
|
14
|
+
get_repo_config,
|
|
15
|
+
init_repo,
|
|
16
|
+
)
|
|
8
17
|
from mage_ai.orchestration.db import safe_db_query
|
|
9
|
-
from mage_ai.settings.platform import
|
|
10
|
-
|
|
18
|
+
from mage_ai.settings.platform import (
|
|
19
|
+
activate_project,
|
|
20
|
+
project_platform_activated,
|
|
21
|
+
update_settings,
|
|
22
|
+
)
|
|
23
|
+
from mage_ai.settings.utils import base_repo_path
|
|
24
|
+
from mage_ai.shared.hash import combine_into, merge_dict
|
|
11
25
|
from mage_ai.usage_statistics.logger import UsageStatisticLogger
|
|
12
26
|
|
|
13
27
|
|
|
@@ -17,8 +31,11 @@ async def build_project(repo_config=None, root_project: bool = False, **kwargs):
|
|
|
17
31
|
model = merge_dict(project.repo_config.to_dict(), dict(
|
|
18
32
|
emr_config=project.emr_config,
|
|
19
33
|
features=project.features,
|
|
34
|
+
features_defined=project.features_defined,
|
|
35
|
+
features_override=project.features_override,
|
|
20
36
|
latest_version=await project.latest_version(),
|
|
21
37
|
name=project.name,
|
|
38
|
+
platform_settings=project.platform_settings,
|
|
22
39
|
project_uuid=project.project_uuid,
|
|
23
40
|
projects=project.projects(),
|
|
24
41
|
remote_variables_dir=project.remote_variables_dir,
|
|
@@ -27,6 +44,7 @@ async def build_project(repo_config=None, root_project: bool = False, **kwargs):
|
|
|
27
44
|
settings=project.settings,
|
|
28
45
|
spark_config=project.spark_config,
|
|
29
46
|
version=project.version,
|
|
47
|
+
workspace_config_defaults=project.workspace_config_defaults,
|
|
30
48
|
))
|
|
31
49
|
|
|
32
50
|
if kwargs:
|
|
@@ -39,20 +57,83 @@ class ProjectResource(GenericResource):
|
|
|
39
57
|
@classmethod
|
|
40
58
|
@safe_db_query
|
|
41
59
|
async def collection(self, query, meta, user, **kwargs):
|
|
60
|
+
|
|
42
61
|
project = await self.member(None, user, **kwargs)
|
|
43
|
-
collection = [project.model]
|
|
44
62
|
|
|
63
|
+
other_projects = []
|
|
45
64
|
if not project.model.get('root_project') and project_platform_activated():
|
|
46
65
|
root_project = await self.member(None, user, root_project=True, **kwargs)
|
|
47
66
|
if root_project and root_project.model and root_project.model.get('projects'):
|
|
48
|
-
|
|
67
|
+
other_projects.append(root_project)
|
|
68
|
+
|
|
69
|
+
features = {}
|
|
70
|
+
if other_projects:
|
|
71
|
+
for project2 in other_projects:
|
|
72
|
+
combine_into(project2.features_defined or {}, features)
|
|
73
|
+
|
|
74
|
+
combine_into(project.features_defined or {}, features)
|
|
75
|
+
|
|
76
|
+
features2 = project.features or {}
|
|
77
|
+
combine_into(features, features2)
|
|
78
|
+
|
|
79
|
+
project.features = features2
|
|
49
80
|
|
|
50
81
|
return self.build_result_set(
|
|
51
|
-
|
|
82
|
+
[project] + other_projects,
|
|
52
83
|
user,
|
|
53
84
|
**kwargs,
|
|
54
85
|
)
|
|
55
86
|
|
|
87
|
+
@classmethod
|
|
88
|
+
@safe_db_query
|
|
89
|
+
async def create(self, payload, user, **kwargs):
|
|
90
|
+
project_uuid = payload.get('uuid')
|
|
91
|
+
project_repo_path = payload.get('repo_path')
|
|
92
|
+
project_type = payload.get('type')
|
|
93
|
+
|
|
94
|
+
directory = os.path.join(base_repo_path(), project_repo_path)
|
|
95
|
+
if ProjectType.STANDALONE == project_type:
|
|
96
|
+
init_repo(
|
|
97
|
+
os.path.join(directory, project_uuid),
|
|
98
|
+
project_type=project_type,
|
|
99
|
+
project_uuid=project_uuid,
|
|
100
|
+
)
|
|
101
|
+
elif 'dbt' == project_type:
|
|
102
|
+
proc = subprocess.run(
|
|
103
|
+
[
|
|
104
|
+
'dbt',
|
|
105
|
+
'init',
|
|
106
|
+
project_uuid,
|
|
107
|
+
'-s',
|
|
108
|
+
],
|
|
109
|
+
cwd=directory,
|
|
110
|
+
stdout=subprocess.PIPE,
|
|
111
|
+
stderr=subprocess.PIPE,
|
|
112
|
+
timeout=10,
|
|
113
|
+
)
|
|
114
|
+
proc.check_returncode()
|
|
115
|
+
|
|
116
|
+
with open(os.path.join(directory, project_uuid, PROFILES_FILE_NAME), 'w') as f:
|
|
117
|
+
content = yaml.safe_dump({
|
|
118
|
+
project_uuid: dict(
|
|
119
|
+
outputs=dict(
|
|
120
|
+
dev=dict(
|
|
121
|
+
dbname='',
|
|
122
|
+
host='',
|
|
123
|
+
password='postgres',
|
|
124
|
+
port=5432,
|
|
125
|
+
schema='public',
|
|
126
|
+
type='postgres',
|
|
127
|
+
user='postgres',
|
|
128
|
+
),
|
|
129
|
+
),
|
|
130
|
+
target='dev',
|
|
131
|
+
),
|
|
132
|
+
})
|
|
133
|
+
f.write(content)
|
|
134
|
+
|
|
135
|
+
return self({}, user, **kwargs)
|
|
136
|
+
|
|
56
137
|
@classmethod
|
|
57
138
|
@safe_db_query
|
|
58
139
|
async def member(self, _, user, **kwargs):
|
|
@@ -64,7 +145,14 @@ class ProjectResource(GenericResource):
|
|
|
64
145
|
if payload.get('activate_project'):
|
|
65
146
|
activate_project(payload.get('activate_project'))
|
|
66
147
|
|
|
67
|
-
|
|
148
|
+
platform_settings = payload.get('platform_settings')
|
|
149
|
+
root_project = payload.get('root_project')
|
|
150
|
+
repo_config = get_repo_config(root_project=True if root_project else False)
|
|
151
|
+
|
|
152
|
+
if root_project and platform_settings:
|
|
153
|
+
update_settings(settings=platform_settings)
|
|
154
|
+
self.model = await build_project(repo_config)
|
|
155
|
+
return self
|
|
68
156
|
|
|
69
157
|
data = {}
|
|
70
158
|
should_log_project = self.model.get('help_improve_mage') or False
|
|
@@ -105,7 +105,7 @@ class OperationHistoryReader:
|
|
|
105
105
|
async def load_most_recent_history(self, timestamp: int = None) -> OperationHistory:
|
|
106
106
|
try:
|
|
107
107
|
file_path = self.build_file_path()
|
|
108
|
-
if self.storage.path_exists(file_path):
|
|
108
|
+
if file_path and self.storage.path_exists(file_path):
|
|
109
109
|
line = await read_last_line_async()
|
|
110
110
|
return OperationHistory(**json.loads(line))
|
|
111
111
|
except Exception as err:
|
mage_ai/cache/dbt/cache.py
CHANGED
|
@@ -168,7 +168,7 @@ class DBTCache(BaseCache):
|
|
|
168
168
|
absolute_project_file_path(project_path),
|
|
169
169
|
),
|
|
170
170
|
)
|
|
171
|
-
|
|
171
|
+
project = (mapping.get(project_path) or {}).get('project')
|
|
172
172
|
models = get_models(project=project)
|
|
173
173
|
same_value = mapping[project_path].get('models') == models
|
|
174
174
|
mapping[project_path]['models'] = models
|
mage_ai/cache/dbt/utils.py
CHANGED
|
@@ -4,8 +4,10 @@ from typing import Dict, List
|
|
|
4
4
|
|
|
5
5
|
import aiofiles
|
|
6
6
|
import yaml
|
|
7
|
+
from jinja2 import Template
|
|
7
8
|
|
|
8
9
|
from mage_ai.cache.dbt.constants import PROFILES_FILENAME, PROJECT_FILENAMES
|
|
10
|
+
from mage_ai.data_preparation.shared.utils import get_template_vars
|
|
9
11
|
from mage_ai.settings.utils import base_repo_path
|
|
10
12
|
from mage_ai.shared.files import get_full_file_paths_containing_item
|
|
11
13
|
from mage_ai.shared.multi import run_parallel_multiple_args
|
|
@@ -44,7 +46,16 @@ def get_models(dirname: str = None, project: Dict = None) -> List[str]:
|
|
|
44
46
|
async def read_content_async(file_path: str) -> Dict:
|
|
45
47
|
if os.path.exists(file_path):
|
|
46
48
|
async with aiofiles.open(file_path, mode='r') as f:
|
|
47
|
-
|
|
49
|
+
content = await f.read()
|
|
50
|
+
try:
|
|
51
|
+
content_interpolated = Template(content).render(
|
|
52
|
+
variables=lambda x: x,
|
|
53
|
+
**get_template_vars(),
|
|
54
|
+
)
|
|
55
|
+
except Exception as err:
|
|
56
|
+
print(f'[WARNING] DBT.cache.read_content_async {file_path}: {err}.')
|
|
57
|
+
content_interpolated = content
|
|
58
|
+
config = yaml.safe_load(content_interpolated) or {}
|
|
48
59
|
config['file_path'] = remove_base_repo_path(file_path)
|
|
49
60
|
config['uuid'] = os.path.dirname(remove_base_repo_path(file_path))
|
|
50
61
|
return config
|
|
@@ -85,7 +96,16 @@ async def build_mapping_async(file_path: str) -> Dict:
|
|
|
85
96
|
def read_content(file_path: str) -> Dict:
|
|
86
97
|
if os.path.exists(file_path):
|
|
87
98
|
with open(file_path, mode='r') as f:
|
|
88
|
-
|
|
99
|
+
content = f.read()
|
|
100
|
+
try:
|
|
101
|
+
content_interpolated = Template(content).render(
|
|
102
|
+
variables=lambda x: x,
|
|
103
|
+
**get_template_vars(),
|
|
104
|
+
)
|
|
105
|
+
except Exception as err:
|
|
106
|
+
print(f'[WARNING] DBT.cache.read_content_async {file_path}: {err}.')
|
|
107
|
+
content_interpolated = content
|
|
108
|
+
config = yaml.safe_load(content_interpolated) or {}
|
|
89
109
|
config['file_path'] = remove_base_repo_path(file_path)
|
|
90
110
|
return config
|
|
91
111
|
|