mage-ai 0.9.56__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.

Files changed (340) hide show
  1. mage_ai/api/policies/GlobalHookPolicy.py +3 -0
  2. mage_ai/api/policies/ProjectPolicy.py +2 -0
  3. mage_ai/api/presenters/ProjectPresenter.py +3 -0
  4. mage_ai/api/resources/GlobalHookResource.py +55 -10
  5. mage_ai/api/resources/ProjectResource.py +15 -2
  6. mage_ai/cache/dbt/cache.py +1 -1
  7. mage_ai/cache/dbt/utils.py +22 -2
  8. mage_ai/data_preparation/models/block/__init__.py +15 -5
  9. mage_ai/data_preparation/models/block/dbt/block_sql.py +12 -3
  10. mage_ai/data_preparation/models/file.py +1 -1
  11. mage_ai/data_preparation/models/global_hooks/models.py +2 -2
  12. mage_ai/data_preparation/models/project/__init__.py +28 -1
  13. mage_ai/orchestration/db/models/schedules.py +64 -102
  14. mage_ai/orchestration/db/models/schedules_project_platform.py +365 -0
  15. mage_ai/orchestration/pipeline_scheduler.py +5 -1700
  16. mage_ai/orchestration/pipeline_scheduler_original.py +1635 -0
  17. mage_ai/orchestration/pipeline_scheduler_project_platform.py +1701 -0
  18. mage_ai/server/constants.py +1 -1
  19. mage_ai/server/frontend_dist/404.html +2 -2
  20. mage_ai/server/frontend_dist/_next/static/A7VXVGKgLQCukXcjdysDz/_buildManifest.js +1 -0
  21. mage_ai/server/frontend_dist/_next/static/chunks/1557-724bfc3eabd095f7.js +1 -0
  22. mage_ai/server/frontend_dist/_next/static/chunks/161-33f26e485ddef393.js +1 -0
  23. mage_ai/server/frontend_dist/_next/static/chunks/3437-ce26fc28e114b44e.js +1 -0
  24. mage_ai/server/frontend_dist/_next/static/chunks/3540-9bb48b08f439d0a0.js +1 -0
  25. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3745-51be3a2b7cd04895.js → frontend_dist/_next/static/chunks/3745-61b1c63bb56bb670.js} +1 -1
  26. mage_ai/server/frontend_dist/_next/static/chunks/{5729.0f2748e9e6dab951.js → 5189.dca121eccea793be.js} +1 -1
  27. mage_ai/server/frontend_dist/_next/static/chunks/5457-b373ebdf4d05d8e2.js +1 -0
  28. mage_ai/server/frontend_dist/_next/static/chunks/5533-3455832bc3f8429b.js +1 -0
  29. mage_ai/server/frontend_dist/_next/static/chunks/5729-9d8204ab91da631d.js +1 -0
  30. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/5810-e26a0768db1cfdba.js → frontend_dist/_next/static/chunks/5810-addfa3491ae6b01c.js} +1 -1
  31. mage_ai/server/frontend_dist/_next/static/chunks/8264-68db2a8334ad48f1.js +1 -0
  32. mage_ai/server/frontend_dist/_next/static/chunks/8432-0ace6fb7bdbc6864.js +1 -0
  33. mage_ai/server/frontend_dist/_next/static/chunks/8731-82571147875a2d58.js +1 -0
  34. mage_ai/server/frontend_dist/_next/static/chunks/{9264-a5e8a0274efa2b14.js → 9264-5df6e4c7b1e85c02.js} +1 -1
  35. mage_ai/server/frontend_dist/_next/static/chunks/pages/{_app-cc7f5a0c2456bc03.js → _app-4c0239ca6203e827.js} +1 -1
  36. mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-822e66aa2e90cf4c.js +1 -0
  37. mage_ai/server/frontend_dist/_next/static/chunks/pages/files-373217c5de51aeef.js +1 -0
  38. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/{[...slug]-1e4838e534c8f31e.js → [...slug]-0325e76a2f3e08c1.js} +1 -1
  39. mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-bb38f73540efeac4.js → global-data-products-927ebbdc29529765.js} +1 -1
  40. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-a172f5a447bd8925.js +1 -0
  41. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-97bec2ac883e0c26.js +1 -0
  42. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-02d001d99eeaae3f.js +1 -0
  43. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-2e577bfd4f0db2b7.js +1 -0
  44. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-1827574a4ba95a72.js +1 -0
  45. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-a913c361bcc0d1a9.js +1 -0
  46. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-4e6fdcbbfc931d67.js +1 -0
  47. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-1c327edcf05df9c9.js +1 -0
  48. mage_ai/server/frontend_dist/_next/static/chunks/pages/{oauth-eba7027969034415.js → oauth-bd8494f8875c5c97.js} +1 -1
  49. mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-5a98e6a531410afb.js +1 -0
  50. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-1442183d13edec2e.js +1 -0
  51. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-b526282c8ac49986.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-38b2241cdd10320c.js} +1 -1
  52. 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
  53. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-fe4d1321da8291cb.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-35cb916a18ac4e1f.js} +1 -1
  54. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-cd1918632dfef29d.js +1 -0
  55. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{logs-c011d465f61138ee.js → logs-67b0572c84db0940.js} +1 -1
  56. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-46c0dabd155581a0.js → block-runs-40201b626ea3a664.js} +1 -1
  57. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runtime-f2a052cb8a20fe47.js → block-runtime-d1f23308effebe03.js} +1 -1
  58. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-579899cbaedcdefc.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-9a116d88f00916ff.js} +1 -1
  59. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-7a2265b7e44bed0b.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-2d5abcd019d4bea1.js} +1 -1
  60. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-9b53da919db959bd.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-5363a7ae9afe8983.js} +1 -1
  61. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{settings-1839276725bfd757.js → settings-931a1b3112866a72.js} +1 -1
  62. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-68d779bc62185470.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-5ec5367cb877db38.js} +1 -1
  63. 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
  64. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-358523847fdbf547.js → triggers-378f8dada7d0c1dd.js} +1 -1
  65. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-627be24ef4963cfb.js +1 -0
  66. mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks/[...slug]-814bbd11e10c26dc.js +1 -0
  67. mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks-021ec25e05862f8f.js +1 -0
  68. 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
  69. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-05186e17c94347c1.js +1 -0
  70. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/settings-efe8bf1bf3177a7e.js +1 -0
  71. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-eaeba99f9547a20a.js → [...slug]-aa5d871de1f3f7b0.js} +1 -1
  72. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-c3140516cc28e467.js → permissions-ce45aad47049d993.js} +1 -1
  73. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-1bc694b056ff0bcb.js +1 -0
  74. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-f6ff0e219a4b9ffd.js → [...slug]-88d29d1774db67e4.js} +1 -1
  75. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-22ff9d862736b2ec.js → roles-d8ca763e405cd9d1.js} +1 -1
  76. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{sync-data-614925e838d1974c.js → sync-data-42bd909eb8951040.js} +1 -1
  77. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-5b88dfb1c6d0d16c.js → [...slug]-250dfdf22bfe67e9.js} +1 -1
  78. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-eb904db7ac7ea57c.js → users-97c4ce119f7238b5.js} +1 -1
  79. mage_ai/server/frontend_dist/_next/static/chunks/pages/{sign-in-c734db1d5834dda2.js → sign-in-1af3ba18ff646dd4.js} +1 -1
  80. mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-ff9d49355393daea.js +1 -0
  81. mage_ai/server/frontend_dist/_next/static/chunks/pages/{templates-5ebfe79c24d8c4b4.js → templates-299a2c8f2dd89cf3.js} +1 -1
  82. mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-fb3f398009a02879.js +1 -0
  83. mage_ai/server/frontend_dist/_next/static/chunks/pages/test-59a08e06f4ef6c3a.js +1 -0
  84. mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-551b85802515e313.js +1 -0
  85. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-1362aeda4a31dd41.js +1 -0
  86. mage_ai/server/frontend_dist/_next/static/chunks/{webpack-fea697dd168c6d0c.js → webpack-17c3a8f588f14cfd.js} +1 -1
  87. mage_ai/server/frontend_dist/block-layout.html +2 -2
  88. mage_ai/server/frontend_dist/compute.html +2 -2
  89. mage_ai/server/frontend_dist/files.html +2 -2
  90. mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
  91. mage_ai/server/frontend_dist/global-data-products.html +2 -2
  92. mage_ai/server/frontend_dist/global-hooks/[...slug].html +2 -2
  93. mage_ai/server/frontend_dist/global-hooks.html +2 -2
  94. mage_ai/server/frontend_dist/index.html +2 -2
  95. mage_ai/server/frontend_dist/manage/files.html +2 -2
  96. mage_ai/server/frontend_dist/manage/settings.html +2 -2
  97. mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
  98. mage_ai/server/frontend_dist/manage/users/new.html +2 -2
  99. mage_ai/server/frontend_dist/manage/users.html +2 -2
  100. mage_ai/server/frontend_dist/manage.html +2 -2
  101. mage_ai/server/frontend_dist/oauth.html +3 -3
  102. mage_ai/server/frontend_dist/overview.html +2 -2
  103. mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
  104. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
  105. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
  106. mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
  107. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
  108. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
  109. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
  110. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
  111. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
  112. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
  113. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
  114. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
  115. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
  116. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
  117. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
  118. mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
  119. mage_ai/server/frontend_dist/pipelines.html +2 -2
  120. mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +24 -0
  121. mage_ai/server/frontend_dist/platform/global-hooks.html +24 -0
  122. mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
  123. mage_ai/server/frontend_dist/settings/platform/preferences.html +24 -0
  124. mage_ai/server/frontend_dist/settings/platform/settings.html +24 -0
  125. mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +2 -2
  126. mage_ai/server/frontend_dist/settings/workspace/permissions.html +2 -2
  127. mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
  128. mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +2 -2
  129. mage_ai/server/frontend_dist/settings/workspace/roles.html +2 -2
  130. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
  131. mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +2 -2
  132. mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
  133. mage_ai/server/frontend_dist/settings.html +2 -2
  134. mage_ai/server/frontend_dist/sign-in.html +5 -5
  135. mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
  136. mage_ai/server/frontend_dist/templates.html +2 -2
  137. mage_ai/server/frontend_dist/terminal.html +2 -2
  138. mage_ai/server/frontend_dist/test.html +2 -2
  139. mage_ai/server/frontend_dist/triggers.html +2 -2
  140. mage_ai/server/frontend_dist/version-control.html +2 -2
  141. mage_ai/server/frontend_dist_base_path_template/404.html +4 -4
  142. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-724bfc3eabd095f7.js +1 -0
  143. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/161-33f26e485ddef393.js +1 -0
  144. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3437-ce26fc28e114b44e.js +1 -0
  145. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3540-9bb48b08f439d0a0.js +1 -0
  146. mage_ai/server/{frontend_dist/_next/static/chunks/3745-51be3a2b7cd04895.js → frontend_dist_base_path_template/_next/static/chunks/3745-61b1c63bb56bb670.js} +1 -1
  147. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5729.0f2748e9e6dab951.js → 5189.dca121eccea793be.js} +1 -1
  148. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-b373ebdf4d05d8e2.js +1 -0
  149. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5533-3455832bc3f8429b.js +1 -0
  150. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5729-9d8204ab91da631d.js +1 -0
  151. mage_ai/server/{frontend_dist/_next/static/chunks/5810-e26a0768db1cfdba.js → frontend_dist_base_path_template/_next/static/chunks/5810-addfa3491ae6b01c.js} +1 -1
  152. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-68db2a8334ad48f1.js +1 -0
  153. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8432-0ace6fb7bdbc6864.js +1 -0
  154. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8731-82571147875a2d58.js +1 -0
  155. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{9264-a5e8a0274efa2b14.js → 9264-5df6e4c7b1e85c02.js} +1 -1
  156. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{_app-cc7f5a0c2456bc03.js → _app-4c0239ca6203e827.js} +1 -1
  157. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-822e66aa2e90cf4c.js +1 -0
  158. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-373217c5de51aeef.js +1 -0
  159. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/{[...slug]-1e4838e534c8f31e.js → [...slug]-0325e76a2f3e08c1.js} +1 -1
  160. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-bb38f73540efeac4.js → global-data-products-927ebbdc29529765.js} +1 -1
  161. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-a172f5a447bd8925.js +1 -0
  162. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-97bec2ac883e0c26.js +1 -0
  163. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-02d001d99eeaae3f.js +1 -0
  164. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-2e577bfd4f0db2b7.js +1 -0
  165. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-1827574a4ba95a72.js +1 -0
  166. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-a913c361bcc0d1a9.js +1 -0
  167. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-4e6fdcbbfc931d67.js +1 -0
  168. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-1c327edcf05df9c9.js +1 -0
  169. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{oauth-eba7027969034415.js → oauth-bd8494f8875c5c97.js} +1 -1
  170. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-5a98e6a531410afb.js +1 -0
  171. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-1442183d13edec2e.js +1 -0
  172. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-b526282c8ac49986.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-38b2241cdd10320c.js} +1 -1
  173. 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
  174. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-fe4d1321da8291cb.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-35cb916a18ac4e1f.js} +1 -1
  175. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-cd1918632dfef29d.js +1 -0
  176. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{logs-c011d465f61138ee.js → logs-67b0572c84db0940.js} +1 -1
  177. 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
  178. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runtime-f2a052cb8a20fe47.js → block-runtime-d1f23308effebe03.js} +1 -1
  179. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-579899cbaedcdefc.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-9a116d88f00916ff.js} +1 -1
  180. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-7a2265b7e44bed0b.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-2d5abcd019d4bea1.js} +1 -1
  181. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-9b53da919db959bd.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-5363a7ae9afe8983.js} +1 -1
  182. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{settings-1839276725bfd757.js → settings-931a1b3112866a72.js} +1 -1
  183. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-68d779bc62185470.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-5ec5367cb877db38.js} +1 -1
  184. 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
  185. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-358523847fdbf547.js → triggers-378f8dada7d0c1dd.js} +1 -1
  186. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-627be24ef4963cfb.js +1 -0
  187. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks/[...slug]-814bbd11e10c26dc.js +1 -0
  188. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-021ec25e05862f8f.js +1 -0
  189. 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
  190. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-05186e17c94347c1.js +1 -0
  191. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-efe8bf1bf3177a7e.js +1 -0
  192. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-eaeba99f9547a20a.js → [...slug]-aa5d871de1f3f7b0.js} +1 -1
  193. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-c3140516cc28e467.js → permissions-ce45aad47049d993.js} +1 -1
  194. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-1bc694b056ff0bcb.js +1 -0
  195. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-f6ff0e219a4b9ffd.js → [...slug]-88d29d1774db67e4.js} +1 -1
  196. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-22ff9d862736b2ec.js → roles-d8ca763e405cd9d1.js} +1 -1
  197. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{sync-data-614925e838d1974c.js → sync-data-42bd909eb8951040.js} +1 -1
  198. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-5b88dfb1c6d0d16c.js → [...slug]-250dfdf22bfe67e9.js} +1 -1
  199. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{users-eb904db7ac7ea57c.js → users-97c4ce119f7238b5.js} +1 -1
  200. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{sign-in-c734db1d5834dda2.js → sign-in-1af3ba18ff646dd4.js} +1 -1
  201. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-ff9d49355393daea.js +1 -0
  202. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{templates-5ebfe79c24d8c4b4.js → templates-299a2c8f2dd89cf3.js} +1 -1
  203. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-fb3f398009a02879.js +1 -0
  204. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-59a08e06f4ef6c3a.js +1 -0
  205. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-551b85802515e313.js +1 -0
  206. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-1362aeda4a31dd41.js +1 -0
  207. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-d30cb09c85b4c4f0.js → webpack-b55fe1e575d8ac9d.js} +1 -1
  208. mage_ai/server/frontend_dist_base_path_template/_next/static/wSRrM15xnvA8lOWcaque7/_buildManifest.js +1 -0
  209. mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
  210. mage_ai/server/frontend_dist_base_path_template/compute.html +5 -5
  211. mage_ai/server/frontend_dist_base_path_template/files.html +5 -5
  212. mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +5 -5
  213. mage_ai/server/frontend_dist_base_path_template/global-data-products.html +5 -5
  214. mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +5 -5
  215. mage_ai/server/frontend_dist_base_path_template/global-hooks.html +5 -5
  216. mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
  217. mage_ai/server/frontend_dist_base_path_template/manage/files.html +5 -5
  218. mage_ai/server/frontend_dist_base_path_template/manage/settings.html +5 -5
  219. mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +5 -5
  220. mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +5 -5
  221. mage_ai/server/frontend_dist_base_path_template/manage/users.html +5 -5
  222. mage_ai/server/frontend_dist_base_path_template/manage.html +5 -5
  223. mage_ai/server/frontend_dist_base_path_template/oauth.html +4 -4
  224. mage_ai/server/frontend_dist_base_path_template/overview.html +5 -5
  225. mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +5 -5
  226. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +5 -5
  227. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +5 -5
  228. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +5 -5
  229. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
  230. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +5 -5
  231. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +5 -5
  232. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
  233. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +5 -5
  234. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +5 -5
  235. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +5 -5
  236. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +5 -5
  237. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +5 -5
  238. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +5 -5
  239. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +5 -5
  240. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
  241. mage_ai/server/frontend_dist_base_path_template/pipelines.html +5 -5
  242. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +24 -0
  243. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +24 -0
  244. mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +5 -5
  245. mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +24 -0
  246. mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +24 -0
  247. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +5 -5
  248. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +5 -5
  249. mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +5 -5
  250. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +5 -5
  251. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +5 -5
  252. mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +5 -5
  253. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +5 -5
  254. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +5 -5
  255. mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
  256. mage_ai/server/frontend_dist_base_path_template/sign-in.html +14 -14
  257. mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +5 -5
  258. mage_ai/server/frontend_dist_base_path_template/templates.html +5 -5
  259. mage_ai/server/frontend_dist_base_path_template/terminal.html +5 -5
  260. mage_ai/server/frontend_dist_base_path_template/test.html +2 -2
  261. mage_ai/server/frontend_dist_base_path_template/triggers.html +5 -5
  262. mage_ai/server/frontend_dist_base_path_template/version-control.html +5 -5
  263. mage_ai/settings/models/configuration_option.py +15 -1
  264. mage_ai/settings/platform/__init__.py +29 -7
  265. mage_ai/streaming/sinks/rabbitmq.py +3 -1
  266. mage_ai/streaming/sources/rabbitmq.py +5 -2
  267. mage_ai/tests/api/endpoints/test_pipeline_runs.py +4 -0
  268. mage_ai/tests/data_preparation/models/test_project.py +27 -7
  269. mage_ai/tests/orchestration/db/models/test_schedules.py +25 -7
  270. mage_ai/tests/orchestration/test_pipeline_scheduler.py +6 -261
  271. mage_ai/tests/orchestration/test_pipeline_scheduler_project_platform.py +286 -0
  272. mage_ai/tests/shared/mixins.py +1 -0
  273. {mage_ai-0.9.56.dist-info → mage_ai-0.9.57.dist-info}/METADATA +1 -1
  274. {mage_ai-0.9.56.dist-info → mage_ai-0.9.57.dist-info}/RECORD +280 -258
  275. mage_ai/server/frontend_dist/_next/static/4hG0vHBR7gnry-ZWEsEF3/_buildManifest.js +0 -1
  276. mage_ai/server/frontend_dist/_next/static/chunks/1125-65883c05178efca1.js +0 -1
  277. mage_ai/server/frontend_dist/_next/static/chunks/1952-c4ba37bc172d7051.js +0 -1
  278. mage_ai/server/frontend_dist/_next/static/chunks/3437-91f6098316edaf17.js +0 -1
  279. mage_ai/server/frontend_dist/_next/static/chunks/5457-6e700aadac17ceec.js +0 -1
  280. mage_ai/server/frontend_dist/_next/static/chunks/7936-e25b6058d3f9b215.js +0 -1
  281. mage_ai/server/frontend_dist/_next/static/chunks/8264-dad1f090c4278137.js +0 -1
  282. mage_ai/server/frontend_dist/_next/static/chunks/8432-ec2b97cbf32ec5a7.js +0 -1
  283. mage_ai/server/frontend_dist/_next/static/chunks/8731-9e0ad513b0dfce83.js +0 -1
  284. mage_ai/server/frontend_dist/_next/static/chunks/9626-090ff01fd210431c.js +0 -1
  285. mage_ai/server/frontend_dist/_next/static/chunks/pages/compute-5ead3afa88d14721.js +0 -1
  286. mage_ai/server/frontend_dist/_next/static/chunks/pages/files-13a4f6d00e8a1c63.js +0 -1
  287. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-a7d74042d52c3c38.js +0 -1
  288. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-cf7f1ba0b44ec0fb.js +0 -1
  289. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/files-259dea0c7cb30d2a.js +0 -1
  290. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/settings-1fe2dfaa456529a6.js +0 -1
  291. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-1e8731ba2559fef4.js +0 -1
  292. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/new-a6307396dfa82c88.js +0 -1
  293. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-fc5aafe5085739a9.js +0 -1
  294. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-8fad54817f356e9f.js +0 -1
  295. mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-321f47b2dba4c780.js +0 -1
  296. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipeline-runs-bf4d162b5460acc6.js +0 -1
  297. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-ed8c521227dd326e.js +0 -1
  298. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-33d9fb90871be84c.js +0 -1
  299. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-f4ff09cfff8bad46.js +0 -1
  300. mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/[...slug]-04b0a55e8ad6f814.js +0 -1
  301. mage_ai/server/frontend_dist/_next/static/chunks/pages/terminal-88025dd0ed3051a6.js +0 -1
  302. mage_ai/server/frontend_dist/_next/static/chunks/pages/test-5b316b190ff4b226.js +0 -1
  303. mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-e5e49ac3b9282aaa.js +0 -1
  304. mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-b52d3a07a13452ff.js +0 -1
  305. mage_ai/server/frontend_dist_base_path_template/_next/static/MKDICBWwxQowqsGfMukac/_buildManifest.js +0 -1
  306. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1125-65883c05178efca1.js +0 -1
  307. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1952-c4ba37bc172d7051.js +0 -1
  308. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3437-91f6098316edaf17.js +0 -1
  309. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5457-6e700aadac17ceec.js +0 -1
  310. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7936-e25b6058d3f9b215.js +0 -1
  311. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8264-dad1f090c4278137.js +0 -1
  312. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8432-ec2b97cbf32ec5a7.js +0 -1
  313. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8731-9e0ad513b0dfce83.js +0 -1
  314. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9626-090ff01fd210431c.js +0 -1
  315. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/compute-5ead3afa88d14721.js +0 -1
  316. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-13a4f6d00e8a1c63.js +0 -1
  317. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-a7d74042d52c3c38.js +0 -1
  318. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-cf7f1ba0b44ec0fb.js +0 -1
  319. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/files-259dea0c7cb30d2a.js +0 -1
  320. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/settings-1fe2dfaa456529a6.js +0 -1
  321. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-1e8731ba2559fef4.js +0 -1
  322. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-a6307396dfa82c88.js +0 -1
  323. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-fc5aafe5085739a9.js +0 -1
  324. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-8fad54817f356e9f.js +0 -1
  325. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-321f47b2dba4c780.js +0 -1
  326. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-bf4d162b5460acc6.js +0 -1
  327. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-ed8c521227dd326e.js +0 -1
  328. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-33d9fb90871be84c.js +0 -1
  329. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-f4ff09cfff8bad46.js +0 -1
  330. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/[...slug]-04b0a55e8ad6f814.js +0 -1
  331. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/terminal-88025dd0ed3051a6.js +0 -1
  332. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-5b316b190ff4b226.js +0 -1
  333. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-e5e49ac3b9282aaa.js +0 -1
  334. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-b52d3a07a13452ff.js +0 -1
  335. /mage_ai/server/frontend_dist/_next/static/{4hG0vHBR7gnry-ZWEsEF3 → A7VXVGKgLQCukXcjdysDz}/_ssgManifest.js +0 -0
  336. /mage_ai/server/frontend_dist_base_path_template/_next/static/{MKDICBWwxQowqsGfMukac → wSRrM15xnvA8lOWcaque7}/_ssgManifest.js +0 -0
  337. {mage_ai-0.9.56.dist-info → mage_ai-0.9.57.dist-info}/LICENSE +0 -0
  338. {mage_ai-0.9.56.dist-info → mage_ai-0.9.57.dist-info}/WHEEL +0 -0
  339. {mage_ai-0.9.56.dist-info → mage_ai-0.9.57.dist-info}/entry_points.txt +0 -0
  340. {mage_ai-0.9.56.dist-info → mage_ai-0.9.57.dist-info}/top_level.txt +0 -0
