@smmachine/launcher 0.0.2 → 0.4.0

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.
Files changed (306) hide show
  1. package/apps/webapp/.next/BUILD_ID +1 -1
  2. package/apps/webapp/.next/build-manifest.json +8 -7
  3. package/apps/webapp/.next/cache/.previewinfo +1 -1
  4. package/apps/webapp/.next/cache/.rscinfo +1 -1
  5. package/apps/webapp/.next/cache/.tsbuildinfo +1 -1
  6. package/apps/webapp/.next/cache/config.json +3 -3
  7. package/apps/webapp/.next/diagnostics/route-bundle-stats.json +70 -63
  8. package/apps/webapp/.next/fallback-build-manifest.json +3 -3
  9. package/apps/webapp/.next/prerender-manifest.json +3 -3
  10. package/apps/webapp/.next/server/app/_global-error/page/build-manifest.json +5 -4
  11. package/apps/webapp/.next/server/app/_global-error/page.js +2 -2
  12. package/apps/webapp/.next/server/app/_global-error/page.js.nft.json +1 -1
  13. package/apps/webapp/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  14. package/apps/webapp/.next/server/app/_global-error.html +1 -1
  15. package/apps/webapp/.next/server/app/_global-error.rsc +8 -8
  16. package/apps/webapp/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  17. package/apps/webapp/.next/server/app/_global-error.segments/_full.segment.rsc +8 -8
  18. package/apps/webapp/.next/server/app/_global-error.segments/_head.segment.rsc +4 -4
  19. package/apps/webapp/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  20. package/apps/webapp/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  21. package/apps/webapp/.next/server/app/_not-found/page/build-manifest.json +5 -4
  22. package/apps/webapp/.next/server/app/_not-found/page.js +3 -3
  23. package/apps/webapp/.next/server/app/_not-found/page.js.nft.json +1 -1
  24. package/apps/webapp/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  25. package/apps/webapp/.next/server/app/_not-found.html +1 -1
  26. package/apps/webapp/.next/server/app/_not-found.rsc +17 -16
  27. package/apps/webapp/.next/server/app/_not-found.segments/_full.segment.rsc +17 -16
  28. package/apps/webapp/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  29. package/apps/webapp/.next/server/app/_not-found.segments/_index.segment.rsc +6 -5
  30. package/apps/webapp/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  31. package/apps/webapp/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  32. package/apps/webapp/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  33. package/apps/webapp/.next/server/app/dashboard/insights/page/build-manifest.json +5 -4
  34. package/apps/webapp/.next/server/app/dashboard/insights/page/server-reference-manifest.json +1 -1
  35. package/apps/webapp/.next/server/app/dashboard/insights/page.js +5 -4
  36. package/apps/webapp/.next/server/app/dashboard/insights/page.js.nft.json +1 -1
  37. package/apps/webapp/.next/server/app/dashboard/insights/page_client-reference-manifest.js +1 -1
  38. package/apps/webapp/.next/server/app/dashboard/page/build-manifest.json +5 -4
  39. package/apps/webapp/.next/server/app/dashboard/page/server-reference-manifest.json +1 -1
  40. package/apps/webapp/.next/server/app/dashboard/page.js +5 -4
  41. package/apps/webapp/.next/server/app/dashboard/page.js.nft.json +1 -1
  42. package/apps/webapp/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
  43. package/apps/webapp/.next/server/app/dashboard/pipelines/page/build-manifest.json +5 -4
  44. package/apps/webapp/.next/server/app/dashboard/pipelines/page/server-reference-manifest.json +1 -1
  45. package/apps/webapp/.next/server/app/dashboard/pipelines/page.js +5 -4
  46. package/apps/webapp/.next/server/app/dashboard/pipelines/page.js.nft.json +1 -1
  47. package/apps/webapp/.next/server/app/dashboard/pipelines/page_client-reference-manifest.js +1 -1
  48. package/apps/webapp/.next/server/app/dashboard/pull-requests/page/build-manifest.json +5 -4
  49. package/apps/webapp/.next/server/app/dashboard/pull-requests/page/server-reference-manifest.json +1 -1
  50. package/apps/webapp/.next/server/app/dashboard/pull-requests/page.js +5 -4
  51. package/apps/webapp/.next/server/app/dashboard/pull-requests/page.js.nft.json +1 -1
  52. package/apps/webapp/.next/server/app/dashboard/pull-requests/page_client-reference-manifest.js +1 -1
  53. package/apps/webapp/.next/server/app/dashboard/source-code/page/build-manifest.json +5 -4
  54. package/apps/webapp/.next/server/app/dashboard/source-code/page/server-reference-manifest.json +1 -1
  55. package/apps/webapp/.next/server/app/dashboard/source-code/page.js +5 -4
  56. package/apps/webapp/.next/server/app/dashboard/source-code/page.js.nft.json +1 -1
  57. package/apps/webapp/.next/server/app/dashboard/source-code/page_client-reference-manifest.js +1 -1
  58. package/apps/webapp/.next/server/app/dashboard.html +1 -1
  59. package/apps/webapp/.next/server/app/dashboard.rsc +19 -18
  60. package/apps/webapp/.next/server/app/dashboard.segments/_full.segment.rsc +19 -18
  61. package/apps/webapp/.next/server/app/dashboard.segments/_head.segment.rsc +4 -4
  62. package/apps/webapp/.next/server/app/dashboard.segments/_index.segment.rsc +6 -5
  63. package/apps/webapp/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  64. package/apps/webapp/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +2 -2
  65. package/apps/webapp/.next/server/app/dashboard.segments/dashboard.segment.rsc +5 -5
  66. package/apps/webapp/.next/server/app/index.html +1 -1
  67. package/apps/webapp/.next/server/app/index.rsc +16 -15
  68. package/apps/webapp/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  69. package/apps/webapp/.next/server/app/index.segments/_full.segment.rsc +16 -15
  70. package/apps/webapp/.next/server/app/index.segments/_head.segment.rsc +4 -4
  71. package/apps/webapp/.next/server/app/index.segments/_index.segment.rsc +6 -5
  72. package/apps/webapp/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  73. package/apps/webapp/.next/server/app/page/build-manifest.json +5 -4
  74. package/apps/webapp/.next/server/app/page.js +3 -3
  75. package/apps/webapp/.next/server/app/page.js.nft.json +1 -1
  76. package/apps/webapp/.next/server/app/page_client-reference-manifest.js +1 -1
  77. package/apps/webapp/.next/server/chunks/[root-of-the-server]__0p3s5md._.js +2 -2
  78. package/apps/webapp/.next/server/chunks/[root-of-the-server]__0p3s5md._.js.map +1 -1
  79. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_048yq_z._.js +1 -1
  80. package/apps/webapp/.next/server/chunks/ssr/{[root-of-the-server]__0d5zscq._.js → 05tt_next_dist_07-on~h._.js} +2 -2
  81. package/apps/webapp/.next/server/chunks/ssr/{[root-of-the-server]__0d5zscq._.js.map → 05tt_next_dist_07-on~h._.js.map} +1 -1
  82. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_0c.hhwp._.js +1 -1
  83. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_0yxnbkd._.js +3 -0
  84. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_0yxnbkd._.js.map +1 -0
  85. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_10i1bjz._.js +3 -0
  86. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_10i1bjz._.js.map +1 -0
  87. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_02sg8.4.js +1 -1
  88. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_078.jy_.js +1 -1
  89. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0b-y_b9.js +1 -1
  90. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0j7k8nm.js +1 -1
  91. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0mw49v~.js +1 -1
  92. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0pkwe32.js +1 -1
  93. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0q6_s2n.js +1 -1
  94. package/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0vt1w_4.js +1 -1
  95. package/apps/webapp/.next/server/chunks/ssr/0u6g_@mui_material_esm_084pa~t._.js +1 -1
  96. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__00f_2t7._.js +3 -0
  97. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__00f_2t7._.js.map +1 -0
  98. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__02--~md._.js.map +1 -1
  99. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__02kdint._.js +8 -0
  100. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__02kdint._.js.map +1 -0
  101. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__08sib~h._.js +3 -0
  102. package/apps/webapp/.next/server/chunks/ssr/{[root-of-the-server]__0v7whie._.js.map → [root-of-the-server]__08sib~h._.js.map} +1 -1
  103. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0b.kqls._.js.map +1 -1
  104. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0gz_uel._.js +1 -1
  105. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0gz_uel._.js.map +1 -1
  106. package/apps/webapp/.next/server/chunks/ssr/{[root-of-the-server]__0_678qu._.js → [root-of-the-server]__0id1dcw._.js} +2 -2
  107. package/apps/webapp/.next/server/chunks/ssr/{[root-of-the-server]__0_678qu._.js.map → [root-of-the-server]__0id1dcw._.js.map} +1 -1
  108. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0mqsa53._.js.map +1 -1
  109. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0zz69~a._.js +3 -0
  110. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0zz69~a._.js.map +1 -0
  111. package/apps/webapp/.next/server/chunks/ssr/_042y~1f._.js +1 -1
  112. package/apps/webapp/.next/server/chunks/ssr/_042y~1f._.js.map +1 -1
  113. package/apps/webapp/.next/server/chunks/ssr/_05rzb3b._.js +1 -1
  114. package/apps/webapp/.next/server/chunks/ssr/_07rvj1-._.js +1 -1
  115. package/apps/webapp/.next/server/chunks/ssr/_07rvj1-._.js.map +1 -1
  116. package/apps/webapp/.next/server/chunks/ssr/_08d4zhe._.js +30 -0
  117. package/apps/webapp/.next/server/chunks/ssr/_08d4zhe._.js.map +1 -0
  118. package/apps/webapp/.next/server/chunks/ssr/_09pd2a5._.js +1 -1
  119. package/apps/webapp/.next/server/chunks/ssr/_09pd2a5._.js.map +1 -1
  120. package/apps/webapp/.next/server/chunks/ssr/_0ff1gqq._.js +1 -1
  121. package/apps/webapp/.next/server/chunks/ssr/_0ff1gqq._.js.map +1 -1
  122. package/apps/webapp/.next/server/chunks/ssr/_0m.-wbb._.js +105 -0
  123. package/apps/webapp/.next/server/chunks/ssr/_0m.-wbb._.js.map +1 -0
  124. package/apps/webapp/.next/server/chunks/ssr/_0qa1_7s._.js +1 -1
  125. package/apps/webapp/.next/server/chunks/ssr/_0qa1_7s._.js.map +1 -1
  126. package/apps/webapp/.next/server/chunks/ssr/_0r1g-0-._.js +1 -1
  127. package/apps/webapp/.next/server/chunks/ssr/_0r1g-0-._.js.map +1 -1
  128. package/apps/webapp/.next/server/chunks/ssr/_0yvvkzh._.js +1 -1
  129. package/apps/webapp/.next/server/chunks/ssr/_0yvvkzh._.js.map +1 -1
  130. package/apps/webapp/.next/server/chunks/ssr/apps_webapp_components_filters_DashboardFilters_ts_0si3yqv._.js +3 -0
  131. package/apps/webapp/.next/server/chunks/ssr/apps_webapp_components_filters_DashboardFilters_ts_0si3yqv._.js.map +1 -0
  132. package/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_00zum3n._.js +1 -1
  133. package/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_07ypg6c._.js +1 -1
  134. package/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_0vm9rhu._.js +6 -0
  135. package/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_0vm9rhu._.js.map +1 -0
  136. package/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_11ucok0._.js +1 -1
  137. package/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_11ucok0._.js.map +1 -1
  138. package/apps/webapp/.next/server/middleware-build-manifest.js +8 -7
  139. package/apps/webapp/.next/server/pages/404.html +1 -1
  140. package/apps/webapp/.next/server/pages/500.html +1 -1
  141. package/apps/webapp/.next/server/server-reference-manifest.js +1 -1
  142. package/apps/webapp/.next/server/server-reference-manifest.json +2 -2
  143. package/apps/webapp/.next/standalone/apps/webapp/.next/BUILD_ID +1 -1
  144. package/apps/webapp/.next/standalone/apps/webapp/.next/build-manifest.json +8 -7
  145. package/apps/webapp/.next/standalone/apps/webapp/.next/prerender-manifest.json +3 -3
  146. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_global-error/page/build-manifest.json +5 -4
  147. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_global-error/page.js +2 -2
  148. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_global-error/page.js.nft.json +1 -1
  149. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  150. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_global-error.html +1 -1
  151. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_global-error.rsc +8 -8
  152. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  153. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_global-error.segments/_full.segment.rsc +8 -8
  154. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_global-error.segments/_head.segment.rsc +4 -4
  155. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  156. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  157. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found/page/build-manifest.json +5 -4
  158. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found/page.js +3 -3
  159. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found/page.js.nft.json +1 -1
  160. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  161. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found.html +1 -1
  162. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found.rsc +17 -16
  163. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found.segments/_full.segment.rsc +17 -16
  164. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  165. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found.segments/_index.segment.rsc +6 -5
  166. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  167. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  168. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  169. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/insights/page/build-manifest.json +5 -4
  170. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/insights/page/server-reference-manifest.json +1 -1
  171. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/insights/page.js +5 -4
  172. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/insights/page.js.nft.json +1 -1
  173. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/insights/page_client-reference-manifest.js +1 -1
  174. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/page/build-manifest.json +5 -4
  175. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/page/server-reference-manifest.json +1 -1
  176. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/page.js +5 -4
  177. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/page.js.nft.json +1 -1
  178. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
  179. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/pipelines/page/build-manifest.json +5 -4
  180. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/pipelines/page/server-reference-manifest.json +1 -1
  181. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/pipelines/page.js +5 -4
  182. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/pipelines/page.js.nft.json +1 -1
  183. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/pipelines/page_client-reference-manifest.js +1 -1
  184. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/pull-requests/page/build-manifest.json +5 -4
  185. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/pull-requests/page/server-reference-manifest.json +1 -1
  186. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/pull-requests/page.js +5 -4
  187. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/pull-requests/page.js.nft.json +1 -1
  188. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/pull-requests/page_client-reference-manifest.js +1 -1
  189. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/source-code/page/build-manifest.json +5 -4
  190. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/source-code/page/server-reference-manifest.json +1 -1
  191. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/source-code/page.js +5 -4
  192. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/source-code/page.js.nft.json +1 -1
  193. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard/source-code/page_client-reference-manifest.js +1 -1
  194. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard.html +1 -1
  195. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard.rsc +19 -18
  196. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard.segments/_full.segment.rsc +19 -18
  197. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard.segments/_head.segment.rsc +4 -4
  198. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard.segments/_index.segment.rsc +6 -5
  199. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  200. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +2 -2
  201. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/dashboard.segments/dashboard.segment.rsc +5 -5
  202. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/index.html +1 -1
  203. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/index.rsc +16 -15
  204. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  205. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/index.segments/_full.segment.rsc +16 -15
  206. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/index.segments/_head.segment.rsc +4 -4
  207. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/index.segments/_index.segment.rsc +6 -5
  208. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  209. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/page/build-manifest.json +5 -4
  210. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/page.js +3 -3
  211. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/page.js.nft.json +1 -1
  212. package/apps/webapp/.next/standalone/apps/webapp/.next/server/app/page_client-reference-manifest.js +1 -1
  213. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/[root-of-the-server]__0p3s5md._.js +2 -2
  214. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_048yq_z._.js +1 -1
  215. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/{[root-of-the-server]__0d5zscq._.js → 05tt_next_dist_07-on~h._.js} +2 -2
  216. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_0c.hhwp._.js +1 -1
  217. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_0yxnbkd._.js +3 -0
  218. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_10i1bjz._.js +3 -0
  219. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_02sg8.4.js +1 -1
  220. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_078.jy_.js +1 -1
  221. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0b-y_b9.js +1 -1
  222. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0j7k8nm.js +1 -1
  223. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0mw49v~.js +1 -1
  224. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0pkwe32.js +1 -1
  225. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0q6_s2n.js +1 -1
  226. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/05tt_next_dist_esm_build_templates_app-page_0vt1w_4.js +1 -1
  227. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/0u6g_@mui_material_esm_084pa~t._.js +1 -1
  228. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__00f_2t7._.js +3 -0
  229. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__02kdint._.js +8 -0
  230. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__08sib~h._.js +3 -0
  231. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0gz_uel._.js +1 -1
  232. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/{[root-of-the-server]__0_678qu._.js → [root-of-the-server]__0id1dcw._.js} +2 -2
  233. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0zz69~a._.js +3 -0
  234. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/_042y~1f._.js +1 -1
  235. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/_05rzb3b._.js +1 -1
  236. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/_07rvj1-._.js +1 -1
  237. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/_08d4zhe._.js +30 -0
  238. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/_09pd2a5._.js +1 -1
  239. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/_0ff1gqq._.js +1 -1
  240. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/_0m.-wbb._.js +105 -0
  241. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/_0qa1_7s._.js +1 -1
  242. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/_0r1g-0-._.js +1 -1
  243. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/_0yvvkzh._.js +1 -1
  244. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/apps_webapp_components_filters_DashboardFilters_ts_0si3yqv._.js +3 -0
  245. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_00zum3n._.js +1 -1
  246. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_07ypg6c._.js +1 -1
  247. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_0vm9rhu._.js +6 -0
  248. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_11ucok0._.js +1 -1
  249. package/apps/webapp/.next/standalone/apps/webapp/.next/server/middleware-build-manifest.js +8 -7
  250. package/apps/webapp/.next/standalone/apps/webapp/.next/server/pages/404.html +1 -1
  251. package/apps/webapp/.next/standalone/apps/webapp/.next/server/pages/500.html +1 -1
  252. package/apps/webapp/.next/standalone/apps/webapp/.next/server/server-reference-manifest.js +1 -1
  253. package/apps/webapp/.next/standalone/apps/webapp/.next/server/server-reference-manifest.json +2 -2
  254. package/apps/webapp/.next/standalone/apps/webapp/package.json +3 -0
  255. package/apps/webapp/.next/static/chunks/{0cou5vpheg22o.js → 0-b3evebbsn.d.js} +1 -1
  256. package/apps/webapp/.next/static/chunks/01p2dautq2ac2.js +2 -0
  257. package/apps/webapp/.next/static/chunks/03gl2r.i3_2k2.css +3 -0
  258. package/apps/webapp/.next/static/chunks/0429__h3~-ds1.js +28 -0
  259. package/apps/webapp/.next/static/chunks/0652i33o~shm8.js +1 -0
  260. package/apps/webapp/.next/static/chunks/{0rm7qmgsl~p.8.js → 07v-tyusjjnic.js} +1 -1
  261. package/apps/webapp/.next/static/chunks/0t.lqhfqfq235.js +31 -0
  262. package/apps/webapp/.next/static/chunks/0x76u_i-5m~6r.js +103 -0
  263. package/apps/webapp/.next/static/chunks/12c_ov5nzbjhm.js +9 -0
  264. package/apps/webapp/.next/static/chunks/150u3.56v2h9u.js +1 -0
  265. package/apps/webapp/.next/static/chunks/turbopack-0-t5~1ln.zbxc.js +1 -0
  266. package/apps/webapp/.next/trace +1 -1
  267. package/apps/webapp/.next/trace-build +1 -1
  268. package/dist/index.cjs +1848 -1394
  269. package/dist/index.cjs.map +1 -1
  270. package/dist/rest/main.cjs +1415 -812
  271. package/dist/rest/main.cjs.map +1 -1
  272. package/package.json +10 -9
  273. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0c3z7i8._.js +0 -3
  274. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0c3z7i8._.js.map +0 -1
  275. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0l8izjl._.js +0 -3
  276. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0l8izjl._.js.map +0 -1
  277. package/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0v7whie._.js +0 -3
  278. package/apps/webapp/.next/server/chunks/ssr/_0.q0zah._.js +0 -108
  279. package/apps/webapp/.next/server/chunks/ssr/_0.q0zah._.js.map +0 -1
  280. package/apps/webapp/.next/server/chunks/ssr/apps_webapp_06376fu._.js +0 -3
  281. package/apps/webapp/.next/server/chunks/ssr/apps_webapp_06376fu._.js.map +0 -1
  282. package/apps/webapp/.next/server/chunks/ssr/apps_webapp_app_ThemeProvider_tsx_0t-cmyq._.js +0 -30
  283. package/apps/webapp/.next/server/chunks/ssr/apps_webapp_app_ThemeProvider_tsx_0t-cmyq._.js.map +0 -1
  284. package/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_007_s-a._.js +0 -3
  285. package/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_007_s-a._.js.map +0 -1
  286. package/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_0kpuq73._.js +0 -3
  287. package/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_0kpuq73._.js.map +0 -1
  288. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0c3z7i8._.js +0 -3
  289. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0l8izjl._.js +0 -3
  290. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/[root-of-the-server]__0v7whie._.js +0 -3
  291. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/_0.q0zah._.js +0 -108
  292. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/apps_webapp_06376fu._.js +0 -3
  293. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/apps_webapp_app_ThemeProvider_tsx_0t-cmyq._.js +0 -30
  294. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_007_s-a._.js +0 -3
  295. package/apps/webapp/.next/standalone/apps/webapp/.next/server/chunks/ssr/node_modules__pnpm_0kpuq73._.js +0 -3
  296. package/apps/webapp/.next/static/chunks/018gly56o.hxe.js +0 -28
  297. package/apps/webapp/.next/static/chunks/0j2.81h6.e1cw.js +0 -103
  298. package/apps/webapp/.next/static/chunks/0kk2dfbhuyum3.css +0 -3
  299. package/apps/webapp/.next/static/chunks/0r_oj2_r1n-zt.js +0 -1
  300. package/apps/webapp/.next/static/chunks/0rfejf.g2dyq7.js +0 -9
  301. package/apps/webapp/.next/static/chunks/0wph~llp8.jow.js +0 -2
  302. package/apps/webapp/.next/static/chunks/146ucgt-mqaiy.js +0 -31
  303. package/apps/webapp/.next/static/chunks/turbopack-03hidchvjw607.js +0 -1
  304. /package/apps/webapp/.next/static/{CX0dtpj3faZuu7SZ5BRqi → ANsJiOYvw2k9yQuLjHnBO}/_buildManifest.js +0 -0
  305. /package/apps/webapp/.next/static/{CX0dtpj3faZuu7SZ5BRqi → ANsJiOYvw2k9yQuLjHnBO}/_clientMiddlewareManifest.js +0 -0
  306. /package/apps/webapp/.next/static/{CX0dtpj3faZuu7SZ5BRqi → ANsJiOYvw2k9yQuLjHnBO}/_ssgManifest.js +0 -0