@@ -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,
@@ -68,7 +68,9 @@ ProjectPolicy.allow_write([
68
68
  'features',
69
69
  'openai_api_key',
70
70
  'pipelines',
71
+ 'platform_settings',
71
72
  'remote_variables_dir',
73
+ 'root_project',
72
74
  'spark_config',
73
75
  ], scopes=[
74
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',
@@ -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
- global_hooks = GlobalHooks.load_from_file()
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
- global_hooks = GlobalHooks.load_from_file()
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
- global_hooks = GlobalHooks.load_from_file()
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):
@@ -15,7 +15,11 @@ from mage_ai.data_preparation.repo_manager import (
15
15
  init_repo,
16
16
  )
17
17
  from mage_ai.orchestration.db import safe_db_query
18
- from mage_ai.settings.platform import activate_project, project_platform_activated
18
+ from mage_ai.settings.platform import (
19
+ activate_project,
20
+ project_platform_activated,
21
+ update_settings,
22
+ )
19
23
  from mage_ai.settings.utils import base_repo_path
20
24
  from mage_ai.shared.hash import combine_into, merge_dict
21
25
  from mage_ai.usage_statistics.logger import UsageStatisticLogger
@@ -28,8 +32,10 @@ async def build_project(repo_config=None, root_project: bool = False, **kwargs):
28
32
  emr_config=project.emr_config,
29
33
  features=project.features,
30
34
  features_defined=project.features_defined,
35
+ features_override=project.features_override,
31
36
  latest_version=await project.latest_version(),
32
37
  name=project.name,
38
+ platform_settings=project.platform_settings,
33
39
  project_uuid=project.project_uuid,
34
40
  projects=project.projects(),
35
41
  remote_variables_dir=project.remote_variables_dir,
@@ -139,7 +145,14 @@ class ProjectResource(GenericResource):
139
145
  if payload.get('activate_project'):
140
146
  activate_project(payload.get('activate_project'))
141
147
 
142
- repo_config = get_repo_config()
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
143
156
 
144
157
  data = {}
145
158
  should_log_project = self.model.get('help_improve_mage') or False
@@ -168,7 +168,7 @@ class DBTCache(BaseCache):
168
168
  absolute_project_file_path(project_path),
169
169
  ),
170
170
  )
171
- project = (mapping.get(project_path) or {}).get('project')
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
@@ -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
- config = yaml.safe_load(await f.read()) or {}
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
- config = yaml.safe_load(f.read()) or {}
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
 
@@ -919,16 +919,26 @@ class Block(DataIntegrationMixin, SparkBlock, ProjectPlatformAccessible):
919
919
  parts = get_path_parts(file_path)
920
920
 
921
921
  if parts and len(parts) >= 3:
922
+ # If file_path == transformers/test4.py
923
+ # parts ==
924
+ # ('/home/src/default_repo/default_platform2/project3', 'transformers', 'test4.py')
925
+
926
+ # If project platform platform activated, then parts ==
922
927
  # ('/home/src', 'default_repo', 'data_loaders/astral_violet.py')
928
+
923
929
  root_project_full_path, path, file_path_base = parts
924
930
 
925
- # ('data_loaders', 'astral_violet.py')
926
- file_parts = Path(file_path_base).parts
927
- block_type = inflection.singularize(str(file_parts[0]))
928
- block_uuid = str(Path(*file_parts[1:]))
931
+ if project_platform_activated():
932
+ # ('data_loaders', 'astral_violet.py')
933
+ file_parts = Path(file_path_base).parts
934
+ block_type = inflection.singularize(str(file_parts[0]))
935
+ block_uuid = str(Path(*file_parts[1:]).with_suffix(''))
936
+ else:
937
+ block_type = inflection.singularize(str(path))
938
+ block_uuid = str(Path(file_path_base).with_suffix(''))
929
939
 