@@ -53,31 +53,34 @@ var require_configuration = __commonJS({
53
53
  constructor(env = process.env) {
54
54
  const envObj = env === process.env ? { ...env } : env;
55
55
  let configData = {};
56
- if (envObj.SMM_STORE_DATA_AT) {
57
- try {
58
- const configPath = path.resolve(`${envObj.SMM_STORE_DATA_AT}/smm_config.json`);
59
- if (fs.existsSync(configPath)) {
60
- const fileContent = fs.readFileSync(configPath, "utf-8");
61
- configData = JSON.parse(fileContent);
62
- }
63
- } catch (error) {
64
- console.warn(`Warning: Failed to load configuration from ${configData}:`, error);
65
- }
66
- }
67
- this.gitProvider = configData.git_provider || envObj.GIT_PROVIDER || "github";
68
- this.githubToken = configData.github_token || envObj.GITHUB_TOKEN;
69
- this.gitlabToken = configData.gitlab_token || envObj.GITLAB_TOKEN;
70
- this.githubRepository = configData.github_repository || envObj.GITHUB_REPOSITORY;
56
+ if (!envObj.SMM_STORE_DATA_AT) {
57
+ throw new Error(`Warning: Failed to load configuration from ${configData.toString()}:`);
58
+ }
59
+ const configPath = path.resolve(`${envObj.SMM_STORE_DATA_AT}/smm_config.json`);
60
+ if (fs.existsSync(configPath)) {
61
+ const fileContent = fs.readFileSync(configPath, "utf-8");
62
+ configData = JSON.parse(fileContent);
63
+ }
64
+ this.gitProvider = configData.git_provider;
65
+ this.githubToken = configData.github_token;
66
+ this.gitlabToken = configData.gitlab_token;
67
+ this.githubRepository = configData.github_repository;
71
68
  this.storeData = envObj.SMM_STORE_DATA_AT;
72
- this.gitRepositoryLocation = configData.git_repository_location || envObj.GIT_REPOSITORY_LOCATION;
73
- this.deploymentFrequencyTargetPipeline = configData.deployment_frequency_target_pipeline || envObj.DEPLOYMENT_FREQUENCY_TARGET_PIPELINE;
74
- this.deploymentFrequencyTargetJob = configData.deployment_frequency_target_job || envObj.DEPLOYMENT_FREQUENCY_TARGET_JOB;
75
- this.mainBranch = configData.main_branch || envObj.MAIN_BRANCH || "main";
76
- this.dashboardStartDate = configData.dashboard_start_date || envObj.DASHBOARD_START_DATE;
77
- this.dashboardEndDate = configData.dashboard_end_date || envObj.DASHBOARD_END_DATE;
78
- this.dashboardColor = configData.dashboard_color || envObj.DASHBOARD_COLOR || "#6b77e3";
79
- const logLevel = configData.log_level || envObj.LOGGING_LEVEL || "CRITICAL";
80
- this.loggingLevel = logLevel.toUpperCase();
69
+ this.gitRepositoryLocation = configData.git_repository_location;
70
+ this.deploymentFrequencyTargetPipeline = configData.deployment_frequency_target_pipeline;
71
+ this.deploymentFrequencyTargetJob = configData.deployment_frequency_target_job;
72
+ this.mainBranch = configData.main_branch;
73
+ this.dashboardStartDate = configData.dashboard_start_date;
74
+ this.dashboardEndDate = configData.dashboard_end_date;
75
+ this.dashboardColor = configData.dashboard_color;
76
+ let logLevel = "CRITICAL";
77
+ if (configData.log_level) {
78
+ logLevel = configData.log_level;
79
+ }
80
+ if (envObj.LOGGING_LEVEL) {
81
+ logLevel = envObj.LOGGING_LEVEL;
82
+ }
83
+ this.loggingLevel = logLevel;
81
84
  this.jiraUrl = configData.jira_url || envObj.JIRA_URL;
82
85
  this.jiraEmail = configData.jira_email || envObj.JIRA_EMAIL;
83
86
  this.jiraToken = configData.jira_token || envObj.JIRA_TOKEN;
@@ -85,10 +88,8 @@ var require_configuration = __commonJS({
85
88
  this.sonarUrl = configData.sonar_url || envObj.SONAR_URL;
86
89
  this.sonarToken = configData.sonar_token || envObj.SONAR_TOKEN;
87
90
  this.sonarProject = configData.sonar_project || envObj.SONAR_PROJECT;
91
+ this.validate();
88
92
  }
89
- /**
90
- * Validate that required configuration is present
91
- */
92
93
  validate() {
93
94
  const errors = [];
94
95
  if (!this.gitRepositoryLocation) {
@@ -104,160 +105,26 @@ var require_configuration = __commonJS({
104
105
  errors
105
106
  };
106
107
  }
107
- };
108
- exports2.Configuration = Configuration;
109
- }
110
- });
111
-
112
- // packages/core/dist/infrastructure/repository.js
113
- var require_repository = __commonJS({
114
- "packages/core/dist/infrastructure/repository.js"(exports2) {
115
- "use strict";
116
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
117
- if (k2 === void 0) k2 = k;
118
- var desc = Object.getOwnPropertyDescriptor(m, k);
119
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
120
- desc = { enumerable: true, get: function() {
121
- return m[k];
122
- } };
123
- }
124
- Object.defineProperty(o, k2, desc);
125
- }) : (function(o, m, k, k2) {
126
- if (k2 === void 0) k2 = k;
127
- o[k2] = m[k];
128
- }));
129
- var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
130
- Object.defineProperty(o, "default", { enumerable: true, value: v });
131
- }) : function(o, v) {
132
- o["default"] = v;
133
- });
134
- var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
135
- var ownKeys = function(o) {
136
- ownKeys = Object.getOwnPropertyNames || function(o2) {
137
- var ar = [];
138
- for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
139
- return ar;
140
- };
141
- return ownKeys(o);
142
- };
143
- return function(mod) {
144
- if (mod && mod.__esModule) return mod;
145
- var result = {};
146
- if (mod != null) {
147
- for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
148
- }
149
- __setModuleDefault(result, mod);
150
- return result;
151
- };
152
- })();
153
- Object.defineProperty(exports2, "__esModule", { value: true });
154
- exports2.FileSystemRepository = void 0;
155
- var fs = __importStar(require("fs/promises"));
156
- var path_1 = require("path");
157
- var FileSystemRepository = class {
158
- constructor(filePath) {
159
- this.filePath = filePath;
160
- }
161
- deserialize(data) {
162
- return JSON.parse(data);
163
- }
164
- serialize(item) {
165
- return JSON.stringify(item, null, 2);
166
- }
167
- async save(item) {
168
- const data = this.serialize(item);
169
- await this.ensureDirectoryExists();
170
- await fs.writeFile(this.filePath, data, "utf-8");
171
- }
172
- async saveAll(items) {
173
- const data = JSON.stringify(items, null, 2);
174
- await this.ensureDirectoryExists();
175
- await fs.writeFile(this.filePath, data, "utf-8");
176
- }
177
- async load() {
178
- try {
179
- const data = await fs.readFile(this.filePath, "utf-8");
180
- return this.deserialize(data);
181
- } catch (error) {
182
- if (error.code === "ENOENT") {
183
- return null;
184
- }
185
- throw error;
186
- }
187
- }
188
- async loadAll() {
189
- try {
190
- const data = await fs.readFile(this.filePath, "utf-8");
191
- const parsed = JSON.parse(data);
192
- if (!Array.isArray(parsed)) {
193
- return [parsed];
194
- }
195
- if (parsed.length > 0 && typeof parsed[0] === "string") {
196
- return parsed.map((item) => this.deserialize(item));
197
- }
198
- return parsed;
199
- } catch (error) {
200
- if (error.code === "ENOENT") {
201
- return [];
202
- }
203
- throw error;
204
- }
108
+ getBaseDirectory() {
109
+ const baseDir = this.storeData || "./outputs";
110
+ const gitProvider = this.gitProvider || "github";
111
+ const repoSlug = (this.githubRepository || "").replace("/", "_");
112
+ return path.join(baseDir, `${gitProvider}_${repoSlug}`);
205
113
  }
206
- async delete() {
207
- try {
208
- await fs.unlink(this.filePath);
209
- } catch (error) {
210
- if (error.code !== "ENOENT") {
211
- throw error;
212
- }
213
- }
114
+ getCodeMaatPath() {
115
+ return path.join(this.getBaseDirectory(), "codemaat");
214
116
  }
215
- async exists() {
216
- try {
217
- await fs.access(this.filePath);
218
- return true;
219
- } catch {
220
- return false;
221
- }
117
+ getSonarqubePath() {
118
+ return path.join(this.getBaseDirectory(), "sonarqube");
222
119
  }
223
- async ensureDirectoryExists() {
224
- const dir = (0, path_1.dirname)(this.filePath);
225
- try {
226
- await fs.mkdir(dir, { recursive: true });
227
- } catch (error) {
228
- if (error.code !== "EEXIST") {
229
- throw error;
230
- }
231
- }
120
+ getJiraPath() {
121
+ return path.join(this.getBaseDirectory(), "jira");
232
122
  }
233
- };
234
- exports2.FileSystemRepository = FileSystemRepository;
235
- }
236
- });
237
-
238
- // packages/core/dist/infrastructure/index.js
239
- var require_infrastructure = __commonJS({
240
- "packages/core/dist/infrastructure/index.js"(exports2) {
241
- "use strict";
242
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
243
- if (k2 === void 0) k2 = k;
244
- var desc = Object.getOwnPropertyDescriptor(m, k);
245
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
246
- desc = { enumerable: true, get: function() {
247
- return m[k];
248
- } };
123
+ getPipelinePath() {
124
+ return path.join(this.getBaseDirectory(), this.gitProvider);
249
125
  }
250
- Object.defineProperty(o, k2, desc);
251
- }) : (function(o, m, k, k2) {
252
- if (k2 === void 0) k2 = k;
253
- o[k2] = m[k];
254
- }));
255
- var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
256
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
257
126
  };
258
- Object.defineProperty(exports2, "__esModule", { value: true });
259
- __exportStar(require_configuration(), exports2);
260
- __exportStar(require_repository(), exports2);
127
+ exports2.Configuration = Configuration;
261
128
  }
262
129
  });
263
130
 
@@ -322,9 +189,14 @@ var require_logger = __commonJS({
322
189
  }
323
190
  }
324
191
  info(message, data) {
325
- if (this.shouldLog("INFO")) {
192
+ if (!this.shouldLog("INFO")) {
193
+ return;
194
+ }
195
+ if (data) {
326
196
  console.log(this.formatMessage("INFO", message), data);
197
+ return;
327
198
  }
199
+ console.log(this.formatMessage("INFO", message));
328
200
  }
329
201
  warn(message, data) {
330
202
  if (this.shouldLog("WARN")) {
@@ -420,37 +292,191 @@ var require_dist = __commonJS({
420
292
  }
421
293
  });
422
294
 
423
- // packages/core/dist/domain/code/pairing-index.js
424
- var require_pairing_index = __commonJS({
425
- "packages/core/dist/domain/code/pairing-index.js"(exports2) {
295
+ // packages/core/dist/infrastructure/repository.js
296
+ var require_repository = __commonJS({
297
+ "packages/core/dist/infrastructure/repository.js"(exports2) {
426
298
  "use strict";
299
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
300
+ if (k2 === void 0) k2 = k;
301
+ var desc = Object.getOwnPropertyDescriptor(m, k);
302
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
303
+ desc = { enumerable: true, get: function() {
304
+ return m[k];
305
+ } };
306
+ }
307
+ Object.defineProperty(o, k2, desc);
308
+ }) : (function(o, m, k, k2) {
309
+ if (k2 === void 0) k2 = k;
310
+ o[k2] = m[k];
311
+ }));
312
+ var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
313
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
314
+ }) : function(o, v) {
315
+ o["default"] = v;
316
+ });
317
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
318
+ var ownKeys = function(o) {
319
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
320
+ var ar = [];
321
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
322
+ return ar;
323
+ };
324
+ return ownKeys(o);
325
+ };
326
+ return function(mod) {
327
+ if (mod && mod.__esModule) return mod;
328
+ var result = {};
329
+ if (mod != null) {
330
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
331
+ }
332
+ __setModuleDefault(result, mod);
333
+ return result;
334
+ };
335
+ })();
427
336
  Object.defineProperty(exports2, "__esModule", { value: true });
428
- exports2.PairingIndexService = void 0;
337
+ exports2.FileSystemRepository = void 0;
338
+ var fs = __importStar(require("fs/promises"));
339
+ var path_1 = require("path");
429
340
  var utils_1 = require_dist();