930
- configuration = dict(file_source=dict(path=file_path))
931
940
  extension = Path(file_path).suffix.replace('.', '')
941
+ configuration = dict(file_path=file_path, file_source=dict(path=file_path))
932
942
  language = FILE_EXTENSION_TO_BLOCK_LANGUAGE.get(extension)
933
943
 
934
944
  return self.get_block(
@@ -65,7 +65,9 @@ class DBTBlockSQL(DBTBlock, ProjectPlatformAccessible):
65
65
  if file_path:
66
66
  return file_path
67
67
 
68
- file_path = self.configuration.get('file_path')
68
+ file_path = self.configuration.get('file_path') or ''
69
+ if file_path and Path(file_path).parts[0] == 'dbt':
70
+ file_path = os.path.join(*Path(file_path).parts[1:]) or ''
69
71
 
70
72
  return str((Path(self.repo_path)) / DBT_DIRECTORY_NAME / file_path)
71
73
 
@@ -82,9 +84,15 @@ class DBTBlockSQL(DBTBlock, ProjectPlatformAccessible):
82
84
  if project_path:
83
85
  return project_path
84
86
 
87
+ try:
88
+ diff = Path(self.file_path).relative_to(self.base_project_path)
89
+ if diff:
90
+ diff = Path(diff).parts[0]
91
+ except ValueError:
92
+ diff = self.file_path
93
+
85
94
  return str(
86
- Path(self.base_project_path) /
87
- self.configuration.get('file_path', '').split(os.sep)[0]
95
+ Path(self.base_project_path) / diff,
88
96
  )
89
97
 
90
98
  @property
@@ -187,6 +195,7 @@ class DBTBlockSQL(DBTBlock, ProjectPlatformAccessible):
187
195
  # Get upstream nodes via dbt list
188
196
  with Profiles(self.project_path, self.pipeline.variables) as profiles:
189
197
  try:
198
+
190
199
  args = [
191
200
  'list',
192
201
  # project-dir
@@ -484,7 +484,7 @@ def traverse(
484
484
 
485
485
  def __should_update_dbt_cache(dir_path: str, filename: str) -> bool:
486
486
  project_model = Project(root_project=True)
487
- if project_model and project_model.is_feature_enabled(FeatureUUID.DBT_V2):
487
+ if project_model and project_model.is_feature_enabled(FeatureUUID.DBT_V2) and dir_path:
488
488
  # If the file is a SQL or YAML file
489
489
  if (
490
490
  filename.endswith('.sql') or
@@ -1085,9 +1085,9 @@ class GlobalHooks(BaseDataClass):
1085
1085
  user=user,
1086
1086
  )
1087
1087
 
1088
- def save(self, file_path: str = None) -> None:
1088
+ def save(self, file_path: str = None, repo_path: str = None) -> None:
1089
1089
  if not file_path:
1090
- file_path = self.file_path()
1090
+ file_path = self.file_path(repo_path=repo_path)
1091
1091
 
1092
1092
  content_original = None
1093
1093
  if os.path.exists(file_path):
@@ -9,6 +9,7 @@ from mage_ai.data_preparation.repo_manager import get_cluster_type, get_repo_con
9
9
  from mage_ai.server.constants import VERSION
10
10
  from mage_ai.settings.platform import (
11
11
  active_project_settings,
12
+ platform_settings,
12
13
  project_platform_activated,
13
14
  project_platform_settings,
14
15
  )
@@ -38,6 +39,14 @@ class Project():
38
39
  self.version = VERSION
39
40
  self._features = None
40
41
 
42
+ self.__repo_config_root_project = None
43
+
44
+ if project_platform_activated():
45
+ self.__repo_config_root_project = get_repo_config(
46
+ repo_path=get_repo_path(root_project=True),
47
+ root_project=True,
48
+ )
49
+
41
50
  @property
42
51
  def workspace_config_defaults(self) -> Dict:
43
52
  config = self.repo_config.workspace_config_defaults or {}
@@ -92,6 +101,11 @@ class Project():
92
101
  data = {}
93
102
  features = self.repo_config.features if self.repo_config else {}
94
103
 
104
+ if project_platform_activated() and self.__repo_config_root_project:
105
+ settings = platform_settings()
106
+ if settings.get('features') and (settings.get('features') or {}).get('override'):
107
+ features.update(self.features_override)
108
+
95
109
  for uuid in FeatureUUID:
96
110
  key = uuid.value
97
111
  if FeatureUUID.PROJECT_PLATFORM == uuid:
@@ -102,6 +116,15 @@ class Project():
102
116
 
103
117
  return data
104
118
 
119
+ @property
120
+ def features_override(self) -> Dict:
121
+ if project_platform_activated() and self.__repo_config_root_project:
122
+ settings = self.platform_settings()
123
+ if settings.get('features') and (settings.get('features') or {}).get('override'):
124
+ return self.__repo_config_root_project.features or {}
125
+
126
+ return {}
127
+
105
128
  @property
106
129
  def emr_config(self) -> Dict:
107
130
  return self.repo_config.emr_config or None
@@ -128,6 +151,10 @@ class Project():
128
151
 
129
152
  return False
130
153
 
154
+ def platform_settings(self) -> Dict:
155
+ if project_platform_activated():
156
+ return platform_settings(mage_projects_only=True)
157
+
131
158
  def repo_path_for_database_query(self, key: str) -> List[str]:
132
159
  if self.settings:
133
160
  query_arr = dig(self.settings, ['database', 'query', key])
@@ -145,7 +172,7 @@ class Project():
145
172
  return project_platform_settings(mage_projects_only=True)
146
173
 
147
174
  def is_feature_enabled(self, feature_name: FeatureUUID) -> bool:
148
- feature_enabled = self.repo_config.features.get(feature_name.value, False)
175
+ feature_enabled = self.features.get(feature_name.value, False)
149
176
 
150
177
  if is_debug():
151
178
  print(f'[Project.is_feature_enabled]: {feature_name} | {feature_enabled}')