430
- var PairingIndexService = class {
431
- constructor(commitRepository) {
432
- this.commitRepository = commitRepository;
433
- this.logger = utils_1.logger;
341
+ var FileSystemRepository = class {
342
+ constructor(filePath) {
343
+ this.filePath = filePath;
434
344
  }
435
- async getPairingIndex(options) {
436
- let selectedAuthors = options?.selectedAuthors || [];
437
- const startDate = options?.startDate;
438
- const endDate = options?.endDate;
439
- const includeAuthorsStr = options?.includeAuthors;
440
- const excludeAuthorsStr = options?.excludeAuthors;
441
- if (includeAuthorsStr) {
442
- const parsed = includeAuthorsStr.split(",").map((a) => a.trim()).filter((a) => a.length > 0);
443
- selectedAuthors = [...selectedAuthors, ...parsed];
444
- }
445
- let excludedList = /* @__PURE__ */ new Set();
446
- if (excludeAuthorsStr) {
447
- excludedList = new Set(excludeAuthorsStr.split(",").map((a) => a.trim().toLowerCase()).filter((a) => a.length > 0));
448
- }
449
- if (selectedAuthors.length > 0) {
450
- this.logger.info(`Filtering commits to authors: ${selectedAuthors.join(", ")}`);
345
+ deserialize(data) {
346
+ return JSON.parse(data);
347
+ }
348
+ serialize(item) {
349
+ return JSON.stringify(item, null, 2);
350
+ }
351
+ async save(item) {
352
+ const data = this.serialize(item);
353
+ await this.ensureDirectoryExists();
354
+ await fs.writeFile(this.filePath, data, "utf-8");
355
+ }
356
+ async saveAll(items) {
357
+ const data = JSON.stringify(items, null, 2);
358
+ await this.ensureDirectoryExists();
359
+ await fs.writeFile(this.filePath, data, "utf-8");
360
+ }
361
+ async load() {
362
+ try {
363
+ const data = await fs.readFile(this.filePath, "utf-8");
364
+ return this.deserialize(data);
365
+ } catch (error) {
366
+ if (error.code === "ENOENT") {
367
+ return null;
368
+ }
369
+ throw error;
451
370
  }
452
- const allCommits = await this.commitRepository.loadAll();
453
- let filteredCommits = allCommits;
371
+ }
372
+ async loadAll() {
373
+ try {
374
+ utils_1.logger.debug(`Loading all items from ${this.filePath}`);
375
+ const data = await fs.readFile(this.filePath, "utf-8");
376
+ const parsed = JSON.parse(data);
377
+ if (!Array.isArray(parsed)) {
378
+ return [parsed];
379
+ }
380
+ if (parsed.length > 0 && typeof parsed[0] === "string") {
381
+ return parsed.map((item) => this.deserialize(item));
382
+ }
383
+ return parsed;
384
+ } catch (error) {
385
+ if (error.code === "ENOENT") {
386
+ return [];
387
+ }
388
+ throw error;
389
+ }
390
+ }
391
+ async delete() {
392
+ try {
393
+ await fs.unlink(this.filePath);
394
+ } catch (error) {
395
+ if (error.code !== "ENOENT") {
396
+ throw error;
397
+ }
398
+ }
399
+ }
400
+ async exists() {
401
+ try {
402
+ await fs.access(this.filePath);
403
+ return true;
404
+ } catch {
405
+ return false;
406
+ }
407
+ }
408
+ async ensureDirectoryExists() {
409
+ const dir = (0, path_1.dirname)(this.filePath);
410
+ try {
411
+ await fs.mkdir(dir, { recursive: true });
412
+ } catch (error) {
413
+ if (error.code !== "EEXIST") {
414
+ throw error;
415
+ }
416
+ }
417
+ }
418
+ };
419
+ exports2.FileSystemRepository = FileSystemRepository;
420
+ }
421
+ });
422
+
423
+ // packages/core/dist/infrastructure/index.js
424
+ var require_infrastructure = __commonJS({
425
+ "packages/core/dist/infrastructure/index.js"(exports2) {
426
+ "use strict";
427
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
428
+ if (k2 === void 0) k2 = k;
429
+ var desc = Object.getOwnPropertyDescriptor(m, k);
430
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
431
+ desc = { enumerable: true, get: function() {
432
+ return m[k];
433
+ } };
434
+ }
435
+ Object.defineProperty(o, k2, desc);
436
+ }) : (function(o, m, k, k2) {
437
+ if (k2 === void 0) k2 = k;
438
+ o[k2] = m[k];
439
+ }));
440
+ var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
441
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
442
+ };
443
+ Object.defineProperty(exports2, "__esModule", { value: true });
444
+ __exportStar(require_configuration(), exports2);
445
+ __exportStar(require_repository(), exports2);
446
+ }
447
+ });
448
+
449
+ // packages/core/dist/domain/code/pairing-index.js
450
+ var require_pairing_index = __commonJS({
451
+ "packages/core/dist/domain/code/pairing-index.js"(exports2) {
452
+ "use strict";
453
+ Object.defineProperty(exports2, "__esModule", { value: true });
454
+ exports2.PairingIndexService = void 0;
455
+ var utils_1 = require_dist();
456
+ var PairingIndexService = class {
457
+ constructor(commitRepository) {
458
+ this.commitRepository = commitRepository;
459
+ this.logger = utils_1.logger;
460
+ }
461
+ async getPairingIndex(options) {
462
+ let selectedAuthors = options?.selectedAuthors || [];
463
+ const startDate = options?.startDate;
464
+ const endDate = options?.endDate;
465
+ const includeAuthorsStr = options?.includeAuthors;
466
+ const excludeAuthorsStr = options?.excludeAuthors;
467
+ if (includeAuthorsStr) {
468
+ const parsed = includeAuthorsStr.split(",").map((a) => a.trim()).filter((a) => a.length > 0);
469
+ selectedAuthors = [...selectedAuthors, ...parsed];
470
+ }
471
+ let excludedList = /* @__PURE__ */ new Set();
472
+ if (excludeAuthorsStr) {
473
+ excludedList = new Set(excludeAuthorsStr.split(",").map((a) => a.trim().toLowerCase()).filter((a) => a.length > 0));
474
+ }
475
+ if (selectedAuthors.length > 0) {
476
+ this.logger.info(`Filtering commits to authors: ${selectedAuthors.join(", ")}`);
477
+ }
478
+ const allCommits = await this.commitRepository.loadAll();
479
+ let filteredCommits = allCommits;
454
480
  if (startDate || endDate) {
455
481
  filteredCommits = this.filterByDateRange(allCommits, startDate, endDate);
456
482
  }
@@ -920,9 +946,6 @@ var require_pipelines_service = __commonJS({
920
946
  for (const run of runs) {
921
947
  const jobs = run.jobs || [];
922
948
  for (const job of jobs) {
923
- if (job.conclusion === "skipped") {
924
- continue;
925
- }
926
949
  const jobName = job.name;
927
950
  if (!jobMetricsMap.has(jobName)) {
928
951
  jobMetricsMap.set(jobName, {
@@ -931,7 +954,12 @@ var require_pipelines_service = __commonJS({
931
954
  averageDurationMinutes: 0,
932
955
  successCount: 0,
933
956
  failureCount: 0,
934
- successRate: 0
957
+ successRate: 0,
958
+ actionRequiredCount: 0,
959
+ cancelledCount: 0,
960
+ skippedCount: 0,
961
+ timedOutCount: 0,
962
+ unknownCount: 0
935
963
  });
936
964
  }
937
965
  const metrics = jobMetricsMap.get(jobName);
@@ -940,6 +968,16 @@ var require_pipelines_service = __commonJS({
940
968
  metrics.successCount += 1;
941
969
  } else if (job.conclusion === "failure") {
942
970
  metrics.failureCount += 1;
971
+ } else if (job.conclusion === "cancelled") {
972
+ metrics.cancelledCount += 1;
973
+ } else if (job.conclusion === "timed_out") {
974
+ metrics.timedOutCount += 1;
975
+ } else if (job.conclusion === "action_required") {
976
+ metrics.actionRequiredCount += 1;
977
+ } else if (job.conclusion === "skipped") {
978
+ metrics.skippedCount += 1;
979
+ } else {
980
+ metrics.unknownCount += 1;
943
981
  }
944
982
  }
945
983
  }
@@ -965,8 +1003,7 @@ var require_pipelines_service = __commonJS({
965
1003
  * Filter runs by the provided criteria.
966
1004
  */
967
1005
  async filterRuns(filters) {
968
- const allRuns = await this.pipelineRepository.loadAll();
969
- let result = allRuns;
1006
+ let result = await this.loadCachedWorkflowsWithJobs();
970
1007
  if (!filters) {
971
1008
  return result;
972
1009
  }
@@ -1054,6 +1091,9 @@ var require_pipelines_service = __commonJS({
1054
1091
  return `${year}-${month}`;
1055
1092
  }
1056
1093
  }
1094
+ async loadCachedWorkflowsWithJobs() {
1095
+ return this.pipelineRepository.loadPipelines();
1096
+ }
1057
1097
  };
1058
1098
  exports2.PipelinesService = PipelinesService;
1059
1099
  }
@@ -17297,15 +17337,15 @@ var require_axios = __commonJS({
17297
17337
  }
17298
17338
  });
17299
17339
 
17300
- // packages/core/dist/providers/github/github-clients.js
17301
- var require_github_clients = __commonJS({
17302
- "packages/core/dist/providers/github/github-clients.js"(exports2) {
17340
+ // packages/core/dist/providers/github/github-pr.js
17341
+ var require_github_pr = __commonJS({
17342
+ "packages/core/dist/providers/github/github-pr.js"(exports2) {
17303
17343
  "use strict";
17304
17344
  var __importDefault = exports2 && exports2.__importDefault || function(mod) {
17305
17345
  return mod && mod.__esModule ? mod : { "default": mod };
17306
17346
  };
17307
17347
  Object.defineProperty(exports2, "__esModule", { value: true });
17308
- exports2.GithubWorkflowClient = exports2.GithubPrsClient = void 0;
17348
+ exports2.GithubPrsClient = void 0;
17309
17349
  var axios_1 = __importDefault(require_axios());
17310
17350
  var utils_1 = require_dist();
17311
17351
  var GithubPrsClient = class {
@@ -17405,9 +17445,22 @@ var require_github_clients = __commonJS({
17405
17445
  }
17406
17446
  };
17407
17447
  exports2.GithubPrsClient = GithubPrsClient;
17448
+ }
17449
+ });
17450
+
17451
+ // packages/core/dist/providers/github/github-workflow-client.js
17452
+ var require_github_workflow_client = __commonJS({
17453
+ "packages/core/dist/providers/github/github-workflow-client.js"(exports2) {
17454
+ "use strict";
17455
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
17456
+ return mod && mod.__esModule ? mod : { "default": mod };
17457
+ };
17458
+ Object.defineProperty(exports2, "__esModule", { value: true });
17459
+ exports2.GithubWorkflowClient = void 0;
17460
+ var axios_1 = __importDefault(require_axios());
17461
+ var utils_1 = require_dist();
17408
17462
  var GithubWorkflowClient = class {
17409
17463
  constructor(token, owner, repo) {
17410
- this.token = token;
17411
17464
  this.owner = owner;
17412
17465
  this.repo = repo;
17413
17466
  this.baseUrl = "https://api.github.com";
@@ -17422,41 +17475,18 @@ var require_github_clients = __commonJS({
17422
17475
  });
17423
17476
  }
17424
17477
  async fetchWorkflows(options) {
17425
- const per_page = 100;
17426
- let page = 1;
17427
17478
  const allRuns = [];
17428
17479
  try {
17429
- while (true) {
17430
- this.logger.info(`Fetching workflow runs page ${page} for ${this.owner}/${this.repo}`);
17431
- const response = await this.fetchWorkflowRunsPage(page, per_page);
17432
- const runs = response.runs;
17433
- if (!runs || runs.length === 0) {
17434
- break;
17435
- }
17436
- for (const run of runs) {
17437
- if (options?.startDate && new Date(run.created_at) < new Date(options.startDate)) {
17438
- page = -1;
17439
- break;
17440
- }
17441
- if (!options?.endDate || new Date(run.created_at) <= new Date(options.endDate)) {
17442
- allRuns.push({
17443
- ...run,
17444
- createdAt: run.created_at,
17445
- updatedAt: run.updated_at,
17446
- runNumber: run.run_number,
17447
- htmlUrl: run.html_url,
17448
- startedAt: run.run_started_at,
17449
- completedAt: run.updated_at,
17450
- branch: run.head_branch,
17451
- path: run.path || run.workflow_url || ""
17452
- });
17453
- }
17480
+ if (options?.byDay && options?.startDate && options?.endDate) {
17481
+ const days = this.generateDayRange(options.startDate, options.endDate);
17482
+ this.logger.info(`Fetching workflows by day: ${days.length} day(s)`);
17483
+ for (const day of days) {
17484
+ const dayRuns = await this.fetchWorkflowsForDay(day.start, day.end, options.rawFilters);
17485
+ allRuns.push(...dayRuns);
17454
17486
  }
17455
- if (page < 0)
17456
- break;
17457
- if (!response.hasNext)
17458
- break;
17459
- page++;
17487
+ } else {
17488
+ const dayRuns = await this.fetchWorkflowsForDay(options?.startDate, options?.endDate, options?.rawFilters);
17489
+ allRuns.push(...dayRuns);
17460
17490
  }
17461
17491
  this.logger.info(`Fetched ${allRuns.length} workflow runs total`);
17462
17492
  return allRuns;
@@ -17471,63 +17501,148 @@ var require_github_clients = __commonJS({
17471
17501
  throw error;
17472
17502
  }
17473
17503
  }
17474
- async fetchJobsForWorkflows(workflowIds) {
17475
- const allJobs = [];
17476
- try {
17477
- for (const runId of workflowIds) {
17478
- this.logger.info(`Fetching jobs for workflow run ${runId} in ${this.owner}/${this.repo}`);
17479
- let page = 1;
17480
- while (true) {
17481
- const response = await this.fetchJobsPage(runId, page, 100);
17482
- const jobs = response.jobs || [];
17483
- for (const job of jobs) {
17484
- allJobs.push({
17485
- ...job,
17486
- startedAt: job.started_at,
17487
- completedAt: job.completed_at,
17488
- duration: this.calculateDuration(job.started_at, job.completed_at),
17489
- runId
17490
- });
17491
- }
17492
- if (!response.hasNext) {
17493
- break;
17494
- }
17495
- page += 1;
17496
- }
17504
+ async fetchWorkflowsForDay(startDate, endDate, rawFilters) {
17505
+ const per_page = 100;
17506
+ let page = 1;
17507
+ const dayRuns = [];
17508
+ while (true) {
17509
+ this.logger.info(`Fetching workflow runs page ${page} for ${this.owner}/${this.repo}`);
17510
+ const optionsParams = {
17511
+ rawFilters
17512
+ };
17513
+ if (startDate && endDate) {
17514
+ optionsParams.created = `${startDate}..${endDate}`;
17497
17515
  }
17498
- this.logger.info(`Fetched ${allJobs.length} jobs total`);
17499
- return allJobs;
17500
- } catch (error) {
17501
- if (axios_1.default.isAxiosError(error)) {
17502
- this.logger.error(`GitHub API error fetching jobs: ${error.message}`);
17503
- throw new Error(`Failed to fetch jobs: ${error.message}`);
17516
+ const response = await this.fetchWorkflowRunsPage(page, per_page, optionsParams);
17517
+ const runs = response.runs;
17518
+ if (!runs || runs.length === 0) {
17519
+ break;
17504
17520
  }
17505
- throw error;
17521
+ for (const run of runs) {
17522
+ dayRuns.push({
17523
+ ...run,
17524
+ commit: run.head_sha,
17525
+ jobs: [],
17526
+ number: Number(run.run_number),
17527
+ createdAt: run.created_at,
17528
+ updatedAt: run.updated_at,
17529
+ startedAt: run.run_started_at,
17530
+ completedAt: run.updated_at,
17531
+ branch: run.head_branch,
17532
+ path: run.path
17533
+ });
17534
+ }
17535
+ if (page < 0)
17536
+ break;
17537
+ if (!response.hasNext)
17538
+ break;
17539
+ page++;
17540
+ }
17541
+ return dayRuns;
17542
+ }
17543
+ generateDayRange(startDate, endDate) {
17544
+ const days = [];
17545
+ const current = new Date(startDate);
17546
+ const end = new Date(endDate);
17547
+ while (current <= end) {
17548
+ const dayStart = new Date(current);
17549
+ dayStart.setUTCHours(0, 0, 0, 0);
17550
+ const dayEnd = new Date(current);
17551
+ dayEnd.setUTCHours(23, 59, 59, 999);
17552
+ days.push({
17553
+ start: dayStart.toISOString().split("T")[0] + "T00:00:00Z",
17554
+ end: dayEnd.toISOString().split("T")[0] + "T23:59:59Z"
17555
+ });
17556
+ current.setUTCDate(current.getUTCDate() + 1);
17506
17557
  }
17558
+ return days;
17507
17559
  }
17508
- calculateDuration(startedAt, completedAt) {
17509
- if (!startedAt || !completedAt)
17510
- return 0;
17511
- return (new Date(completedAt).getTime() - new Date(startedAt).getTime()) / 1e3;
17512
- }
17513
- async fetchWorkflowRunsPage(page, perPage = 100) {
17514
- const response = await this.axiosInstance.get(`/repos/${this.owner}/${this.repo}/actions/runs`, {
17560
+ async fetchWorkflowRunsPage(page, perPage = 100, options) {
17561
+ const requestParams = {
17515
17562
  params: {
17516
17563
  per_page: perPage,
17517
- page
17564
+ page,
17565
+ ...options?.created ? { created: options.created } : {},
17566
+ ...this.parseRawFilters(options?.rawFilters)
17518
17567
  }
17519
- });
17568
+ };
17569
+ const url = `/repos/${this.owner}/${this.repo}/actions/runs`;
17570
+ this.logger.info(`${url} ${JSON.stringify(requestParams.params)}`);
17571
+ const response = await this.axiosInstance.get(url, requestParams);
17520
17572
  const runs = response.data.workflow_runs || [];
17573
+ this.logger.info(`Fetched ${runs.length} workflow runs`);
17521
17574
  const hasNext = this.hasNextLink(response.headers?.link) || runs.length === perPage;
17522
17575
  return { runs, hasNext };
17523
17576
  }
17577
+ hasNextLink(linkHeader) {
17578
+ if (!linkHeader) {
17579
+ return false;
17580
+ }
17581
+ return linkHeader.includes('rel="next"');
17582
+ }
17583
+ parseRawFilters(rawFilters) {
17584
+ if (!rawFilters) {
17585
+ return {};
17586
+ }
17587
+ return rawFilters.split(",").reduce((filters, entry) => {
17588
+ const trimmedEntry = entry.trim();
17589
+ if (!trimmedEntry) {
17590
+ return filters;
17591
+ }
17592
+ const separatorIndex = trimmedEntry.indexOf("=");
17593
+ if (separatorIndex <= 0) {
17594
+ return filters;
17595
+ }
17596
+ const key = trimmedEntry.slice(0, separatorIndex).trim();
17597
+ const value = trimmedEntry.slice(separatorIndex + 1).trim();
17598
+ if (!key || !value) {
17599
+ return filters;
17600
+ }
17601
+ filters[key] = value;
17602
+ return filters;
17603
+ }, {});
17604
+ }
17605
+ };
17606
+ exports2.GithubWorkflowClient = GithubWorkflowClient;
17607
+ }
17608
+ });
17609
+
17610
+ // packages/core/dist/providers/github/github-workflow-job-client.js
17611
+ var require_github_workflow_job_client = __commonJS({
17612
+ "packages/core/dist/providers/github/github-workflow-job-client.js"(exports2) {
17613
+ "use strict";
17614
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
17615
+ return mod && mod.__esModule ? mod : { "default": mod };
17616
+ };
17617
+ Object.defineProperty(exports2, "__esModule", { value: true });
17618
+ exports2.GithubWorkflowJobClient = void 0;
17619
+ var axios_1 = __importDefault(require_axios());
17620
+ var utils_1 = require_dist();
17621
+ var GithubWorkflowJobClient = class {
17622
+ constructor(token, owner, repo) {
17623
+ this.owner = owner;
17624
+ this.repo = repo;
17625
+ this.baseUrl = "https://api.github.com";
17626
+ this.logger = new utils_1.Logger("GithubWorkflowClient");
17627
+ this.axiosInstance = axios_1.default.create({
17628
+ baseURL: this.baseUrl,
17629
+ headers: {
17630
+ Authorization: `token ${token}`,
17631
+ Accept: "application/vnd.github.v3+json"
17632
+ },
17633
+ timeout: 3e4
17634
+ });
17635
+ }
17524
17636
  async fetchJobsPage(runId, page, perPage = 100) {
17525
- const response = await this.axiosInstance.get(`/repos/${this.owner}/${this.repo}/actions/runs/${runId}/jobs`, {
17637
+ const url = `/repos/${this.owner}/${this.repo}/actions/runs/${runId}/jobs`;
17638
+ const requestParams = {
17526
17639
  params: {
17527
17640
  per_page: perPage,
17528
17641
  page
17529
17642
  }
17530
- });
17643
+ };
17644
+ this.logger.info(`${url} ${JSON.stringify(requestParams.params)}`);
17645
+ const response = await this.axiosInstance.get(url, requestParams);
17531
17646
  const jobs = response.data.jobs || [];
17532
17647
  const hasNext = this.hasNextLink(response.headers?.link) || jobs.length === perPage;
17533
17648
  return { jobs, hasNext };
@@ -17539,7 +17654,7 @@ var require_github_clients = __commonJS({
17539
17654
  return linkHeader.includes('rel="next"');
17540
17655
  }
17541
17656
  };
17542
- exports2.GithubWorkflowClient = GithubWorkflowClient;
17657
+ exports2.GithubWorkflowJobClient = GithubWorkflowJobClient;
17543
17658
  }
17544
17659
  });
17545
17660
 
@@ -17548,13 +17663,18 @@ var require_github = __commonJS({
17548
17663
  "packages/core/dist/providers/github/index.js"(exports2) {
17549
17664
  "use strict";
17550
17665
  Object.defineProperty(exports2, "__esModule", { value: true });
17551
- exports2.GithubWorkflowClient = exports2.GithubPrsClient = void 0;
17552
- var github_clients_1 = require_github_clients();
17666
+ exports2.GithubWorkflowJobClient = exports2.GithubWorkflowClient = exports2.GithubPrsClient = void 0;
17667
+ var github_pr_1 = require_github_pr();
17553
17668
  Object.defineProperty(exports2, "GithubPrsClient", { enumerable: true, get: function() {
17554
- return github_clients_1.GithubPrsClient;
17669
+ return github_pr_1.GithubPrsClient;
17555
17670
  } });
17671
+ var github_workflow_client_1 = require_github_workflow_client();
17556
17672
  Object.defineProperty(exports2, "GithubWorkflowClient", { enumerable: true, get: function() {
17557
- return github_clients_1.GithubWorkflowClient;
17673
+ return github_workflow_client_1.GithubWorkflowClient;
17674
+ } });
17675
+ var github_workflow_job_client_1 = require_github_workflow_job_client();
17676
+ Object.defineProperty(exports2, "GithubWorkflowJobClient", { enumerable: true, get: function() {
17677
+ return github_workflow_job_client_1.GithubWorkflowJobClient;
17558
17678
  } });
17559
17679
  }
17560
17680
  });
@@ -17905,6 +18025,49 @@ var require_sonarqube_client = __commonJS({
17905
18025
  throw error;
17906
18026
  }
17907
18027
  }
18028
+ async fetchComponentTree(options) {
18029
+ try {
18030
+ const component = options?.component || this.projectKey;
18031
+ const depth = options?.depth ?? -1;
18032
+ const metrics = options?.metrics || [
18033
+ "complexity",
18034
+ "cognitive_complexity",
18035
+ "ncloc",
18036
+ "sqale_rating",
18037
+ "coverage"
18038
+ ];
18039
+ this.logger.info(`Fetching SonarQube component tree for component ${component} with depth ${depth}: ${metrics.join(", ")}`);
18040
+ const response = await this.axiosInstance.get("/api/measures/component_tree", {
18041
+ params: {
18042
+ component,
18043
+ depth,
18044
+ metricKeys: metrics.join(","),
18045
+ ps: 500
18046
+ // Max results per page
18047
+ }
18048
+ });
18049
+ const { baseComponent, components } = response.data;
18050
+ if (!baseComponent) {
18051
+ throw new Error(`Component ${component} not found in SonarQube.`);
18052
+ }
18053
+ const allComponents = [baseComponent, ...components || []];
18054
+ this.logger.info(`Fetched component tree with ${allComponents.length} components for ${component}`);
18055
+ return allComponents;
18056
+ } catch (error) {
18057
+ const errorMsg = error instanceof Error ? error.message : String(error);
18058
+ this.logger.error(`Failed to fetch SonarQube component tree: ${errorMsg}`);
18059
+ if (axios_1.default.isAxiosError(error)) {
18060
+ if (error.response?.status === 401) {
18061
+ throw new Error("SonarQube authentication failed. Check token.");
18062
+ } else if (error.response?.status === 404) {
18063
+ throw new Error(`SonarQube component ${options?.component || this.projectKey} not found.`);
18064
+ } else if (error.code === "ECONNABORTED") {
18065
+ throw new Error("SonarQube API request timeout (30s).");
18066
+ }
18067
+ }
18068
+ throw error;
18069
+ }
18070
+ }
17908
18071
  };
17909
18072
  exports2.SonarqubeMeasuresClient = SonarqubeMeasuresClient;
17910
18073
  }
@@ -18206,27 +18369,32 @@ var require_codemaat_analyzer = __commonJS({
18206
18369
  if (lines.length < 2) {
18207
18370
  return [];
18208
18371
  }
18209
- const header = lines[0].split(",").map((h) => h.trim().replace(/^"|"$/g, ""));
18210
- const file1Idx = header.findIndex((h) => h.toLowerCase().includes("file1") || h.toLowerCase().includes("entity1"));
18211
- const file2Idx = header.findIndex((h) => h.toLowerCase().includes("file2") || h.toLowerCase().includes("entity2"));
18212
- const couplingIdx = header.findIndex((h) => h.toLowerCase().includes("coupl") || h.toLowerCase().includes("strength"));
18372
+ const delimiter = this.detectCsvDelimiter(lines[0]);
18373
+ const header = this.parseCsvLine(lines[0], delimiter).map((h) => h.trim().replace(/^"|"$/g, ""));
18374
+ const file1Idx = header.findIndex((h) => h.toLowerCase() === "entity");
18375
+ const file2Idx = header.findIndex((h) => h.toLowerCase() === "coupled");
18376
+ const couplingIdx = header.findIndex((h) => h.toLowerCase() === "degree");
18377
+ const averageRevsIdx = header.findIndex((h) => h.toLowerCase().includes("average-revs"));
18213
18378
  if (file1Idx < 0 || file2Idx < 0 || couplingIdx < 0) {
18214
18379
  this.logger.warn("Invalid file coupling CSV format. Missing required columns.");
18215
18380
  return [];
18216
18381
  }
18217
18382
  const coupleData = [];
18218
18383
  for (let i = 1; i < lines.length; i++) {
18219
- const row = lines[i].split(",").map((v) => v.trim().replace(/^"|"$/g, ""));
18384
+ const row = this.parseCsvLine(lines[i], delimiter).map((v) => v.trim().replace(/^"|"$/g, ""));
18220
18385
  if (row.length <= Math.max(file1Idx, file2Idx, couplingIdx)) {
18221
18386
  continue;
18222
18387
  }
18223
- const file1 = row[file1Idx];
18224
- const file2 = row[file2Idx];
18225
- const couplingStrength = parseInt(row[couplingIdx], 10) || 0;
18226
- if (options?.ignorePatterns && (this.isIgnoredPath(file1, options.ignorePatterns) || this.isIgnoredPath(file2, options.ignorePatterns))) {
18227
- continue;
18228
- }
18229
- coupleData.push({ file1, file2, couplingStrength });
18388
+ const entity = row[file1Idx];
18389
+ const coupled = row[file2Idx];
18390
+ const degree = parseInt(row[couplingIdx], 10) || 0;
18391
+ const averageRevs = averageRevsIdx >= 0 ? parseInt(row[averageRevsIdx], 10) || 0 : 0;
18392
+ coupleData.push({
18393
+ entity,
18394
+ coupled,
18395
+ degree,
18396
+ averageRevs
18397
+ });
18230
18398
  }
18231
18399
  this.logger.info(`Parsed ${coupleData.length} file coupling relationships`);
18232
18400
  return coupleData;
@@ -18236,6 +18404,36 @@ var require_codemaat_analyzer = __commonJS({
18236
18404
  throw error;
18237
18405
  }
18238
18406
  }
18407
+ detectCsvDelimiter(headerLine) {
18408
+ const semicolons = (headerLine.match(/;/g) || []).length;
18409
+ const commas = (headerLine.match(/,/g) || []).length;
18410
+ return semicolons > commas ? ";" : ",";
18411
+ }
18412
+ parseCsvLine(line, delimiter) {
18413
+ const values = [];
18414
+ let current = "";
18415
+ let inQuotes = false;
18416
+ for (let i = 0; i < line.length; i++) {
18417
+ const char = line[i];
18418
+ if (char === '"') {
18419
+ if (inQuotes && line[i + 1] === '"') {
18420
+ current += '"';
18421
+ i += 1;
18422
+ continue;
18423
+ }
18424
+ inQuotes = !inQuotes;
18425
+ continue;
18426
+ }
18427
+ if (!inQuotes && char === delimiter) {
18428
+ values.push(current);
18429
+ current = "";
18430
+ continue;
18431
+ }
18432
+ current += char;
18433
+ }
18434
+ values.push(current);
18435
+ return values;
18436
+ }
18239
18437
  async analyze(options) {
18240
18438
  try {
18241
18439
  this.logger.info("Running CodeMaat analysis");
@@ -18350,7 +18548,7 @@ var require_pull_requests_repository = __commonJS({
18350
18548
  /**
18351
18549
  * Refresh PR data from GitHub
18352
18550
  */
18353
- async refreshPRs(options) {
18551
+ async fetchPRs(options) {
18354
18552
  const fromCache = await this.cache.loadAll();
18355
18553
  if (!options?.forceRefresh && fromCache.length > 0) {
18356
18554
  utils_1.logger.debug(`Using cached PRs: ${fromCache.length} records`);
@@ -18368,21 +18566,21 @@ var require_pull_requests_repository = __commonJS({
18368
18566
  * Get PR metrics
18369
18567
  */
18370
18568
  async getPRMetrics(filters) {
18371
- await this.refreshPRs(filters);
18569
+ await this.fetchPRs(filters);
18372
18570
  return this.prService.getMetrics(filters);
18373
18571
  }
18374
18572
  /**
18375
18573
  * Get PR metrics by month
18376
18574
  */
18377
18575
  async getPRsByMonth(filters) {
18378
- await this.refreshPRs(filters);
18576
+ await this.fetchPRs(filters);
18379
18577
  return this.prService.getMetricsByMonth(filters);
18380
18578
  }
18381
18579
  /**
18382
18580
  * Get PR metrics by week
18383
18581
  */
18384
18582
  async getPRsByWeek(filters) {
18385
- await this.refreshPRs(filters);
18583
+ await this.fetchPRs(filters);
18386
18584
  return this.prService.getMetricsByWeek(filters);
18387
18585
  }
18388
18586
  };
@@ -18394,262 +18592,70 @@ var require_pull_requests_repository = __commonJS({
18394
18592
  var require_pipelines_repository = __commonJS({
18395
18593
  "packages/core/dist/aggregates/pipelines-repository.js"(exports2) {
18396
18594
  "use strict";
18397
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
18398
- if (k2 === void 0) k2 = k;
18399
- var desc = Object.getOwnPropertyDescriptor(m, k);
18400
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18401
- desc = { enumerable: true, get: function() {
18402
- return m[k];
18403
- } };
18595
+ Object.defineProperty(exports2, "__esModule", { value: true });
18596
+ exports2.PipelinesRepository = void 0;
18597
+ var utils_1 = require_dist();
18598
+ var PipelinesRepository = class {
18599
+ constructor(pipelineRunFileSystemRepository, pipelineJobsFileSystemRepository) {
18600
+ this.pipelineRunFileSystemRepository = pipelineRunFileSystemRepository;
18601
+ this.pipelineJobsFileSystemRepository = pipelineJobsFileSystemRepository;
18602
+ }
18603
+ async loadPipelines() {
18604
+ const runs = await this.pipelineRunFileSystemRepository.loadAll();
18605
+ const pipelineRuns = runs.map(this.mapPipelinesToDomain);
18606
+ utils_1.logger.info(`Loaded ${pipelineRuns.length} pipeline runs from file system repository`);
18607
+ const jobs = await this.pipelineJobsFileSystemRepository.loadAll();
18608
+ if (jobs.length === 0 || pipelineRuns.length === 0) {
18609
+ return pipelineRuns;
18610
+ }
18611
+ const runsById = /* @__PURE__ */ new Map();
18612
+ for (const run of pipelineRuns) {
18613
+ runsById.set(String(run.id), run);
18614
+ }
18615
+ for (const job of jobs) {
18616
+ const run = runsById.get(String(job.run_id));
18617
+ if (!run) {
18618
+ continue;
18619
+ }
18620
+ if (!run.jobs) {
18621
+ run.jobs = [];
18622
+ }
18623
+ run.jobs.push(this.mapPipelineJobsToDomain(job));
18624
+ }
18625
+ return pipelineRuns;
18404
18626
  }
18405
- Object.defineProperty(o, k2, desc);
18406
- }) : (function(o, m, k, k2) {
18407
- if (k2 === void 0) k2 = k;
18408
- o[k2] = m[k];
18409
- }));
18410
- var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
18411
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18412
- }) : function(o, v) {
18413
- o["default"] = v;
18414
- });
18415
- var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
18416
- var ownKeys = function(o) {
18417
- ownKeys = Object.getOwnPropertyNames || function(o2) {
18418
- var ar = [];
18419
- for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
18420
- return ar;
18421
- };
18422
- return ownKeys(o);
18423
- };
18424
- return function(mod) {
18425
- if (mod && mod.__esModule) return mod;
18426
- var result = {};
18427
- if (mod != null) {
18428
- for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
18429
- }
18430
- __setModuleDefault(result, mod);
18431
- return result;
18432
- };
18433
- })();
18434
- Object.defineProperty(exports2, "__esModule", { value: true });
18435
- exports2.PipelinesRepository = void 0;
18436
- var utils_1 = require_dist();
18437
- var fs = __importStar(require("fs/promises"));
18438
- var path = __importStar(require("path"));
18439
- var repository_1 = require_repository();
18440
- var pipelines_1 = require_pipelines();
18441
- var PipelinesRepository = class {
18442
- constructor(githubWorkflowClient, cacheDir) {
18443
- this.githubWorkflowClient = githubWorkflowClient;
18444
- this.cacheDir = cacheDir;
18445
- this.cache = new repository_1.FileSystemRepository(`${cacheDir}/workflows.json`);
18446
- this.pipelineService = new pipelines_1.PipelinesService(this.cache);
18447
- }
18448
- /**
18449
- * Refresh pipeline data from GitHub
18450
- */
18451
- async refreshPipelines(options) {
18452
- const fromCache = await this.cache.loadAll();
18453
- if (!options?.forceRefresh && fromCache.length > 0) {
18454
- if (options?.includeJobs) {
18455
- const missingJobs = fromCache.filter((run) => !run.jobs || run.jobs.length === 0);
18456
- if (missingJobs.length > 0) {
18457
- utils_1.logger.info(`Fetching jobs for ${missingJobs.length} cached workflow runs...`);
18458
- const jobs = await this.fetchJobsWithResume(missingJobs);
18459
- const jobsByRunId = /* @__PURE__ */ new Map();
18460
- for (const job of jobs) {
18461
- const runId = String(job.runId);
18462
- const existing = jobsByRunId.get(runId) || [];
18463
- existing.push(job);
18464
- jobsByRunId.set(runId, existing);
18465
- }
18466
- const enrichedRuns = fromCache.map((run) => ({
18467
- ...run,
18468
- jobs: jobsByRunId.get(String(run.id)) || run.jobs || []
18469
- }));
18470
- await this.cache.saveAll(enrichedRuns);
18471
- return enrichedRuns;
18472
- }
18473
- }
18474
- utils_1.logger.info(`Using cached pipelines: ${fromCache.length} records`);
18475
- return fromCache;
18476
- }
18477
- utils_1.logger.info("Fetching workflows from GitHub...");
18478
- const freshWorkflows = await this.fetchWorkflowsWithResume({
18479
- startDate: options?.startDate,
18480
- endDate: options?.endDate
18481
- });
18482
- let workflows = freshWorkflows;
18483
- if (options?.includeJobs && workflows.length > 0) {
18484
- utils_1.logger.info(`Fetching jobs for ${workflows.length} workflow runs...`);
18485
- const jobs = await this.fetchJobsWithResume(workflows);
18486
- const jobsByRunId = /* @__PURE__ */ new Map();
18487
- for (const job of jobs) {
18488
- const runId = String(job.runId);
18489
- const existing = jobsByRunId.get(runId) || [];
18490
- existing.push(job);
18491
- jobsByRunId.set(runId, existing);
18492
- }
18493
- workflows = workflows.map((run) => ({
18494
- ...run,
18495
- jobs: jobsByRunId.get(String(run.id)) || []
18496
- }));
18497
- }
18498
- await this.cache.saveAll(workflows);
18499
- return workflows;
18500
- }
18501
- async fetchWorkflowsWithResume(options) {
18502
- const progressPath = this.fileInCache("workflows_progress.json");
18503
- const incompletedPath = this.fileInCache("workflows_incompleted.json");
18504
- const progress = await this.readJson(progressPath, null);
18505
- const runs = await this.readJson(incompletedPath, []);
18506
- let page = progress?.page || 1;
18507
- const perPage = 100;
18508
- let stopPagination = false;
18509
- while (!stopPagination) {
18510
- try {
18511
- const response = await this.githubWorkflowClient.fetchWorkflowRunsPage(page, perPage);
18512
- const fetchedRuns = response.runs || [];
18513
- if (fetchedRuns.length === 0) {
18514
- break;
18515
- }
18516
- for (const run of fetchedRuns) {
18517
- if (options?.startDate && new Date(run.created_at) < new Date(options.startDate)) {
18518
- stopPagination = true;
18519
- break;
18520
- }
18521
- if (!options?.endDate || new Date(run.created_at) <= new Date(options.endDate)) {
18522
- runs.push({
18523
- ...run,
18524
- createdAt: run.created_at,
18525
- updatedAt: run.updated_at,
18526
- runNumber: run.run_number,
18527
- htmlUrl: run.html_url,
18528
- startedAt: run.run_started_at,
18529
- completedAt: run.updated_at,
18530
- branch: run.head_branch,
18531
- path: run.path || run.workflow_url || ""
18532
- });
18533
- }
18534
- }
18535
- await this.writeJson(incompletedPath, runs);
18536
- if (stopPagination || !response.hasNext) {
18537
- break;
18538
- }
18539
- page += 1;
18540
- await this.writeJson(progressPath, { page });
18541
- } catch (error) {
18542
- await this.writeJson(incompletedPath, runs);
18543
- await this.writeJson(progressPath, { page });
18544
- throw error;
18545
- }
18546
- }
18547
- await this.deleteFile(progressPath);
18548
- await this.deleteFile(incompletedPath);
18549
- return runs;
18550
- }
18551
- async fetchJobsWithResume(workflows) {
18552
- const progressPath = this.fileInCache("jobs_progress.json");
18553
- const incompletedPath = this.fileInCache("jobs_incompleted.json");
18554
- const progress = await this.readJson(progressPath, {
18555
- processedRunIds: [],
18556
- partial: null
18557
- });
18558
- const processedRunIds = new Set(progress.processedRunIds || []);
18559
- const allJobs = await this.readJson(incompletedPath, []);
18560
- const perPage = 100;
18561
- for (const run of workflows) {
18562
- const runId = String(run.id);
18563
- if (!runId || processedRunIds.has(runId)) {
18564
- continue;
18565
- }
18566
- let page = progress.partial?.runId === runId && progress.partial?.page ? progress.partial.page : 1;
18567
- while (true) {
18568
- try {
18569
- const response = await this.githubWorkflowClient.fetchJobsPage(runId, page, perPage);
18570
- const pageJobs = (response.jobs || []).map((job) => ({
18571
- ...job,
18572
- startedAt: job.started_at,
18573
- completedAt: job.completed_at,
18574
- runId
18575
- }));
18576
- allJobs.push(...pageJobs);
18577
- await this.writeJson(incompletedPath, allJobs);
18578
- if (response.hasNext) {
18579
- page += 1;
18580
- await this.writeJson(progressPath, {
18581
- processedRunIds: Array.from(processedRunIds),
18582
- partial: { runId, page }
18583
- });
18584
- continue;
18585
- }
18586
- processedRunIds.add(runId);
18587
- await this.writeJson(progressPath, {
18588
- processedRunIds: Array.from(processedRunIds),
18589
- partial: null
18590
- });
18591
- break;
18592
- } catch (error) {
18593
- await this.writeJson(incompletedPath, allJobs);
18594
- await this.writeJson(progressPath, {
18595
- processedRunIds: Array.from(processedRunIds),
18596
- partial: { runId, page }
18597
- });
18598
- throw error;
18599
- }
18600
- }
18601
- }
18602
- await this.deleteFile(progressPath);
18603
- await this.deleteFile(incompletedPath);
18604
- return allJobs;
18605
- }
18606
- fileInCache(fileName) {
18607
- return path.join(this.cacheDir, fileName);
18608
- }
18609
- async readJson(filePath, fallback) {
18610
- try {
18611
- const contents = await fs.readFile(filePath, "utf-8");
18612
- return JSON.parse(contents);
18613
- } catch (error) {
18614
- if (error.code === "ENOENT") {
18615
- return fallback;
18616
- }
18617
- throw error;
18618
- }
18619
- }
18620
- async writeJson(filePath, value) {
18621
- await fs.mkdir(path.dirname(filePath), { recursive: true });
18622
- await fs.writeFile(filePath, JSON.stringify(value, null, 2), "utf-8");
18623
- }
18624
- async deleteFile(filePath) {
18625
- try {
18626
- await fs.unlink(filePath);
18627
- } catch (error) {
18628
- if (error.code !== "ENOENT") {
18629
- throw error;
18630
- }
18631
- }
18627
+ async loadPipelineJobs() {
18628
+ const jobs = await this.pipelineJobsFileSystemRepository.loadAll();
18629
+ return jobs.map(this.mapPipelineJobsToDomain);
18632
18630
  }
18633
- /**
18634
- * Get pipeline metrics
18635
- */
18636
- async getPipelineMetrics(filters) {
18637
- await this.refreshPipelines(filters);
18638
- return this.pipelineService.getMetrics(filters);
18631
+ mapPipelinesToDomain(run) {
18632
+ return {
18633
+ ...run,
18634
+ createdAt: run.created_at,
18635
+ updatedAt: run.updated_at,
18636
+ number: Number(run.run_number),
18637
+ startedAt: run.run_started_at,
18638
+ completedAt: run.updated_at,
18639
+ branch: run.head_branch,
18640
+ path: run.path
18641
+ };
18639
18642
  }
18640
- /**
18641
- * Get deployment frequency
18642
- */
18643
- async getDeploymentFrequency(interval, filters) {
18644
- await this.refreshPipelines(filters);
18645
- return this.pipelineService.getDeploymentFrequency(interval, filters);
18643
+ mapPipelineJobsToDomain(job) {
18644
+ return {
18645
+ completedAt: job.completed_at,
18646
+ conclusion: job.conclusion,
18647
+ durationSeconds: this.calculateDurationInSeconds(job.started_at, job.completed_at),
18648
+ id: job.id,
18649
+ name: job.name,
18650
+ runId: job.run_id,
18651
+ startedAt: job.started_at,
18652
+ status: job.status
18653
+ };
18646
18654
  }
18647
- /**
18648
- * Get job metrics
18649
- */
18650
- async getJobMetrics(filters) {
18651
- await this.refreshPipelines(filters);
18652
- return this.pipelineService.getJobMetrics(filters);
18655
+ calculateDurationInSeconds(startedAt, completedAt) {
18656
+ if (!startedAt || !completedAt)
18657
+ return 0;
18658
+ return (new Date(completedAt).getTime() - new Date(startedAt).getTime()) / 1e3;
18653
18659
  }
18654
18660
  };
18655
18661
  exports2.PipelinesRepository = PipelinesRepository;
@@ -18721,6 +18727,12 @@ var require_code_metrics_repository = __commonJS({
18721
18727
  ignorePatterns: options?.ignorePatterns
18722
18728
  });
18723
18729
  }
18730
+ async getEntityEffort(options) {
18731
+ throw new Error("getEntityEffort: Method not implemented.");
18732
+ }
18733
+ async getEntityOwnership(options) {
18734
+ throw new Error("getEntityOwnership: Method not implemented.");
18735
+ }
18724
18736
  };
18725
18737
  exports2.CodeMetricsRepository = CodeMetricsRepository;
18726
18738
  }
@@ -18782,20 +18794,20 @@ var require_issues_repository = __commonJS({
18782
18794
  }
18783
18795
  });
18784
18796
 
18785
- // packages/core/dist/aggregates/quality-metrics-repository.js
18786
- var require_quality_metrics_repository = __commonJS({
18787
- "packages/core/dist/aggregates/quality-metrics-repository.js"(exports2) {
18797
+ // packages/core/dist/aggregates/sonarqube-metrics-repository.js
18798
+ var require_sonarqube_metrics_repository = __commonJS({
18799
+ "packages/core/dist/aggregates/sonarqube-metrics-repository.js"(exports2) {
18788
18800
  "use strict";
18789
18801
  Object.defineProperty(exports2, "__esModule", { value: true });
18790
- exports2.QualityMetricsRepository = void 0;
18802
+ exports2.SonarqubeMetricsRepository = void 0;
18791
18803
  var utils_1 = require_dist();
18792
- var repository_1 = require_repository();
18793
- var QualityMetricsRepository = class {
18804
+ var infrastructure_1 = require_infrastructure();
18805
+ var SonarqubeMetricsRepository = class {
18794
18806
  constructor(sonarqubeClient, cacheDir = "./outputs/sonarqube") {
18795
18807
  this.sonarqubeClient = sonarqubeClient;
18796
18808
  this.lastFetchTime = 0;
18797
18809
  this.cacheDuration = 1e3 * 60 * 60;
18798
- this.cache = new repository_1.FileSystemRepository(`${cacheDir}/measures.json`);
18810
+ this.cache = new infrastructure_1.FileSystemRepository(`${cacheDir}/measures.json`);
18799
18811
  }
18800
18812
  /**
18801
18813
  * Get quality metrics
@@ -18834,7 +18846,7 @@ var require_quality_metrics_repository = __commonJS({
18834
18846
  return this.getQualityMetrics({ metrics });
18835
18847
  }
18836
18848
  };
18837
- exports2.QualityMetricsRepository = QualityMetricsRepository;
18849
+ exports2.SonarqubeMetricsRepository = SonarqubeMetricsRepository;
18838
18850
  }
18839
18851
  });
18840
18852
 
@@ -18865,7 +18877,7 @@ var require_metrics_orchestrator = __commonJS({
18865
18877
  */
18866
18878
  async getDeploymentMetrics(filters) {
18867
18879
  utils_1.logger.info("Orchestrating deployment metrics...");
18868
- const metrics = await this.pipelinesRepo.getPipelineMetrics(filters);
18880
+ const metrics = await this.pipelinesRepo.getMetrics(filters);
18869
18881
  const frequency = await this.pipelinesRepo.getDeploymentFrequency("month", filters);
18870
18882
  const jobMetrics = await this.pipelinesRepo.getJobMetrics(filters);
18871
18883
  return {
@@ -18906,28 +18918,6 @@ var require_metrics_orchestrator = __commonJS({
18906
18918
  utils_1.logger.info("Orchestrating quality metrics...");
18907
18919
  return this.qualityRepo.getQualityMetrics(filters);
18908
18920
  }
18909
- /**
18910
- * Get full report across all sources
18911
- */
18912
- async getFullReport(filters) {
18913
- utils_1.logger.info("Generating full report...");
18914
- const [pr, deployment, code, issues, quality] = await Promise.all([
18915
- this.getPRMetrics(filters),
18916
- this.getDeploymentMetrics(filters),
18917
- this.getCodeMetrics(filters),
18918
- this.getIssueMetrics(filters),
18919
- this.getQualityMetrics(filters)
18920
- ]);
18921
- return {
18922
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
18923
- filters,
18924
- pullRequests: pr,
18925
- deployment,
18926
- code,
18927
- issues,
18928
- quality
18929
- };
18930
- }
18931
18921
  };
18932
18922
  exports2.MetricsOrchestrator = MetricsOrchestrator;
18933
18923
  }
@@ -18938,7 +18928,7 @@ var require_aggregates = __commonJS({
18938
18928
  "packages/core/dist/aggregates/index.js"(exports2) {
18939
18929
  "use strict";
18940
18930
  Object.defineProperty(exports2, "__esModule", { value: true });
18941
- exports2.MetricsOrchestrator = exports2.QualityMetricsRepository = exports2.IssuesRepository = exports2.CodeMetricsRepository = exports2.PipelinesRepository = exports2.PullRequestsRepository = void 0;
18931
+ exports2.MetricsOrchestrator = exports2.SonarqubeMetricsRepository = exports2.IssuesRepository = exports2.CodeMetricsRepository = exports2.PipelinesRepository = exports2.PullRequestsRepository = void 0;
18942
18932
  var pull_requests_repository_1 = require_pull_requests_repository();
18943
18933
  Object.defineProperty(exports2, "PullRequestsRepository", { enumerable: true, get: function() {
18944
18934
  return pull_requests_repository_1.PullRequestsRepository;
@@ -18955,9 +18945,9 @@ var require_aggregates = __commonJS({
18955
18945
  Object.defineProperty(exports2, "IssuesRepository", { enumerable: true, get: function() {
18956
18946
  return issues_repository_1.IssuesRepository;
18957
18947
  } });
18958
- var quality_metrics_repository_1 = require_quality_metrics_repository();
18959
- Object.defineProperty(exports2, "QualityMetricsRepository", { enumerable: true, get: function() {
18960
- return quality_metrics_repository_1.QualityMetricsRepository;
18948
+ var sonarqube_metrics_repository_1 = require_sonarqube_metrics_repository();
18949
+ Object.defineProperty(exports2, "SonarqubeMetricsRepository", { enumerable: true, get: function() {
18950
+ return sonarqube_metrics_repository_1.SonarqubeMetricsRepository;
18961
18951
  } });
18962
18952
  var metrics_orchestrator_1 = require_metrics_orchestrator();
18963
18953
  Object.defineProperty(exports2, "MetricsOrchestrator", { enumerable: true, get: function() {
@@ -18966,6 +18956,169 @@ var require_aggregates = __commonJS({
18966
18956
  }
18967
18957
  });
18968
18958
 
18959
+ // packages/core/dist/test/pipeline-git-hub-job.builder.js
18960
+ var require_pipeline_git_hub_job_builder = __commonJS({
18961
+ "packages/core/dist/test/pipeline-git-hub-job.builder.js"(exports2) {
18962
+ "use strict";
18963
+ Object.defineProperty(exports2, "__esModule", { value: true });
18964
+ exports2.PipelineGitHubJobBuilder = void 0;
18965
+ var PipelineGitHubJobBuilder = class {
18966
+ constructor() {
18967
+ this.data = {
18968
+ created_at: "",
18969
+ head_branch: "",
18970
+ head_sha: "",
18971
+ html_url: "",
18972
+ node_id: "",
18973
+ run_attempt: "",
18974
+ run_url: "",
18975
+ url: "",
18976
+ workflow_name: "",
18977
+ id: "job-1",
18978
+ run_id: "run-1",
18979
+ name: "build",
18980
+ started_at: (/* @__PURE__ */ new Date()).toISOString(),
18981
+ completed_at: (/* @__PURE__ */ new Date()).toISOString(),
18982
+ conclusion: "success",
18983
+ status: "completed"
18984
+ };
18985
+ }
18986
+ id(value) {
18987
+ this.data.id = value;
18988
+ return this;
18989
+ }
18990
+ runId(value) {
18991
+ this.data.run_id = value;
18992
+ return this;
18993
+ }
18994
+ name(value) {
18995
+ this.data.name = value;
18996
+ return this;
18997
+ }
18998
+ startedAt(value) {
18999
+ this.data.started_at = value;
19000
+ return this;
19001
+ }
19002
+ completedAt(value) {
19003
+ this.data.completed_at = value;
19004
+ return this;
19005
+ }
19006
+ conclusion(value) {
19007
+ this.data.conclusion = value;
19008
+ return this;
19009
+ }
19010
+ status(value) {
19011
+ this.data.status = value;
19012
+ return this;
19013
+ }
19014
+ build() {
19015
+ return { ...this.data };
19016
+ }
19017
+ };
19018
+ exports2.PipelineGitHubJobBuilder = PipelineGitHubJobBuilder;
19019
+ }
19020
+ });
19021
+
19022
+ // packages/core/dist/test/pipeline-git-hub-run.builder.js
19023
+ var require_pipeline_git_hub_run_builder = __commonJS({
19024
+ "packages/core/dist/test/pipeline-git-hub-run.builder.js"(exports2) {
19025
+ "use strict";
19026
+ Object.defineProperty(exports2, "__esModule", { value: true });
19027
+ exports2.PipelineGitHubRunBuilder = void 0;
19028
+ var PipelineGitHubRunBuilder = class {
19029
+ constructor() {
19030
+ this.data = {
19031
+ id: "run-1",
19032
+ run_number: "1",
19033
+ name: "CI",
19034
+ status: "completed",
19035
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
19036
+ updated_at: (/* @__PURE__ */ new Date()).toISOString(),
19037
+ run_started_at: (/* @__PURE__ */ new Date()).toISOString(),
19038
+ head_branch: "main",
19039
+ head_sha: "1mna9sd",
19040
+ path: ".github/workflows/ci.yml",
19041
+ check_suite_id: "",
19042
+ check_suite_node_id: "",
19043
+ conclusion: "",
19044
+ display_title: "",
19045
+ event: "",
19046
+ html_url: "",
19047
+ node_id: "",
19048
+ run_attempt: "",
19049
+ url: "",
19050
+ workflow_id: ""
19051
+ };
19052
+ }
19053
+ id(value) {
19054
+ this.data.id = value;
19055
+ return this;
19056
+ }
19057
+ number(value) {
19058
+ this.data.run_number = value;
19059
+ return this;
19060
+ }
19061
+ name(value) {
19062
+ this.data.name = value;
19063
+ return this;
19064
+ }
19065
+ status(value) {
19066
+ this.data.status = value;
19067
+ return this;
19068
+ }
19069
+ conclusion(value) {
19070
+ this.data.conclusion = value;
19071
+ return this;
19072
+ }
19073
+ createdAt(value) {
19074
+ this.data.created_at = value;
19075
+ return this;
19076
+ }
19077
+ updatedAt(value) {
19078
+ this.data.updated_at = value;
19079
+ return this;
19080
+ }
19081
+ startedAt(value) {
19082
+ this.data.run_started_at = value;
19083
+ return this;
19084
+ }
19085
+ branch(value) {
19086
+ this.data.head_branch = value;
19087
+ return this;
19088
+ }
19089
+ commit(value) {
19090
+ this.data.head_sha = value;
19091
+ return this;
19092
+ }
19093
+ path(value) {
19094
+ this.data.path = value;
19095
+ return this;
19096
+ }
19097
+ build() {
19098
+ return { ...this.data };
19099
+ }
19100
+ };
19101
+ exports2.PipelineGitHubRunBuilder = PipelineGitHubRunBuilder;
19102
+ }
19103
+ });
19104
+
19105
+ // packages/core/dist/test/index.js
19106
+ var require_test = __commonJS({
19107
+ "packages/core/dist/test/index.js"(exports2) {
19108
+ "use strict";
19109
+ Object.defineProperty(exports2, "__esModule", { value: true });
19110
+ exports2.PipelineGitHubRunBuilder = exports2.PipelineGitHubJobBuilder = void 0;
19111
+ var pipeline_git_hub_job_builder_1 = require_pipeline_git_hub_job_builder();
19112
+ Object.defineProperty(exports2, "PipelineGitHubJobBuilder", { enumerable: true, get: function() {
19113
+ return pipeline_git_hub_job_builder_1.PipelineGitHubJobBuilder;
19114
+ } });
19115
+ var pipeline_git_hub_run_builder_1 = require_pipeline_git_hub_run_builder();
19116
+ Object.defineProperty(exports2, "PipelineGitHubRunBuilder", { enumerable: true, get: function() {
19117
+ return pipeline_git_hub_run_builder_1.PipelineGitHubRunBuilder;
19118
+ } });
19119
+ }
19120
+ });
19121
+
18969
19122
  // packages/core/dist/index.js
18970
19123
  var require_dist3 = __commonJS({
18971
19124
  "packages/core/dist/index.js"(exports2) {
@@ -18991,6 +19144,7 @@ var require_dist3 = __commonJS({
18991
19144
  __exportStar(require_domain(), exports2);
18992
19145
  __exportStar(require_providers(), exports2);
18993
19146
  __exportStar(require_aggregates(), exports2);
19147
+ __exportStar(require_test(), exports2);
18994
19148
  }
18995
19149
  });
18996
19150
 
@@ -19008,7 +19162,7 @@ var require_request_dto = __commonJS({
19008
19162
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19009
19163
  };
19010
19164
  Object.defineProperty(exports2, "__esModule", { value: true });
19011
- exports2.FullReportQueryDto = exports2.QualityMetricsQueryDto = exports2.IssueMetricsQueryDto = exports2.CodeMetricsQueryDto = exports2.DeploymentMetricsQueryDto = exports2.PRMetricsQueryDto = exports2.BaseQueryDto = void 0;
19165
+ exports2.FullReportQueryDto = exports2.ComponentTreeQueryDto = exports2.QualityMetricsQueryDto = exports2.IssueMetricsQueryDto = exports2.CodeMetricsQueryDto = exports2.DeploymentMetricsQueryDto = exports2.PRMetricsQueryDto = exports2.BaseQueryDto = void 0;
19012
19166
  var class_validator_1 = require("class-validator");
19013
19167
  var swagger_1 = require("@nestjs/swagger");
19014
19168
  var BaseQueryDto = class {
@@ -19083,13 +19237,45 @@ var require_request_dto = __commonJS({
19083
19237
  (0, class_validator_1.IsString)({ each: true }),
19084
19238
  __metadata("design:type", Array)
19085
19239
  ], QualityMetricsQueryDto.prototype, "measures", void 0);
19086
- var FullReportQueryDto = class extends BaseQueryDto {
19240
+ var ComponentTreeQueryDto = class {
19087
19241
  };
19088
- exports2.FullReportQueryDto = FullReportQueryDto;
19242
+ exports2.ComponentTreeQueryDto = ComponentTreeQueryDto;
19089
19243
  __decorate([
19090
19244
  (0, swagger_1.ApiPropertyOptional)({
19091
- type: [String],
19092
- description: "Filter by selected authors",
19245
+ type: String,
19246
+ description: "Component key to fetch tree for"
19247
+ }),
19248
+ (0, class_validator_1.IsOptional)(),
19249
+ (0, class_validator_1.IsString)(),
19250
+ __metadata("design:type", String)
19251
+ ], ComponentTreeQueryDto.prototype, "component", void 0);
19252
+ __decorate([
19253
+ (0, swagger_1.ApiPropertyOptional)({
19254
+ type: Number,
19255
+ description: "Depth of tree traversal (-1 for all depths)",
19256
+ default: -1
19257
+ }),
19258
+ (0, class_validator_1.IsOptional)(),
19259
+ __metadata("design:type", Number)
19260
+ ], ComponentTreeQueryDto.prototype, "depth", void 0);
19261
+ __decorate([
19262
+ (0, swagger_1.ApiPropertyOptional)({
19263
+ type: [String],
19264
+ description: "SonarQube metrics to include in component tree",
19265
+ isArray: true
19266
+ }),
19267
+ (0, class_validator_1.IsOptional)(),
19268
+ (0, class_validator_1.IsArray)(),
19269
+ (0, class_validator_1.IsString)({ each: true }),
19270
+ __metadata("design:type", Array)
19271
+ ], ComponentTreeQueryDto.prototype, "metrics", void 0);
19272
+ var FullReportQueryDto = class extends BaseQueryDto {
19273
+ };
19274
+ exports2.FullReportQueryDto = FullReportQueryDto;
19275
+ __decorate([
19276
+ (0, swagger_1.ApiPropertyOptional)({
19277
+ type: [String],
19278
+ description: "Filter by selected authors",
19093
19279
  isArray: true
19094
19280
  }),
19095
19281
  (0, class_validator_1.IsOptional)(),
@@ -19174,77 +19360,6 @@ var require_metrics_controller = __commonJS({
19174
19360
  this.orchestrator = orchestrator;
19175
19361
  this.logger = new common_12.Logger("MetricsController");
19176
19362
  }
19177
- /**
19178
- * GET /api/metrics/pr
19179
- * Retrieve pull request metrics including lead time, comments, and labels
19180
- *
19181
- * Query Parameters:
19182
- * - startDate: Filter PRs created after this date
19183
- * - endDate: Filter PRs created before this date
19184
- *
19185
- * Example: GET /api/metrics/pr?startDate=2024-01-01&endDate=2024-12-31
19186
- */
19187
- async getPullRequestMetrics(query) {
19188
- try {
19189
- this.logger.debug(`Fetching PR metrics: ${JSON.stringify(query)}`);
19190
- return await this.orchestrator.getPRMetrics({
19191
- startDate: query.startDate,
19192
- endDate: query.endDate
19193
- });
19194
- } catch (error) {
19195
- this.logger.error(`Failed to fetch PR metrics: ${error}`, error instanceof Error ? error.stack : "");
19196
- throw new common_12.HttpException(`Failed to fetch PR metrics: ${error instanceof Error ? error.message : String(error)}`, common_12.HttpStatus.INTERNAL_SERVER_ERROR);
19197
- }
19198
- }
19199
- /**
19200
- * GET /api/metrics/deployment
19201
- * Retrieve deployment metrics including frequency and job performance
19202
- *
19203
- * Query Parameters:
19204
- * - startDate: Filter deployments after this date
19205
- * - endDate: Filter deployments before this date
19206
- * - frequency: Aggregation frequency (day|week|month), default: week
19207
- *
19208
- * Example: GET /api/metrics/deployment?frequency=day&startDate=2024-01-01
19209
- */
19210
- async getDeploymentMetrics(query) {
19211
- try {
19212
- this.logger.debug(`Fetching deployment metrics: ${JSON.stringify(query)}`);
19213
- return await this.orchestrator.getDeploymentMetrics({
19214
- startDate: query.startDate,
19215
- endDate: query.endDate,
19216
- frequency: query.frequency || "week"
19217
- });
19218
- } catch (error) {
19219
- this.logger.error(`Failed to fetch deployment metrics: ${error}`, error instanceof Error ? error.stack : "");
19220
- throw new common_12.HttpException(`Failed to fetch deployment metrics: ${error instanceof Error ? error.message : String(error)}`, common_12.HttpStatus.INTERNAL_SERVER_ERROR);
19221
- }
19222
- }
19223
- /**
19224
- * GET /api/metrics/code
19225
- * Retrieve code metrics including pairing index and churn
19226
- *
19227
- * Query Parameters:
19228
- * - selectedAuthors: Filter by specific authors (can be repeated)
19229
- * - startDate: Filter commits after this date
19230
- * - endDate: Filter commits before this date
19231
- *
19232
- * Example: GET /api/metrics/code?selectedAuthors=Alice&selectedAuthors=Bob&startDate=2024-01-01
19233
- */
19234
- async getCodeMetrics(query) {
19235
- try {
19236
- this.logger.debug(`Fetching code metrics: ${JSON.stringify(query)}`);
19237
- const selectedAuthors = query.selectedAuthors ? Array.isArray(query.selectedAuthors) ? query.selectedAuthors : [query.selectedAuthors] : void 0;
19238
- return await this.orchestrator.getCodeMetrics({
19239
- selectedAuthors,
19240
- startDate: query.startDate,
19241
- endDate: query.endDate
19242
- });
19243
- } catch (error) {
19244
- this.logger.error(`Failed to fetch code metrics: ${error}`, error instanceof Error ? error.stack : "");
19245
- throw new common_12.HttpException(`Failed to fetch code metrics: ${error instanceof Error ? error.message : String(error)}`, common_12.HttpStatus.INTERNAL_SERVER_ERROR);
19246
- }
19247
- }
19248
19363
  /**
19249
19364
  * GET /api/metrics/issues
19250
19365
  * Retrieve issue metrics from Jira
@@ -19289,103 +19404,8 @@ var require_metrics_controller = __commonJS({
19289
19404
  throw new common_12.HttpException(`Failed to fetch quality metrics: ${error instanceof Error ? error.message : String(error)}`, common_12.HttpStatus.INTERNAL_SERVER_ERROR);
19290
19405
  }
19291
19406
  }
19292
- /**
19293
- * GET /api/metrics/report
19294
- * Generate a complete metrics report with all data sources
19295
- *
19296
- * Query Parameters:
19297
- * - startDate: Filter data after this date
19298
- * - endDate: Filter data before this date
19299
- * - selectedAuthors: Filter by specific authors (can be repeated)
19300
- * - status: Filter issues by status
19301
- *
19302
- * Example: GET /api/metrics/report?startDate=2024-01-01&endDate=2024-12-31
19303
- *
19304
- * Returns:
19305
- * - pullRequests: PR metrics
19306
- * - deployment: Deployment metrics
19307
- * - code: Code metrics
19308
- * - issues: Issue metrics
19309
- * - quality: Quality metrics
19310
- * - timestamp: Report generation time
19311
- * - filters: Applied filters
19312
- */
19313
- async getFullReport(query) {
19314
- try {
19315
- this.logger.debug(`Fetching full report: ${JSON.stringify(query)}`);
19316
- const selectedAuthors = query.selectedAuthors ? Array.isArray(query.selectedAuthors) ? query.selectedAuthors : [query.selectedAuthors] : void 0;
19317
- return await this.orchestrator.getFullReport({
19318
- startDate: query.startDate,
19319
- endDate: query.endDate,
19320
- selectedAuthors,
19321
- status: query.status
19322
- });
19323
- } catch (error) {
19324
- this.logger.error(`Failed to fetch full report: ${error}`, error instanceof Error ? error.stack : "");
19325
- throw new common_12.HttpException(`Failed to fetch full report: ${error instanceof Error ? error.message : String(error)}`, common_12.HttpStatus.INTERNAL_SERVER_ERROR);
19326
- }
19327
- }
19328
19407
  };
19329
19408
  exports2.MetricsController = MetricsController;
19330
- __decorate([
19331
- (0, common_12.Get)("pr"),
19332
- (0, swagger_1.ApiOperation)({ summary: "Get pull request metrics" }),
19333
- (0, swagger_1.ApiQuery)({ name: "startDate", required: false, type: String, example: "2024-01-01" }),
19334
- (0, swagger_1.ApiQuery)({ name: "endDate", required: false, type: String, example: "2024-12-31" }),
19335
- (0, swagger_1.ApiOkResponse)({
19336
- description: "Pull request metrics retrieved successfully",
19337
- type: Object
19338
- }),
19339
- (0, swagger_1.ApiResponse)({
19340
- status: 400,
19341
- description: "Invalid query parameters",
19342
- type: response_dto_1.ErrorResponse
19343
- }),
19344
- __param(0, (0, common_12.Query)()),
19345
- __metadata("design:type", Function),
19346
- __metadata("design:paramtypes", [index_1.PRMetricsQueryDto]),
19347
- __metadata("design:returntype", Promise)
19348
- ], MetricsController.prototype, "getPullRequestMetrics", null);
19349
- __decorate([
19350
- (0, common_12.Get)("deployment"),
19351
- (0, swagger_1.ApiOperation)({ summary: "Get deployment metrics" }),
19352
- (0, swagger_1.ApiQuery)({ name: "startDate", required: false, type: String, example: "2024-01-01" }),
19353
- (0, swagger_1.ApiQuery)({ name: "endDate", required: false, type: String, example: "2024-12-31" }),
19354
- (0, swagger_1.ApiQuery)({ name: "frequency", required: false, enum: ["day", "week", "month"], example: "week" }),
19355
- (0, swagger_1.ApiOkResponse)({
19356
- description: "Deployment metrics retrieved successfully",
19357
- type: Object
19358
- }),
19359
- (0, swagger_1.ApiResponse)({
19360
- status: 400,
19361
- description: "Invalid query parameters",
19362
- type: response_dto_1.ErrorResponse
19363
- }),
19364
- __param(0, (0, common_12.Query)()),
19365
- __metadata("design:type", Function),
19366
- __metadata("design:paramtypes", [index_1.DeploymentMetricsQueryDto]),
19367
- __metadata("design:returntype", Promise)
19368
- ], MetricsController.prototype, "getDeploymentMetrics", null);
19369
- __decorate([
19370
- (0, common_12.Get)("code"),
19371
- (0, swagger_1.ApiOperation)({ summary: "Get code metrics" }),
19372
- (0, swagger_1.ApiQuery)({ name: "selectedAuthors", required: false, type: [String], example: "Alice" }),
19373
- (0, swagger_1.ApiQuery)({ name: "startDate", required: false, type: String, example: "2024-01-01" }),
19374
- (0, swagger_1.ApiQuery)({ name: "endDate", required: false, type: String, example: "2024-12-31" }),
19375
- (0, swagger_1.ApiOkResponse)({
19376
- description: "Code metrics retrieved successfully",
19377
- type: Object
19378
- }),
19379
- (0, swagger_1.ApiResponse)({
19380
- status: 400,
19381
- description: "Invalid query parameters",
19382
- type: response_dto_1.ErrorResponse
19383
- }),
19384
- __param(0, (0, common_12.Query)()),
19385
- __metadata("design:type", Function),
19386
- __metadata("design:paramtypes", [index_1.CodeMetricsQueryDto]),
19387
- __metadata("design:returntype", Promise)
19388
- ], MetricsController.prototype, "getCodeMetrics", null);
19389
19409
  __decorate([
19390
19410
  (0, common_12.Get)("issues"),
19391
19411
  (0, swagger_1.ApiOperation)({ summary: "Get issue metrics" }),
@@ -19424,27 +19444,6 @@ var require_metrics_controller = __commonJS({
19424
19444
  __metadata("design:paramtypes", [index_1.QualityMetricsQueryDto]),
19425
19445
  __metadata("design:returntype", Promise)
19426
19446
  ], MetricsController.prototype, "getQualityMetrics", null);
19427
- __decorate([
19428
- (0, common_12.Get)("report"),
19429
- (0, swagger_1.ApiOperation)({ summary: "Get complete metrics report" }),
19430
- (0, swagger_1.ApiQuery)({ name: "startDate", required: false, type: String, example: "2024-01-01" }),
19431
- (0, swagger_1.ApiQuery)({ name: "endDate", required: false, type: String, example: "2024-12-31" }),
19432
- (0, swagger_1.ApiQuery)({ name: "selectedAuthors", required: false, type: [String], example: "Alice" }),
19433
- (0, swagger_1.ApiQuery)({ name: "status", required: false, type: String, example: "Done" }),
19434
- (0, swagger_1.ApiOkResponse)({
19435
- description: "Complete metrics report retrieved successfully",
19436
- type: Object
19437
- }),
19438
- (0, swagger_1.ApiResponse)({
19439
- status: 400,
19440
- description: "Invalid query parameters",
19441
- type: response_dto_1.ErrorResponse
19442
- }),
19443
- __param(0, (0, common_12.Query)()),
19444
- __metadata("design:type", Function),
19445
- __metadata("design:paramtypes", [index_1.FullReportQueryDto]),
19446
- __metadata("design:returntype", Promise)
19447
- ], MetricsController.prototype, "getFullReport", null);
19448
19447
  exports2.MetricsController = MetricsController = __decorate([
19449
19448
  (0, swagger_1.ApiTags)("Metrics"),
19450
19449
  (0, common_12.Controller)("api/metrics"),
@@ -19552,13 +19551,9 @@ var require_code_controller = __commonJS({
19552
19551
  const coupling = await this.codeRepo.getFileCoupling({
19553
19552
  ignorePatterns: ignorePatterns.length > 0 ? ignorePatterns : void 0
19554
19553
  });
19555
- const filtered = coupling.filter((row) => this.matchesIncludeOnly(row.file1, includePatterns) || this.matchesIncludeOnly(row.file2, includePatterns) || includePatterns.length === 0).sort((a, b) => b.couplingStrength - a.couplingStrength);
19554
+ const filtered = coupling.filter((row) => !this.matchesIgnore(row.entity, ignorePatterns) && !this.matchesIgnore(row.coupled, ignorePatterns) && (this.matchesIncludeOnly(row.entity, includePatterns) || this.matchesIncludeOnly(row.coupled, includePatterns) || includePatterns.length === 0)).sort((a, b) => b.degree - a.degree);
19556
19555
  const maxRows = top ? Number(top) : 20;
19557
- return filtered.slice(0, Number.isFinite(maxRows) ? maxRows : 20).map((row) => ({
19558
- entity: row.file1,
19559
- coupled: row.file2,
19560
- degree: row.couplingStrength
19561
- }));
19556
+ return filtered.slice(0, Number.isFinite(maxRows) ? maxRows : 20).map((row) => row);
19562
19557
  }
19563
19558
  async entityChurn(ignoreFiles, includeOnly, top) {
19564
19559
  const rows = await this.readCsvRecords("entity-churn.csv");
@@ -19623,15 +19618,52 @@ var require_code_controller = __commonJS({
19623
19618
  if (includePatterns.length === 0) {
19624
19619
  return true;
19625
19620
  }
19626
- const normalized = entity.toLowerCase();
19627
- return includePatterns.some((pattern) => normalized.includes(pattern.toLowerCase()));
19621
+ return includePatterns.some((pattern) => this.matchesPattern(entity, pattern));
19628
19622
  }
19629
19623
  matchesIgnore(entity, ignorePatterns) {
19630
19624
  if (ignorePatterns.length === 0) {
19631
19625
  return false;
19632
19626
  }
19633
- const normalized = entity.toLowerCase();
19634
- return ignorePatterns.some((pattern) => normalized.includes(pattern.toLowerCase()));
19627
+ return ignorePatterns.some((pattern) => this.matchesPattern(entity, pattern));
19628
+ }
19629
+ matchesPattern(entity, pattern) {
19630
+ const normalizedEntity = entity.toLowerCase().replace(/\\/g, "/");
19631
+ const normalizedPattern = pattern.toLowerCase();
19632
+ if (!this.containsGlobToken(normalizedPattern)) {
19633
+ return normalizedEntity.includes(normalizedPattern);
19634
+ }
19635
+ const regex = this.globToRegExp(normalizedPattern);
19636
+ if (!normalizedPattern.includes("/")) {
19637
+ const basename = path.posix.basename(normalizedEntity);
19638
+ return regex.test(basename);
19639
+ }
19640
+ return regex.test(normalizedEntity);
19641
+ }
19642
+ containsGlobToken(value) {
19643
+ return /[*?[\]]/.test(value);
19644
+ }
19645
+ globToRegExp(globPattern) {
19646
+ let regexPattern = "^";
19647
+ for (let index = 0; index < globPattern.length; index += 1) {
19648
+ const current = globPattern[index];
19649
+ const next = globPattern[index + 1];
19650
+ if (current === "*" && next === "*") {
19651
+ regexPattern += ".*";
19652
+ index += 1;
19653
+ continue;
19654
+ }
19655
+ if (current === "*") {
19656
+ regexPattern += "[^/]*";
19657
+ continue;
19658
+ }
19659
+ if (current === "?") {
19660
+ regexPattern += "[^/]";
19661
+ continue;
19662
+ }
19663
+ regexPattern += current.replace(/[|\\{}()[\]^$+?.]/g, "\\$&");
19664
+ }
19665
+ regexPattern += "$";
19666
+ return new RegExp(regexPattern);
19635
19667
  }
19636
19668
  async readCsvRecords(fileName) {
19637
19669
  const csvPath = path.join(this.buildDataDirectories().codemaatDirectory, fileName);
@@ -19993,7 +20025,7 @@ var require_pipelines_controller = __commonJS({
19993
20025
  return { result };
19994
20026
  }
19995
20027
  async workflows() {
19996
- const runs = await this.pipelinesRepo.refreshPipelines();
20028
+ const runs = await this.pipelinesRepo.loadPipelines();
19997
20029
  const values = Array.from(new Set(runs.map((run) => run.path || "").filter((value) => value.length > 0))).sort();
19998
20030
  return values.map((workflow) => ({ name: workflow, path: workflow }));
19999
20031
  }
@@ -20010,7 +20042,7 @@ var require_pipelines_controller = __commonJS({
20010
20042
  return Array.from(new Set(runs.map((run) => run.branch || "").filter((value) => value.length > 0))).sort();
20011
20043
  }
20012
20044
  async events() {
20013
- const runs = await this.pipelinesRepo.refreshPipelines();
20045
+ const runs = await this.pipelinesRepo.loadPipelines();
20014
20046
  return Array.from(new Set(runs.map((run) => run.event || "").filter((value) => value.length > 0))).sort();
20015
20047
  }
20016
20048
  async jobs(workflowPath) {
@@ -20069,7 +20101,7 @@ var require_pipelines_controller = __commonJS({
20069
20101
  return dateString.substring(0, 7);
20070
20102
  }
20071
20103
  async loadRunsWithFilters(filters) {
20072
- const runs = await this.pipelinesRepo.refreshPipelines();
20104
+ const runs = await this.pipelinesRepo.loadPipelines();
20073
20105
  return runs.filter((run) => {
20074
20106
  if (filters.startDate && this.toTimestamp(run.createdAt) < this.toTimestamp(filters.startDate)) {
20075
20107
  return false;
@@ -20295,7 +20327,7 @@ var require_pull_requests_controller = __commonJS({
20295
20327
  const totalComments = prs.reduce((sum, pr) => sum + (pr.comments || 0), 0);
20296
20328
  const avgComments = prs.length > 0 ? totalComments / prs.length : 0;
20297
20329
  const authorsSet = new Set(prs.map((pr) => pr.author?.login || "").filter((name) => name.length > 0));
20298
- const labelsSet = new Set(prs.flatMap((pr) => (pr.labels || []).map((label) => label.name || "").filter((name) => name.length > 0)));
20330
+ const labelSummary = this.extractLabelSummary(prs);
20299
20331
  const sorted = [...prs].sort((a, b) => this.toTimestamp(a.createdAt) - this.toTimestamp(b.createdAt));
20300
20332
  return {
20301
20333
  result: {
@@ -20305,7 +20337,8 @@ var require_pull_requests_controller = __commonJS({
20305
20337
  open_prs: open,
20306
20338
  avg_comments_per_pr: avgComments,
20307
20339
  unique_authors: authorsSet.size,
20308
- unique_labels: labelsSet.size,
20340
+ unique_labels: labelSummary.length,
20341
+ labels: labelSummary,
20309
20342
  first_pr: sorted.length > 0 ? sorted[0] : null,
20310
20343
  last_pr: sorted.length > 0 ? sorted[sorted.length - 1] : null,
20311
20344
  top_themes: this.extractTopThemes(prs)
@@ -20393,11 +20426,11 @@ var require_pull_requests_controller = __commonJS({
20393
20426
  return { avg_comments: avgComments };
20394
20427
  }
20395
20428
  async authors() {
20396
- const prs = await this.pullRequestsRepo.refreshPRs();
20429
+ const prs = await this.pullRequestsRepo.fetchPRs();
20397
20430
  return Array.from(new Set(prs.map((pr) => pr.author?.login || "").filter((name) => name.length > 0))).sort();
20398
20431
  }
20399
20432
  async labels() {
20400
- const prs = await this.pullRequestsRepo.refreshPRs();
20433
+ const prs = await this.pullRequestsRepo.fetchPRs();
20401
20434
  return Array.from(new Set(prs.flatMap((pr) => (pr.labels || []).map((label) => label.name || "").filter((name) => name.length > 0)))).sort();
20402
20435
  }
20403
20436
  // ========== PRIVATE HELPERS ==========
@@ -20447,8 +20480,18 @@ var require_pull_requests_controller = __commonJS({
20447
20480
  }
20448
20481
  return Array.from(themes.entries()).sort((a, b) => b[1] - a[1]).slice(0, 3).map((entry) => entry[0]);
20449
20482
  }
20483
+ extractLabelSummary(prs) {
20484
+ const labelToPrs = /* @__PURE__ */ new Map();
20485
+ for (const pr of prs) {
20486
+ const uniqueLabels = new Set((pr.labels || []).map((label) => (label.name || "").trim()).filter((name) => name.length > 0));
20487
+ for (const label of uniqueLabels) {
20488
+ labelToPrs.set(label, (labelToPrs.get(label) || 0) + 1);
20489
+ }
20490
+ }
20491
+ return Array.from(labelToPrs.entries()).map(([label, count]) => ({ label, prs: count })).sort((a, b) => b.prs - a.prs || a.label.localeCompare(b.label));
20492
+ }
20450
20493
  async loadPRsWithFilters(filters) {
20451
- const prs = await this.pullRequestsRepo.refreshPRs();
20494
+ const prs = await this.pullRequestsRepo.fetchPRs();
20452
20495
  const selectedAuthors = this.parseCsvList(filters.authors);
20453
20496
  const selectedLabels = this.parseCsvList(filters.labels);
20454
20497
  return prs.filter((pr) => {
@@ -20621,6 +20664,118 @@ var require_configuration_controller = __commonJS({
20621
20664
  }
20622
20665
  });
20623
20666
 
20667
+ // apps/rest/dist/controllers/sonarqube.controller.js
20668
+ var require_sonarqube_controller = __commonJS({
20669
+ "apps/rest/dist/controllers/sonarqube.controller.js"(exports2) {
20670
+ "use strict";
20671
+ var __decorate = exports2 && exports2.__decorate || function(decorators, target, key, desc) {
20672
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20673
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20674
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
20675
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
20676
+ };
20677
+ var __metadata = exports2 && exports2.__metadata || function(k, v) {
20678
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
20679
+ };
20680
+ var __param = exports2 && exports2.__param || function(paramIndex, decorator) {
20681
+ return function(target, key) {
20682
+ decorator(target, key, paramIndex);
20683
+ };
20684
+ };
20685
+ Object.defineProperty(exports2, "__esModule", { value: true });
20686
+ exports2.SonarqubeController = void 0;
20687
+ var common_12 = require("@nestjs/common");
20688
+ var swagger_1 = require("@nestjs/swagger");
20689
+ var core_12 = require_dist3();
20690
+ var index_1 = require_dtos();
20691
+ var response_dto_1 = require_response_dto();
20692
+ var SonarqubeController = class SonarqubeController {
20693
+ constructor(sonarqubeClient) {
20694
+ this.sonarqubeClient = sonarqubeClient;
20695
+ this.logger = new common_12.Logger("SonarqubeController");
20696
+ }
20697
+ /**
20698
+ * GET /api/measures/component_tree
20699
+ * Retrieve component tree metrics from SonarQube
20700
+ *
20701
+ * Query Parameters:
20702
+ * - component: Component key to fetch tree for (defaults to configured project)
20703
+ * - depth: Depth of tree traversal (-1 for all depths, default: -1)
20704
+ * - metrics: SonarQube metrics to include (e.g., complexity, cognitive_complexity)
20705
+ *
20706
+ * Example: GET /api/measures/component_tree?component=my:project&depth=-1&metrics=complexity,cognitive_complexity
20707
+ */
20708
+ async getComponentTree(query) {
20709
+ try {
20710
+ this.logger.debug(`Fetching component tree: ${JSON.stringify(query)}`);
20711
+ return await this.sonarqubeClient.fetchComponentTree({
20712
+ component: query.component,
20713
+ depth: query.depth,
20714
+ metrics: query.metrics
20715
+ });
20716
+ } catch (error) {
20717
+ this.logger.error(`Failed to fetch component tree: ${error}`, error instanceof Error ? error.stack : "");
20718
+ throw new common_12.HttpException(`Failed to fetch component tree: ${error instanceof Error ? error.message : String(error)}`, common_12.HttpStatus.INTERNAL_SERVER_ERROR);
20719
+ }
20720
+ }
20721
+ };
20722
+ exports2.SonarqubeController = SonarqubeController;
20723
+ __decorate([
20724
+ (0, common_12.Get)("component_tree"),
20725
+ (0, swagger_1.ApiOperation)({ summary: "Get component tree with metrics" }),
20726
+ (0, swagger_1.ApiQuery)({
20727
+ name: "component",
20728
+ required: false,
20729
+ type: String,
20730
+ example: "my:project",
20731
+ description: "Component key"
20732
+ }),
20733
+ (0, swagger_1.ApiQuery)({
20734
+ name: "depth",
20735
+ required: false,
20736
+ type: Number,
20737
+ example: -1,
20738
+ description: "Depth of tree (-1 for all depths)"
20739
+ }),
20740
+ (0, swagger_1.ApiQuery)({
20741
+ name: "metrics",
20742
+ required: false,
20743
+ type: [String],
20744
+ example: "complexity,cognitive_complexity",
20745
+ description: "Comma-separated metrics"
20746
+ }),
20747
+ (0, swagger_1.ApiOkResponse)({
20748
+ description: "Component tree retrieved successfully",
20749
+ type: Object
20750
+ }),
20751
+ (0, swagger_1.ApiResponse)({
20752
+ status: 400,
20753
+ description: "Invalid query parameters",
20754
+ type: response_dto_1.ErrorResponse
20755
+ }),
20756
+ (0, swagger_1.ApiResponse)({
20757
+ status: 401,
20758
+ description: "Authentication failed",
20759
+ type: response_dto_1.ErrorResponse
20760
+ }),
20761
+ (0, swagger_1.ApiResponse)({
20762
+ status: 404,
20763
+ description: "Component not found",
20764
+ type: response_dto_1.ErrorResponse
20765
+ }),
20766
+ __param(0, (0, common_12.Query)()),
20767
+ __metadata("design:type", Function),
20768
+ __metadata("design:paramtypes", [index_1.ComponentTreeQueryDto]),
20769
+ __metadata("design:returntype", Promise)
20770
+ ], SonarqubeController.prototype, "getComponentTree", null);
20771
+ exports2.SonarqubeController = SonarqubeController = __decorate([
20772
+ (0, swagger_1.ApiTags)("SonarQube"),
20773
+ (0, common_12.Controller)("api/measures"),
20774
+ __metadata("design:paramtypes", [core_12.SonarqubeMeasuresClient])
20775
+ ], SonarqubeController);
20776
+ }
20777
+ });
20778
+
20624
20779
  // apps/rest/dist/middleware/logging.middleware.js
20625
20780
  var require_logging_middleware = __commonJS({
20626
20781
  "apps/rest/dist/middleware/logging.middleware.js"(exports2) {
@@ -20662,6 +20817,442 @@ var require_logging_middleware = __commonJS({
20662
20817
  }
20663
20818
  });
20664
20819
 
20820
+ // packages/core/dist/providers/github/pipelines-fetch-repository.js
20821
+ var require_pipelines_fetch_repository = __commonJS({
20822
+ "packages/core/dist/providers/github/pipelines-fetch-repository.js"(exports2) {
20823
+ "use strict";
20824
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
20825
+ if (k2 === void 0) k2 = k;
20826
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20827
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20828
+ desc = { enumerable: true, get: function() {
20829
+ return m[k];
20830
+ } };
20831
+ }
20832
+ Object.defineProperty(o, k2, desc);
20833
+ }) : (function(o, m, k, k2) {
20834
+ if (k2 === void 0) k2 = k;
20835
+ o[k2] = m[k];
20836
+ }));
20837
+ var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
20838
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
20839
+ }) : function(o, v) {
20840
+ o["default"] = v;
20841
+ });
20842
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
20843
+ var ownKeys = function(o) {
20844
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
20845
+ var ar = [];
20846
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
20847
+ return ar;
20848
+ };
20849
+ return ownKeys(o);
20850
+ };
20851
+ return function(mod) {
20852
+ if (mod && mod.__esModule) return mod;
20853
+ var result = {};
20854
+ if (mod != null) {
20855
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
20856
+ }
20857
+ __setModuleDefault(result, mod);
20858
+ return result;
20859
+ };
20860
+ })();
20861
+ Object.defineProperty(exports2, "__esModule", { value: true });
20862
+ exports2.PipelinesFetchRepository = void 0;
20863
+ var utils_1 = require_dist();
20864
+ var fs = __importStar(require("fs/promises"));
20865
+ var path = __importStar(require("path"));
20866
+ var PipelinesFetchRepository = class {
20867
+ constructor(configuration, githubWorkflowClient, pipelineRunFileSystemRepository) {
20868
+ this.configuration = configuration;
20869
+ this.githubWorkflowClient = githubWorkflowClient;
20870
+ this.pipelineRunFileSystemRepository = pipelineRunFileSystemRepository;
20871
+ }
20872
+ async fetchPipelines(options) {
20873
+ const fromCache = await this.pipelineRunFileSystemRepository.loadAll();
20874
+ if (fromCache.length > 0 && !options?.forceRefresh) {
20875
+ utils_1.logger.info(`Using cached pipelines: ${fromCache.length} records`);
20876
+ return fromCache;
20877
+ }
20878
+ console.log(`Fetching workflows from GitHub ${options?.startDate} - ${options?.endDate}...`);
20879
+ let workflows;
20880
+ if (options?.byDay && options?.startDate && options?.endDate) {
20881
+ workflows = await this.fetchWorkflowsByDay(options.startDate, options.endDate, options.rawFilters);
20882
+ } else {
20883
+ workflows = await this.fetchWorkflowsWithResume({
20884
+ created: this.buildCreatedFilter(options?.startDate, options?.endDate),
20885
+ rawFilters: options?.rawFilters
20886
+ });
20887
+ }
20888
+ await this.pipelineRunFileSystemRepository.saveAll(workflows);
20889
+ return workflows;
20890
+ }
20891
+ async fetchWorkflowsByDay(startDate, endDate, rawFilters) {
20892
+ const allRuns = [];
20893
+ const current = new Date(startDate);
20894
+ const end = new Date(endDate);
20895
+ while (current <= end) {
20896
+ const dayStart = new Date(current);
20897
+ dayStart.setUTCHours(0, 0, 0, 0);
20898
+ const dayEnd = new Date(current);
20899
+ dayEnd.setUTCHours(23, 59, 59, 999);
20900
+ const dayStartStr = dayStart.toISOString().split("T")[0] + "T00:00:00Z";
20901
+ const dayEndStr = dayEnd.toISOString().split("T")[0] + "T23:59:59Z";
20902
+ utils_1.logger.info(`Fetching workflows for day ${dayStartStr}...`);
20903
+ const dayRuns = await this.fetchWorkflowsWithResume({
20904
+ created: `${dayStartStr}..${dayEndStr}`,
20905
+ rawFilters
20906
+ });
20907
+ allRuns.push(...dayRuns);
20908
+ current.setUTCDate(current.getUTCDate() + 1);
20909
+ }
20910
+ return allRuns;
20911
+ }
20912
+ async fetchWorkflowsWithResume(options) {
20913
+ const progressPath = this.fileInCache("workflows_progress.json");
20914
+ const incompletedPath = this.fileInCache("workflows_incompleted.json");
20915
+ const progress = await this.readJson(progressPath, null);
20916
+ const runs = await this.readJson(incompletedPath, []);
20917
+ let page = progress?.page || 1;
20918
+ const perPage = 100;
20919
+ let stopPagination = false;
20920
+ while (!stopPagination) {
20921
+ try {
20922
+ utils_1.logger.info(`Fetching workflows total of ${perPage} in page ${page} from GitHub...`);
20923
+ const response = await this.githubWorkflowClient.fetchWorkflowRunsPage(page, perPage, {
20924
+ created: options?.created,
20925
+ rawFilters: options?.rawFilters
20926
+ });
20927
+ const fetchedRuns = response.runs || [];
20928
+ if (fetchedRuns.length === 0) {
20929
+ break;
20930
+ }
20931
+ for (const run of fetchedRuns) {
20932
+ runs.push(run);
20933
+ }
20934
+ await this.writeJson(incompletedPath, runs);
20935
+ if (stopPagination || !response.hasNext) {
20936
+ break;
20937
+ }
20938
+ page += 1;
20939
+ await this.writeJson(progressPath, { page });
20940
+ } catch (error) {
20941
+ if (this.isUnprocessableEntityError(error)) {
20942
+ utils_1.logger.info(`GitHub returned 422 while fetching workflows page ${page}; treating as pagination end.`);
20943
+ await this.writeJson(incompletedPath, runs);
20944
+ await this.writeJson(progressPath, { page });
20945
+ break;
20946
+ }
20947
+ await this.writeJson(incompletedPath, runs);
20948
+ await this.writeJson(progressPath, { page });
20949
+ throw error;
20950
+ }
20951
+ }
20952
+ await this.deleteFile(progressPath);
20953
+ await this.deleteFile(incompletedPath);
20954
+ return runs;
20955
+ }
20956
+ buildCreatedFilter(startDate, endDate) {
20957
+ if (!startDate && !endDate) {
20958
+ return void 0;
20959
+ }
20960
+ return `${startDate || ""}..${endDate || ""}`;
20961
+ }
20962
+ fileInCache(fileName) {
20963
+ return path.join(this.configuration.getPipelinePath(), fileName);
20964
+ }
20965
+ async readJson(filePath, fallback) {
20966
+ try {
20967
+ const contents = await fs.readFile(filePath, "utf-8");
20968
+ return JSON.parse(contents);
20969
+ } catch (error) {
20970
+ if (error.code === "ENOENT") {
20971
+ return fallback;
20972
+ }
20973
+ throw error;
20974
+ }
20975
+ }
20976
+ async writeJson(filePath, value) {
20977
+ await fs.mkdir(path.dirname(filePath), { recursive: true });
20978
+ await fs.writeFile(filePath, JSON.stringify(value, null, 2), "utf-8");
20979
+ }
20980
+ async deleteFile(filePath) {
20981
+ try {
20982
+ await fs.unlink(filePath);
20983
+ } catch (error) {
20984
+ if (error.code !== "ENOENT") {
20985
+ throw error;
20986
+ }
20987
+ }
20988
+ }
20989
+ isUnprocessableEntityError(error) {
20990
+ if (!error || typeof error !== "object") {
20991
+ return false;
20992
+ }
20993
+ const maybeError = error;
20994
+ return maybeError.status === 422 || maybeError.response?.status === 422;
20995
+ }
20996
+ };
20997
+ exports2.PipelinesFetchRepository = PipelinesFetchRepository;
20998
+ }
20999
+ });
21000
+
21001
+ // packages/core/dist/providers/github/pipelines-job-fetch-repository.js
21002
+ var require_pipelines_job_fetch_repository = __commonJS({
21003
+ "packages/core/dist/providers/github/pipelines-job-fetch-repository.js"(exports2) {
21004
+ "use strict";
21005
+ var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
21006
+ if (k2 === void 0) k2 = k;
21007
+ var desc = Object.getOwnPropertyDescriptor(m, k);
21008
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21009
+ desc = { enumerable: true, get: function() {
21010
+ return m[k];
21011
+ } };
21012
+ }
21013
+ Object.defineProperty(o, k2, desc);
21014
+ }) : (function(o, m, k, k2) {
21015
+ if (k2 === void 0) k2 = k;
21016
+ o[k2] = m[k];
21017
+ }));
21018
+ var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
21019
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
21020
+ }) : function(o, v) {
21021
+ o["default"] = v;
21022
+ });
21023
+ var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
21024
+ var ownKeys = function(o) {
21025
+ ownKeys = Object.getOwnPropertyNames || function(o2) {
21026
+ var ar = [];
21027
+ for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
21028
+ return ar;
21029
+ };
21030
+ return ownKeys(o);
21031
+ };
21032
+ return function(mod) {
21033
+ if (mod && mod.__esModule) return mod;
21034
+ var result = {};
21035
+ if (mod != null) {
21036
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
21037
+ }
21038
+ __setModuleDefault(result, mod);
21039
+ return result;
21040
+ };
21041
+ })();
21042
+ Object.defineProperty(exports2, "__esModule", { value: true });
21043
+ exports2.PipelinesJobFetchRepository = void 0;
21044
+ var utils_1 = require_dist();
21045
+ var fs = __importStar(require("fs/promises"));
21046
+ var path = __importStar(require("path"));
21047
+ var PipelinesJobFetchRepository = class {
21048
+ constructor(configuration, githubWorkflowClient, pipelineRunFileSystemRepository, pipelineJobsFileSystemRepository) {
21049
+ this.configuration = configuration;
21050
+ this.githubWorkflowClient = githubWorkflowClient;
21051
+ this.pipelineRunFileSystemRepository = pipelineRunFileSystemRepository;
21052
+ this.pipelineJobsFileSystemRepository = pipelineJobsFileSystemRepository;
21053
+ }
21054
+ async fetchJobs(filters) {
21055
+ const cachedJobs = await this.pipelineJobsFileSystemRepository.loadAll();
21056
+ if (cachedJobs.length > 0 && !filters?.forceRefresh) {
21057
+ utils_1.logger.info(`Using cached jobs: ${cachedJobs.length} records`);
21058
+ return cachedJobs;
21059
+ }
21060
+ const cachedRuns = await this.pipelineRunFileSystemRepository.loadAll();
21061
+ if (filters?.byDay && filters?.startDate && filters?.endDate) {
21062
+ return this.fetchJobsByDay(cachedRuns, filters.startDate, filters.endDate, filters.rawFilters);
21063
+ } else {
21064
+ const startDate = this.toDateBoundary(filters.startDate, "start");
21065
+ const endDate = this.toDateBoundary(filters.endDate, "end");
21066
+ const filteredRuns = this.filterRunsByDateRange(cachedRuns, startDate, endDate);
21067
+ utils_1.logger.info(`Fetching jobs for ${filteredRuns.length} workflow runs...`);
21068
+ return this.fetchJobsWithResume(filteredRuns, filters.rawFilters);
21069
+ }
21070
+ }
21071
+ async fetchJobsByDay(cachedRuns, startDate, endDate, rawFilters) {
21072
+ const allJobs = [];
21073
+ const current = new Date(startDate);
21074
+ const end = new Date(endDate);
21075
+ while (current <= end) {
21076
+ const dayStart = new Date(current);
21077
+ dayStart.setUTCHours(0, 0, 0, 0);
21078
+ const dayEnd = new Date(current);
21079
+ dayEnd.setUTCHours(23, 59, 59, 999);
21080
+ utils_1.logger.info(`Fetching jobs for day ${dayStart.toISOString().split("T")[0]}...`);
21081
+ const runsForDay = cachedRuns.filter((run) => {
21082
+ const createdAt = run.created_at;
21083
+ if (!createdAt || createdAt.trim().length === 0) {
21084
+ return false;
21085
+ }
21086
+ const runDate = new Date(createdAt);
21087
+ if (Number.isNaN(runDate.getTime())) {
21088
+ return false;
21089
+ }
21090
+ return runDate >= dayStart && runDate <= dayEnd;
21091
+ });
21092
+ if (runsForDay.length > 0) {
21093
+ const dayJobs = await this.fetchJobsWithResume(runsForDay, rawFilters);
21094
+ allJobs.push(...dayJobs);
21095
+ }
21096
+ current.setUTCDate(current.getUTCDate() + 1);
21097
+ }
21098
+ return allJobs;
21099
+ }
21100
+ filterRunsByDateRange(runs, startDate, endDate) {
21101
+ return runs.filter((run) => {
21102
+ const createdAt = run.created_at;
21103
+ if (!createdAt || createdAt.trim().length === 0) {
21104
+ return false;
21105
+ }
21106
+ const runDate = new Date(createdAt);
21107
+ if (Number.isNaN(runDate.getTime())) {
21108
+ return false;
21109
+ }
21110
+ if (!startDate && !endDate) {
21111
+ return true;
21112
+ }
21113
+ if (startDate && runDate < startDate) {
21114
+ return false;
21115
+ }
21116
+ if (endDate && runDate > endDate) {
21117
+ return false;
21118
+ }
21119
+ return true;
21120
+ });
21121
+ }
21122
+ async fetchJobsWithResume(workflows, rawFilters) {
21123
+ const progressPath = this.fileInCache("jobs_progress.json");
21124
+ const incompletedPath = this.fileInCache("jobs_incompleted.json");
21125
+ const progress = await this.readJson(progressPath, {
21126
+ processedRunIds: [],
21127
+ partial: null
21128
+ });
21129
+ const processedRunIds = new Set(progress.processedRunIds || []);
21130
+ const allJobs = await this.readJson(incompletedPath, []);
21131
+ const perPage = 100;
21132
+ for (const run of workflows) {
21133
+ const runId = String(run.id);
21134
+ if (!runId || processedRunIds.has(runId)) {
21135
+ continue;
21136
+ }
21137
+ let page = progress.partial?.runId === runId && progress.partial?.page ? progress.partial.page : 1;
21138
+ while (true) {
21139
+ try {
21140
+ console.log(`Fetching jobs for workflow run ${runId} in page ${page}...`);
21141
+ const response = await this.githubWorkflowClient.fetchJobsPage(runId, page, perPage, {
21142
+ rawFilters
21143
+ });
21144
+ allJobs.push(...response.jobs);
21145
+ await this.writeJson(incompletedPath, allJobs);
21146
+ if (response.hasNext) {
21147
+ page += 1;
21148
+ await this.writeJson(progressPath, {
21149
+ processedRunIds: Array.from(processedRunIds),
21150
+ partial: { runId, page }
21151
+ });
21152
+ continue;
21153
+ }
21154
+ processedRunIds.add(runId);
21155
+ await this.writeJson(progressPath, {
21156
+ processedRunIds: Array.from(processedRunIds),
21157
+ partial: null
21158
+ });
21159
+ break;
21160
+ } catch (error) {
21161
+ await this.writeJson(incompletedPath, allJobs);
21162
+ await this.writeJson(progressPath, {
21163
+ processedRunIds: Array.from(processedRunIds),
21164
+ partial: { runId, page }
21165
+ });
21166
+ throw error;
21167
+ }
21168
+ }
21169
+ }
21170
+ const existingJobs = await this.pipelineJobsFileSystemRepository.loadAll();
21171
+ const mergedJobsByKey = /* @__PURE__ */ new Map();
21172
+ for (const job of existingJobs) {
21173
+ mergedJobsByKey.set(`${String(job.run_id)}:${String(job.id)}`, job);
21174
+ }
21175
+ for (const job of allJobs) {
21176
+ mergedJobsByKey.set(`${String(job.run_id)}:${String(job.id)}`, job);
21177
+ }
21178
+ await this.pipelineJobsFileSystemRepository.saveAll(Array.from(mergedJobsByKey.values()));
21179
+ await this.deleteFile(progressPath);
21180
+ await this.deleteFile(incompletedPath);
21181
+ return allJobs;
21182
+ }
21183
+ fileInCache(fileName) {
21184
+ return path.join(this.configuration.getPipelinePath(), fileName);
21185
+ }
21186
+ async readJson(filePath, fallback) {
21187
+ try {
21188
+ const contents = await fs.readFile(filePath, "utf-8");
21189
+ return JSON.parse(contents);
21190
+ } catch (error) {
21191
+ if (error.code === "ENOENT") {
21192
+ return fallback;
21193
+ }
21194
+ throw error;
21195
+ }
21196
+ }
21197
+ async writeJson(filePath, value) {
21198
+ await fs.mkdir(path.dirname(filePath), { recursive: true });
21199
+ await fs.writeFile(filePath, JSON.stringify(value, null, 2), "utf-8");
21200
+ }
21201
+ async deleteFile(filePath) {
21202
+ try {
21203
+ await fs.unlink(filePath);
21204
+ } catch (error) {
21205
+ if (error.code !== "ENOENT") {
21206
+ throw error;
21207
+ }
21208
+ }
21209
+ }
21210
+ toDateBoundary(dateValue, boundary = "start") {
21211
+ if (!dateValue) {
21212
+ return void 0;
21213
+ }
21214
+ const isDateOnly = /^\d{4}-\d{2}-\d{2}$/.test(dateValue);
21215
+ const normalizedDateValue = isDateOnly ? boundary === "start" ? `${dateValue}T00:00:00.000Z` : `${dateValue}T23:59:59.999Z` : dateValue;
21216
+ const parsed = new Date(normalizedDateValue);
21217
+ return Number.isNaN(parsed.getTime()) ? void 0 : parsed;
21218
+ }
21219
+ };
21220
+ exports2.PipelinesJobFetchRepository = PipelinesJobFetchRepository;
21221
+ }
21222
+ });
21223
+
21224
+ // packages/core/dist/aggregates/pipeline-factory.js
21225
+ var require_pipeline_factory = __commonJS({
21226
+ "packages/core/dist/aggregates/pipeline-factory.js"(exports2) {
21227
+ "use strict";
21228
+ Object.defineProperty(exports2, "__esModule", { value: true });
21229
+ var pipelines_repository_1 = require_pipelines_repository();
21230
+ var infrastructure_1 = require_infrastructure();
21231
+ var pipelines_fetch_repository_1 = require_pipelines_fetch_repository();
21232
+ var providers_1 = require_providers();
21233
+ var pipelines_job_fetch_repository_1 = require_pipelines_job_fetch_repository();
21234
+ var PipelineFactory = class {
21235
+ static create(config) {
21236
+ const [githubOwner, githubRepo] = config.githubRepository.split("/");
21237
+ const githubToken = config.githubToken;
21238
+ const githubWorkflowClient = new providers_1.GithubWorkflowClient(githubToken, githubOwner, githubRepo);
21239
+ const githubWorkflowJobClient = new providers_1.GithubWorkflowJobClient(githubToken, githubOwner, githubRepo);
21240
+ const pipelineRunFileSystemRepository = new infrastructure_1.FileSystemRepository(`${config.getPipelinePath()}/workflows.json`);
21241
+ const pipelineJobsFileSystemRepository = new infrastructure_1.FileSystemRepository(`${config.getPipelinePath()}/jobs.json`);
21242
+ const pipelineRepository = new pipelines_repository_1.PipelinesRepository(pipelineRunFileSystemRepository, pipelineJobsFileSystemRepository);
21243
+ const workflowRepository = new pipelines_fetch_repository_1.PipelinesFetchRepository(config, githubWorkflowClient, pipelineRunFileSystemRepository);
21244
+ const workflowJobRepository = new pipelines_job_fetch_repository_1.PipelinesJobFetchRepository(config, githubWorkflowJobClient, pipelineRunFileSystemRepository, pipelineJobsFileSystemRepository);
21245
+ return {
21246
+ pipelineRepository,
21247
+ workflowRepository,
21248
+ workflowJobRepository
21249
+ };
21250
+ }
21251
+ };
21252
+ exports2.default = PipelineFactory;
21253
+ }
21254
+ });
21255
+
20665
21256
  // apps/rest/dist/metrics.module.js
20666
21257
  var require_metrics_module = __commonJS({
20667
21258
  "apps/rest/dist/metrics.module.js"(exports2) {
@@ -20709,6 +21300,9 @@ var require_metrics_module = __commonJS({
20709
21300
  return result;
20710
21301
  };
20711
21302
  })();
21303
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
21304
+ return mod && mod.__esModule ? mod : { "default": mod };
21305
+ };
20712
21306
  Object.defineProperty(exports2, "__esModule", { value: true });
20713
21307
  exports2.MetricsModule = void 0;
20714
21308
  var common_12 = require("@nestjs/common");
@@ -20718,8 +21312,10 @@ var require_metrics_module = __commonJS({
20718
21312
  var pipelines_controller_1 = require_pipelines_controller();
20719
21313
  var pull_requests_controller_1 = require_pull_requests_controller();
20720
21314
  var configuration_controller_1 = require_configuration_controller();
21315
+ var sonarqube_controller_1 = require_sonarqube_controller();
20721
21316
  var logging_middleware_1 = require_logging_middleware();
20722
21317
  var core_12 = require_dist3();
21318
+ var pipeline_factory_1 = __importDefault(require_pipeline_factory());
20723
21319
  function buildDataDirectories(config) {
20724
21320
  const baseDir = config.storeData || "./outputs";
20725
21321
  const gitProvider = config.gitProvider || "github";
@@ -20745,7 +21341,8 @@ var require_metrics_module = __commonJS({
20745
21341
  code_controller_1.CodeController,
20746
21342
  pipelines_controller_1.PipelinesController,
20747
21343
  pull_requests_controller_1.PullRequestsController,
20748
- configuration_controller_1.ConfigurationController
21344
+ configuration_controller_1.ConfigurationController,
21345
+ sonarqube_controller_1.SonarqubeController
20749
21346
  ],
20750
21347
  providers: [
20751
21348
  // Configuration
@@ -20807,11 +21404,17 @@ var require_metrics_module = __commonJS({
20807
21404
  },
20808
21405
  {
20809
21406
  provide: core_12.PipelinesRepository,
20810
- useFactory: (client, config) => {
20811
- const paths = buildDataDirectories(config);
20812
- return new core_12.PipelinesRepository(client, paths.gitProviderDirectory);
21407
+ useFactory: (config) => {
21408
+ return pipeline_factory_1.default.create(config).pipelineRepository;
21409
+ },
21410
+ inject: [core_12.Configuration]
21411
+ },
21412
+ {
21413
+ provide: core_12.PipelinesService,
21414
+ useFactory: (pipelineRepository) => {
21415
+ return new core_12.PipelinesService(pipelineRepository);
20813
21416
  },
20814
- inject: [core_12.GithubWorkflowClient, core_12.Configuration]
21417
+ inject: [core_12.PipelinesRepository]
20815
21418
  },
20816
21419
  {
20817
21420
  provide: core_12.CodeMetricsRepository,
@@ -20830,10 +21433,10 @@ var require_metrics_module = __commonJS({
20830
21433
  inject: [core_12.JiraIssuesClient, core_12.Configuration]
20831
21434
  },
20832
21435
  {
20833
- provide: core_12.QualityMetricsRepository,
21436
+ provide: core_12.SonarqubeMetricsRepository,
20834
21437
  useFactory: (client, config) => {
20835
21438
  const paths = buildDataDirectories(config);
20836
- return new core_12.QualityMetricsRepository(client, paths.sonarqubeDirectory);
21439
+ return new core_12.SonarqubeMetricsRepository(client, paths.sonarqubeDirectory);
20837
21440
  },
20838
21441
  inject: [core_12.SonarqubeMeasuresClient, core_12.Configuration]
20839
21442
  },
@@ -20846,7 +21449,7 @@ var require_metrics_module = __commonJS({
20846
21449
  core_12.PipelinesRepository,
20847
21450
  core_12.CodeMetricsRepository,
20848
21451
  core_12.IssuesRepository,
20849
- core_12.QualityMetricsRepository
21452
+ core_12.SonarqubeMetricsRepository
20850
21453
  ]
20851
21454
  }
20852
21455
  ],