renovate 42.0.0-next.2 → 42.0.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 (778) hide show
  1. package/dist/config/app-strings.d.ts +2 -1
  2. package/dist/config/app-strings.js +10 -2
  3. package/dist/config/app-strings.js.map +1 -1
  4. package/dist/config/decrypt/bcpgp.d.ts +1 -0
  5. package/dist/config/decrypt/bcpgp.js +57 -0
  6. package/dist/config/decrypt/bcpgp.js.map +1 -0
  7. package/dist/config/decrypt/openpgp.js +0 -4
  8. package/dist/config/decrypt/openpgp.js.map +1 -1
  9. package/dist/config/decrypt.d.ts +1 -1
  10. package/dist/config/decrypt.js +9 -26
  11. package/dist/config/decrypt.js.map +1 -1
  12. package/dist/config/global.js +1 -0
  13. package/dist/config/global.js.map +1 -1
  14. package/dist/config/migrations/custom/schedule-migration.js +9 -11
  15. package/dist/config/migrations/custom/schedule-migration.js.map +1 -1
  16. package/dist/config/migrations/custom/unpublish-safe-migration.js +3 -2
  17. package/dist/config/migrations/custom/unpublish-safe-migration.js.map +1 -1
  18. package/dist/config/options/index.js +49 -2
  19. package/dist/config/options/index.js.map +1 -1
  20. package/dist/config/presets/common.js +1 -0
  21. package/dist/config/presets/common.js.map +1 -1
  22. package/dist/config/presets/internal/abandonments.js +4 -1
  23. package/dist/config/presets/internal/abandonments.js.map +1 -1
  24. package/dist/config/presets/internal/config.js +15 -0
  25. package/dist/config/presets/internal/config.js.map +1 -1
  26. package/dist/config/presets/internal/custom-managers.js +2 -2
  27. package/dist/config/presets/internal/custom-managers.js.map +1 -1
  28. package/dist/config/presets/internal/default.js +12 -1
  29. package/dist/config/presets/internal/default.js.map +1 -1
  30. package/dist/config/presets/internal/group.js +13 -0
  31. package/dist/config/presets/internal/group.js.map +1 -1
  32. package/dist/config/presets/internal/npm.js +1 -8
  33. package/dist/config/presets/internal/npm.js.map +1 -1
  34. package/dist/config/presets/internal/packages.js +5 -1
  35. package/dist/config/presets/internal/packages.js.map +1 -1
  36. package/dist/config/presets/internal/security.js +8 -0
  37. package/dist/config/presets/internal/security.js.map +1 -1
  38. package/dist/config/presets/internal/workarounds.js +2 -2
  39. package/dist/config/presets/internal/workarounds.js.map +1 -1
  40. package/dist/config/schema.d.ts +1 -1
  41. package/dist/config/secrets.js +2 -2
  42. package/dist/config/secrets.js.map +1 -1
  43. package/dist/config/types.d.ts +26 -1
  44. package/dist/config/types.js.map +1 -1
  45. package/dist/config/validation.js +4 -3
  46. package/dist/config/validation.js.map +1 -1
  47. package/dist/config-validator.js +1 -1
  48. package/dist/config-validator.js.map +1 -1
  49. package/dist/constants/platforms.js +1 -0
  50. package/dist/constants/platforms.js.map +1 -1
  51. package/dist/data/monorepo.json +13 -2
  52. package/dist/data/node-js-schedule.json +1 -1
  53. package/dist/data/replacements.json +34 -0
  54. package/dist/data-files.generated.js +3 -3
  55. package/dist/data-files.generated.js.map +1 -1
  56. package/dist/logger/renovate-logger.d.ts +1 -0
  57. package/dist/logger/renovate-logger.js +3 -0
  58. package/dist/logger/renovate-logger.js.map +1 -1
  59. package/dist/logger/utils.js +2 -1
  60. package/dist/logger/utils.js.map +1 -1
  61. package/dist/manager-list.generated.d.ts +1 -1
  62. package/dist/manager-list.generated.js +1 -1
  63. package/dist/manager-list.generated.js.map +1 -1
  64. package/dist/modules/datasource/api.js +4 -0
  65. package/dist/modules/datasource/api.js.map +1 -1
  66. package/dist/modules/datasource/aws-eks-addon/schema.d.ts +1 -8
  67. package/dist/modules/datasource/aws-eks-addon/schema.js +7 -5
  68. package/dist/modules/datasource/aws-eks-addon/schema.js.map +1 -1
  69. package/dist/modules/datasource/azure-pipelines-tasks/schema.d.ts +12 -12
  70. package/dist/modules/datasource/bitrise/schema.d.ts +1 -1
  71. package/dist/modules/datasource/buildpacks-registry/index.js +1 -1
  72. package/dist/modules/datasource/buildpacks-registry/index.js.map +1 -1
  73. package/dist/modules/datasource/buildpacks-registry/schema.d.ts +1 -1
  74. package/dist/modules/datasource/buildpacks-registry/schema.js +2 -2
  75. package/dist/modules/datasource/buildpacks-registry/schema.js.map +1 -1
  76. package/dist/modules/datasource/cdnjs/index.js +2 -2
  77. package/dist/modules/datasource/cdnjs/index.js.map +1 -1
  78. package/dist/modules/datasource/cdnjs/schema.d.ts +8 -8
  79. package/dist/modules/datasource/cdnjs/schema.js +3 -3
  80. package/dist/modules/datasource/cdnjs/schema.js.map +1 -1
  81. package/dist/modules/datasource/conan/schema.d.ts +3 -3
  82. package/dist/modules/datasource/conda/prefix-dev.js +1 -1
  83. package/dist/modules/datasource/conda/prefix-dev.js.map +1 -1
  84. package/dist/modules/datasource/conda/schema/prefix-dev.d.ts +7 -7
  85. package/dist/modules/datasource/conda/schema/prefix-dev.js +2 -2
  86. package/dist/modules/datasource/conda/schema/prefix-dev.js.map +1 -1
  87. package/dist/modules/datasource/cpan/schema.js +2 -2
  88. package/dist/modules/datasource/cpan/schema.js.map +1 -1
  89. package/dist/modules/datasource/crate/index.js +12 -11
  90. package/dist/modules/datasource/crate/index.js.map +1 -1
  91. package/dist/modules/datasource/crate/schema.d.ts +1 -1
  92. package/dist/modules/datasource/crate/schema.js +2 -2
  93. package/dist/modules/datasource/crate/schema.js.map +1 -1
  94. package/dist/modules/datasource/custom/index.d.ts +1 -1
  95. package/dist/modules/datasource/custom/index.js +2 -2
  96. package/dist/modules/datasource/custom/index.js.map +1 -1
  97. package/dist/modules/datasource/custom/schema.d.ts +1 -1
  98. package/dist/modules/datasource/custom/schema.js +2 -2
  99. package/dist/modules/datasource/custom/schema.js.map +1 -1
  100. package/dist/modules/datasource/docker/index.d.ts +1 -1
  101. package/dist/modules/datasource/docker/index.js +4 -1
  102. package/dist/modules/datasource/docker/index.js.map +1 -1
  103. package/dist/modules/datasource/docker/schema.d.ts +4 -4
  104. package/dist/modules/datasource/forgejo-releases/index.js +3 -3
  105. package/dist/modules/datasource/forgejo-releases/index.js.map +1 -1
  106. package/dist/modules/datasource/forgejo-releases/schema.d.ts +6 -6
  107. package/dist/modules/datasource/forgejo-releases/schema.js +3 -3
  108. package/dist/modules/datasource/forgejo-releases/schema.js.map +1 -1
  109. package/dist/modules/datasource/forgejo-tags/index.js +3 -3
  110. package/dist/modules/datasource/forgejo-tags/index.js.map +1 -1
  111. package/dist/modules/datasource/forgejo-tags/schema.d.ts +4 -4
  112. package/dist/modules/datasource/forgejo-tags/schema.js +7 -7
  113. package/dist/modules/datasource/forgejo-tags/schema.js.map +1 -1
  114. package/dist/modules/datasource/gitea-releases/index.js +3 -3
  115. package/dist/modules/datasource/gitea-releases/index.js.map +1 -1
  116. package/dist/modules/datasource/gitea-releases/schema.d.ts +6 -6
  117. package/dist/modules/datasource/gitea-releases/schema.js +3 -3
  118. package/dist/modules/datasource/gitea-releases/schema.js.map +1 -1
  119. package/dist/modules/datasource/gitea-tags/index.js +3 -3
  120. package/dist/modules/datasource/gitea-tags/index.js.map +1 -1
  121. package/dist/modules/datasource/gitea-tags/schema.d.ts +4 -4
  122. package/dist/modules/datasource/gitea-tags/schema.js +7 -7
  123. package/dist/modules/datasource/gitea-tags/schema.js.map +1 -1
  124. package/dist/modules/datasource/github-runners/index.js +5 -3
  125. package/dist/modules/datasource/github-runners/index.js.map +1 -1
  126. package/dist/modules/datasource/go/base.js +3 -2
  127. package/dist/modules/datasource/go/base.js.map +1 -1
  128. package/dist/modules/datasource/go/common.js +13 -9
  129. package/dist/modules/datasource/go/common.js.map +1 -1
  130. package/dist/modules/datasource/go/index.js +7 -2
  131. package/dist/modules/datasource/go/index.js.map +1 -1
  132. package/dist/modules/datasource/go/releases-direct.d.ts +2 -0
  133. package/dist/modules/datasource/go/releases-direct.js +7 -1
  134. package/dist/modules/datasource/go/releases-direct.js.map +1 -1
  135. package/dist/modules/datasource/go/releases-goproxy.js +1 -1
  136. package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
  137. package/dist/modules/datasource/helm/index.js +1 -1
  138. package/dist/modules/datasource/helm/index.js.map +1 -1
  139. package/dist/modules/datasource/helm/schema.d.ts +2 -2
  140. package/dist/modules/datasource/helm/schema.js +4 -4
  141. package/dist/modules/datasource/helm/schema.js.map +1 -1
  142. package/dist/modules/datasource/jsr/common.d.ts +1 -0
  143. package/dist/modules/datasource/jsr/common.js +12 -0
  144. package/dist/modules/datasource/jsr/common.js.map +1 -0
  145. package/dist/modules/datasource/jsr/index.d.ts +12 -0
  146. package/dist/modules/datasource/jsr/index.js +66 -0
  147. package/dist/modules/datasource/jsr/index.js.map +1 -0
  148. package/dist/modules/datasource/jsr/schema.d.ts +27 -0
  149. package/dist/modules/datasource/jsr/schema.js +20 -0
  150. package/dist/modules/datasource/jsr/schema.js.map +1 -0
  151. package/dist/modules/datasource/jsr/util.d.ts +4 -0
  152. package/dist/modules/datasource/jsr/util.js +53 -0
  153. package/dist/modules/datasource/jsr/util.js.map +1 -0
  154. package/dist/modules/datasource/maven/index.js +14 -0
  155. package/dist/modules/datasource/maven/index.js.map +1 -1
  156. package/dist/modules/datasource/maven/util.js +10 -0
  157. package/dist/modules/datasource/maven/util.js.map +1 -1
  158. package/dist/modules/datasource/npm/get.js +2 -1
  159. package/dist/modules/datasource/npm/get.js.map +1 -1
  160. package/dist/modules/datasource/npm/types.d.ts +7 -0
  161. package/dist/modules/datasource/npm/types.js.map +1 -1
  162. package/dist/modules/datasource/nuget/v3.js +3 -1
  163. package/dist/modules/datasource/nuget/v3.js.map +1 -1
  164. package/dist/modules/datasource/packagist/schema.d.ts +12 -12
  165. package/dist/modules/datasource/pypi/index.d.ts +1 -0
  166. package/dist/modules/datasource/pypi/index.js +1 -0
  167. package/dist/modules/datasource/pypi/index.js.map +1 -1
  168. package/dist/modules/datasource/python-version/schema.d.ts +3 -3
  169. package/dist/modules/datasource/rpm/index.d.ts +7 -0
  170. package/dist/modules/datasource/rpm/index.js +7 -0
  171. package/dist/modules/datasource/rpm/index.js.map +1 -1
  172. package/dist/modules/datasource/types.d.ts +2 -0
  173. package/dist/modules/datasource/types.js.map +1 -1
  174. package/dist/modules/datasource/typst/index.d.ts +11 -0
  175. package/dist/modules/datasource/typst/index.js +65 -0
  176. package/dist/modules/datasource/typst/index.js.map +1 -0
  177. package/dist/modules/datasource/typst/schema.d.ts +31 -0
  178. package/dist/modules/datasource/typst/schema.js +28 -0
  179. package/dist/modules/datasource/typst/schema.js.map +1 -0
  180. package/dist/modules/datasource/unity3d-packages/schema.d.ts +4 -4
  181. package/dist/modules/manager/api.js +6 -0
  182. package/dist/modules/manager/api.js.map +1 -1
  183. package/dist/modules/manager/argocd/extract.js +1 -1
  184. package/dist/modules/manager/argocd/extract.js.map +1 -1
  185. package/dist/modules/manager/argocd/schema.d.ts +1 -1
  186. package/dist/modules/manager/argocd/schema.js +2 -2
  187. package/dist/modules/manager/argocd/schema.js.map +1 -1
  188. package/dist/modules/manager/azure-pipelines/schema.d.ts +1 -1
  189. package/dist/modules/manager/batect/extract.js +1 -1
  190. package/dist/modules/manager/batect/extract.js.map +1 -1
  191. package/dist/modules/manager/batect/schema.d.ts +4 -4
  192. package/dist/modules/manager/batect/schema.js +2 -2
  193. package/dist/modules/manager/batect/schema.js.map +1 -1
  194. package/dist/modules/manager/bazel/rules/docker.d.ts +3 -3
  195. package/dist/modules/manager/bazel/rules/git.d.ts +5 -5
  196. package/dist/modules/manager/bazel/rules/go.d.ts +5 -5
  197. package/dist/modules/manager/bazel/rules/oci.d.ts +3 -3
  198. package/dist/modules/manager/bazel-module/extract.js +5 -0
  199. package/dist/modules/manager/bazel-module/extract.js.map +1 -1
  200. package/dist/modules/manager/bazel-module/parser/context.d.ts +6 -0
  201. package/dist/modules/manager/bazel-module/parser/context.js +42 -2
  202. package/dist/modules/manager/bazel-module/parser/context.js.map +1 -1
  203. package/dist/modules/manager/bazel-module/parser/fragments.d.ts +276 -112
  204. package/dist/modules/manager/bazel-module/parser/fragments.js +70 -32
  205. package/dist/modules/manager/bazel-module/parser/fragments.js.map +1 -1
  206. package/dist/modules/manager/bazel-module/parser/index.js +3 -1
  207. package/dist/modules/manager/bazel-module/parser/index.js.map +1 -1
  208. package/dist/modules/manager/bazel-module/parser/maven.d.ts +27 -27
  209. package/dist/modules/manager/bazel-module/parser/maven.js +7 -7
  210. package/dist/modules/manager/bazel-module/parser/maven.js.map +1 -1
  211. package/dist/modules/manager/bazel-module/parser/oci.d.ts +38 -38
  212. package/dist/modules/manager/bazel-module/parser/oci.js +5 -5
  213. package/dist/modules/manager/bazel-module/parser/oci.js.map +1 -1
  214. package/dist/modules/manager/bazel-module/parser/repo-rules.d.ts +5 -0
  215. package/dist/modules/manager/bazel-module/parser/repo-rules.js +71 -0
  216. package/dist/modules/manager/bazel-module/parser/repo-rules.js.map +1 -0
  217. package/dist/modules/manager/bazel-module/rules-img.d.ts +229 -0
  218. package/dist/modules/manager/bazel-module/rules-img.js +74 -0
  219. package/dist/modules/manager/bazel-module/rules-img.js.map +1 -0
  220. package/dist/modules/manager/bazel-module/rules.d.ts +101 -101
  221. package/dist/modules/manager/bazel-module/rules.js +18 -18
  222. package/dist/modules/manager/bazel-module/rules.js.map +1 -1
  223. package/dist/modules/manager/bitrise/schema.d.ts +1 -1
  224. package/dist/modules/manager/bun/artifacts.js +5 -4
  225. package/dist/modules/manager/bun/artifacts.js.map +1 -1
  226. package/dist/modules/manager/bundler/locked-version.js +44 -23
  227. package/dist/modules/manager/bundler/locked-version.js.map +1 -1
  228. package/dist/modules/manager/cargo/artifacts.js +15 -11
  229. package/dist/modules/manager/cargo/artifacts.js.map +1 -1
  230. package/dist/modules/manager/cargo/extract.js +6 -3
  231. package/dist/modules/manager/cargo/extract.js.map +1 -1
  232. package/dist/modules/manager/cargo/index.d.ts +0 -1
  233. package/dist/modules/manager/cargo/index.js +11 -4
  234. package/dist/modules/manager/cargo/index.js.map +1 -1
  235. package/dist/modules/manager/cargo/locked-version.d.ts +2 -2
  236. package/dist/modules/manager/cargo/locked-version.js +1 -1
  237. package/dist/modules/manager/cargo/locked-version.js.map +1 -1
  238. package/dist/modules/manager/cargo/schema.d.ts +206 -35
  239. package/dist/modules/manager/cargo/schema.js +26 -18
  240. package/dist/modules/manager/cargo/schema.js.map +1 -1
  241. package/dist/modules/manager/cloudbuild/schema.d.ts +1 -1
  242. package/dist/modules/manager/composer/schema.d.ts +98 -98
  243. package/dist/modules/manager/conan/artifacts.js +12 -2
  244. package/dist/modules/manager/conan/artifacts.js.map +1 -1
  245. package/dist/modules/manager/conan/extract.js +1 -1
  246. package/dist/modules/manager/conan/extract.js.map +1 -1
  247. package/dist/modules/manager/conan/index.d.ts +0 -1
  248. package/dist/modules/manager/conan/index.js +0 -1
  249. package/dist/modules/manager/conan/index.js.map +1 -1
  250. package/dist/modules/manager/copier/artifacts.js +5 -5
  251. package/dist/modules/manager/copier/artifacts.js.map +1 -1
  252. package/dist/modules/manager/copier/schema.d.ts +2 -2
  253. package/dist/modules/manager/copier/schema.js +5 -1
  254. package/dist/modules/manager/copier/schema.js.map +1 -1
  255. package/dist/modules/manager/crossplane/extract.js +1 -1
  256. package/dist/modules/manager/crossplane/extract.js.map +1 -1
  257. package/dist/modules/manager/crossplane/schema.d.ts +2 -2
  258. package/dist/modules/manager/crossplane/schema.js +2 -2
  259. package/dist/modules/manager/crossplane/schema.js.map +1 -1
  260. package/dist/modules/manager/crow/extract.d.ts +2 -0
  261. package/dist/modules/manager/crow/extract.js +35 -0
  262. package/dist/modules/manager/crow/extract.js.map +1 -0
  263. package/dist/modules/manager/crow/index.d.ts +8 -0
  264. package/dist/modules/manager/crow/index.js +13 -0
  265. package/dist/modules/manager/crow/index.js.map +1 -0
  266. package/dist/modules/manager/crow/schema.d.ts +66 -0
  267. package/dist/modules/manager/crow/schema.js +15 -0
  268. package/dist/modules/manager/crow/schema.js.map +1 -0
  269. package/dist/modules/manager/custom/jsonata/schema.d.ts +1 -1
  270. package/dist/modules/manager/custom/jsonata/schema.js +4 -4
  271. package/dist/modules/manager/custom/jsonata/schema.js.map +1 -1
  272. package/dist/modules/manager/custom/jsonata/utils.js +3 -3
  273. package/dist/modules/manager/custom/jsonata/utils.js.map +1 -1
  274. package/dist/modules/manager/devbox/extract.js +1 -1
  275. package/dist/modules/manager/devbox/extract.js.map +1 -1
  276. package/dist/modules/manager/devbox/schema.d.ts +1 -1
  277. package/dist/modules/manager/devbox/schema.js +2 -2
  278. package/dist/modules/manager/devbox/schema.js.map +1 -1
  279. package/dist/modules/manager/devcontainer/schema.d.ts +1 -1
  280. package/dist/modules/manager/fingerprint.generated.js +35 -32
  281. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  282. package/dist/modules/manager/fleet/schema.d.ts +16 -16
  283. package/dist/modules/manager/flux/schema.d.ts +24 -24
  284. package/dist/modules/manager/github-actions/community.d.ts +96 -0
  285. package/dist/modules/manager/github-actions/community.js +116 -10
  286. package/dist/modules/manager/github-actions/community.js.map +1 -1
  287. package/dist/modules/manager/github-actions/extract.js +2 -1
  288. package/dist/modules/manager/github-actions/extract.js.map +1 -1
  289. package/dist/modules/manager/github-actions/schema.d.ts +3 -3
  290. package/dist/modules/manager/github-actions/schema.js +7 -7
  291. package/dist/modules/manager/github-actions/schema.js.map +1 -1
  292. package/dist/modules/manager/gitlabci/extract.js +2 -0
  293. package/dist/modules/manager/gitlabci/extract.js.map +1 -1
  294. package/dist/modules/manager/glasskube/schema.d.ts +12 -12
  295. package/dist/modules/manager/gleam/schema.d.ts +4 -4
  296. package/dist/modules/manager/gomod/artifacts.js +8 -4
  297. package/dist/modules/manager/gomod/artifacts.js.map +1 -1
  298. package/dist/modules/manager/gradle/parser/dependencies.js +23 -2
  299. package/dist/modules/manager/gradle/parser/dependencies.js.map +1 -1
  300. package/dist/modules/manager/gradle/parser/objects.js +15 -0
  301. package/dist/modules/manager/gradle/parser/objects.js.map +1 -1
  302. package/dist/modules/manager/gradle/parser.js +1 -1
  303. package/dist/modules/manager/gradle/parser.js.map +1 -1
  304. package/dist/modules/manager/helmfile/extract.js +26 -21
  305. package/dist/modules/manager/helmfile/extract.js.map +1 -1
  306. package/dist/modules/manager/helmfile/index.js +4 -1
  307. package/dist/modules/manager/helmfile/index.js.map +1 -1
  308. package/dist/modules/manager/helmfile/schema.d.ts +4 -4
  309. package/dist/modules/manager/maven-wrapper/artifacts.js +1 -1
  310. package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
  311. package/dist/modules/manager/maven-wrapper/extract.js +4 -4
  312. package/dist/modules/manager/maven-wrapper/extract.js.map +1 -1
  313. package/dist/modules/manager/maven-wrapper/index.d.ts +1 -1
  314. package/dist/modules/manager/maven-wrapper/index.js +5 -2
  315. package/dist/modules/manager/maven-wrapper/index.js.map +1 -1
  316. package/dist/modules/manager/mise/backends.d.ts +2 -2
  317. package/dist/modules/manager/mise/backends.js +1 -1
  318. package/dist/modules/manager/mise/backends.js.map +1 -1
  319. package/dist/modules/manager/mise/extract.js.map +1 -1
  320. package/dist/modules/manager/mise/schema.d.ts +6 -29
  321. package/dist/modules/manager/mise/schema.js +7 -8
  322. package/dist/modules/manager/mise/schema.js.map +1 -1
  323. package/dist/modules/manager/mise/upgradeable-tooling.js +1 -1
  324. package/dist/modules/manager/mise/upgradeable-tooling.js.map +1 -1
  325. package/dist/modules/manager/mise/utils.d.ts +2 -2
  326. package/dist/modules/manager/mise/utils.js +1 -1
  327. package/dist/modules/manager/mise/utils.js.map +1 -1
  328. package/dist/modules/manager/nix/artifacts.js +2 -2
  329. package/dist/modules/manager/nix/artifacts.js.map +1 -1
  330. package/dist/modules/manager/nix/extract.d.ts +2 -2
  331. package/dist/modules/manager/nix/extract.js +79 -67
  332. package/dist/modules/manager/nix/extract.js.map +1 -1
  333. package/dist/modules/manager/nix/index.d.ts +1 -0
  334. package/dist/modules/manager/nix/index.js +3 -1
  335. package/dist/modules/manager/nix/index.js.map +1 -1
  336. package/dist/modules/manager/nix/range.d.ts +3 -0
  337. package/dist/modules/manager/nix/range.js +10 -0
  338. package/dist/modules/manager/nix/range.js.map +1 -0
  339. package/dist/modules/manager/nix/schema.d.ts +42 -28
  340. package/dist/modules/manager/nix/schema.js +4 -1
  341. package/dist/modules/manager/nix/schema.js.map +1 -1
  342. package/dist/modules/manager/npm/extract/common/package-file.d.ts +1 -0
  343. package/dist/modules/manager/npm/extract/common/package-file.js +8 -0
  344. package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
  345. package/dist/modules/manager/npm/extract/index.js +24 -7
  346. package/dist/modules/manager/npm/extract/index.js.map +1 -1
  347. package/dist/modules/manager/npm/extract/pnpm.d.ts +4 -3
  348. package/dist/modules/manager/npm/extract/pnpm.js +1 -1
  349. package/dist/modules/manager/npm/extract/pnpm.js.map +1 -1
  350. package/dist/modules/manager/npm/extract/post/locked-versions.js +6 -0
  351. package/dist/modules/manager/npm/extract/post/locked-versions.js.map +1 -1
  352. package/dist/modules/manager/npm/extract/yarn.d.ts +4 -0
  353. package/dist/modules/manager/npm/extract/yarn.js +35 -0
  354. package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
  355. package/dist/modules/manager/npm/extract/yarnrc.d.ts +4 -4
  356. package/dist/modules/manager/npm/extract/yarnrc.js +1 -2
  357. package/dist/modules/manager/npm/extract/yarnrc.js.map +1 -1
  358. package/dist/modules/manager/npm/index.js +1 -0
  359. package/dist/modules/manager/npm/index.js.map +1 -1
  360. package/dist/modules/manager/npm/post-update/index.js +2 -1
  361. package/dist/modules/manager/npm/post-update/index.js.map +1 -1
  362. package/dist/modules/manager/npm/post-update/npm.js +14 -1
  363. package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
  364. package/dist/modules/manager/npm/post-update/pnpm.js +6 -1
  365. package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
  366. package/dist/modules/manager/npm/post-update/types.d.ts +5 -5
  367. package/dist/modules/manager/npm/post-update/types.js.map +1 -1
  368. package/dist/modules/manager/npm/post-update/utils.d.ts +3 -4
  369. package/dist/modules/manager/npm/post-update/utils.js +2 -13
  370. package/dist/modules/manager/npm/post-update/utils.js.map +1 -1
  371. package/dist/modules/manager/npm/schema.d.ts +35 -97
  372. package/dist/modules/manager/npm/schema.js +21 -16
  373. package/dist/modules/manager/npm/schema.js.map +1 -1
  374. package/dist/modules/manager/npm/update/dependency/index.js +4 -0
  375. package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
  376. package/dist/modules/manager/npm/update/dependency/pnpm.js +1 -1
  377. package/dist/modules/manager/npm/update/dependency/pnpm.js.map +1 -1
  378. package/dist/modules/manager/npm/update/dependency/yarn.d.ts +2 -0
  379. package/dist/modules/manager/npm/update/dependency/yarn.js +102 -0
  380. package/dist/modules/manager/npm/update/dependency/yarn.js.map +1 -0
  381. package/dist/modules/manager/npm/utils.d.ts +2 -0
  382. package/dist/modules/manager/npm/utils.js +10 -0
  383. package/dist/modules/manager/npm/utils.js.map +1 -1
  384. package/dist/modules/manager/nuget/extract.js +5 -0
  385. package/dist/modules/manager/nuget/extract.js.map +1 -1
  386. package/dist/modules/manager/nuget/schema.d.ts +3 -56
  387. package/dist/modules/manager/nuget/schema.js +5 -6
  388. package/dist/modules/manager/nuget/schema.js.map +1 -1
  389. package/dist/modules/manager/nvm/extract.js +8 -1
  390. package/dist/modules/manager/nvm/extract.js.map +1 -1
  391. package/dist/modules/manager/ocb/extract.js +1 -1
  392. package/dist/modules/manager/ocb/extract.js.map +1 -1
  393. package/dist/modules/manager/ocb/schema.d.ts +4 -4
  394. package/dist/modules/manager/ocb/schema.js +9 -9
  395. package/dist/modules/manager/ocb/schema.js.map +1 -1
  396. package/dist/modules/manager/pep621/extract.d.ts +1 -1
  397. package/dist/modules/manager/pep621/extract.js +11 -3
  398. package/dist/modules/manager/pep621/extract.js.map +1 -1
  399. package/dist/modules/manager/pep621/processors/abstract.d.ts +10 -0
  400. package/dist/modules/manager/pep621/processors/abstract.js +25 -0
  401. package/dist/modules/manager/pep621/processors/abstract.js.map +1 -0
  402. package/dist/modules/manager/pep621/processors/hatch.d.ts +2 -2
  403. package/dist/modules/manager/pep621/processors/hatch.js +2 -1
  404. package/dist/modules/manager/pep621/processors/hatch.js.map +1 -1
  405. package/dist/modules/manager/pep621/processors/index.d.ts +2 -4
  406. package/dist/modules/manager/pep621/processors/index.js.map +1 -1
  407. package/dist/modules/manager/pep621/processors/pdm.d.ts +3 -2
  408. package/dist/modules/manager/pep621/processors/pdm.js +5 -4
  409. package/dist/modules/manager/pep621/processors/pdm.js.map +1 -1
  410. package/dist/modules/manager/pep621/processors/types.d.ts +1 -0
  411. package/dist/modules/manager/pep621/processors/types.js.map +1 -1
  412. package/dist/modules/manager/pep621/processors/uv.d.ts +3 -2
  413. package/dist/modules/manager/pep621/processors/uv.js +8 -6
  414. package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
  415. package/dist/modules/manager/pep621/schema.d.ts +35 -257
  416. package/dist/modules/manager/pep621/schema.js +17 -21
  417. package/dist/modules/manager/pep621/schema.js.map +1 -1
  418. package/dist/modules/manager/pep723/extract.js +1 -1
  419. package/dist/modules/manager/pep723/extract.js.map +1 -1
  420. package/dist/modules/manager/pep723/schema.d.ts +1 -1
  421. package/dist/modules/manager/pep723/schema.js +2 -2
  422. package/dist/modules/manager/pep723/schema.js.map +1 -1
  423. package/dist/modules/manager/pip-compile/extract.d.ts +1 -1
  424. package/dist/modules/manager/pip-compile/extract.js +9 -6
  425. package/dist/modules/manager/pip-compile/extract.js.map +1 -1
  426. package/dist/modules/manager/pixi/extract.js +4 -7
  427. package/dist/modules/manager/pixi/extract.js.map +1 -1
  428. package/dist/modules/manager/pixi/schema.d.ts +296 -4
  429. package/dist/modules/manager/pixi/schema.js +11 -4
  430. package/dist/modules/manager/pixi/schema.js.map +1 -1
  431. package/dist/modules/manager/poetry/artifacts.js +2 -2
  432. package/dist/modules/manager/poetry/artifacts.js.map +1 -1
  433. package/dist/modules/manager/poetry/extract.js +1 -1
  434. package/dist/modules/manager/poetry/extract.js.map +1 -1
  435. package/dist/modules/manager/poetry/index.d.ts +1 -0
  436. package/dist/modules/manager/poetry/index.js +2 -1
  437. package/dist/modules/manager/poetry/index.js.map +1 -1
  438. package/dist/modules/manager/poetry/schema.d.ts +45 -138
  439. package/dist/modules/manager/poetry/schema.js +49 -32
  440. package/dist/modules/manager/poetry/schema.js.map +1 -1
  441. package/dist/modules/manager/poetry/update-locked.js +2 -2
  442. package/dist/modules/manager/poetry/update-locked.js.map +1 -1
  443. package/dist/modules/manager/pre-commit/extract.js +2 -1
  444. package/dist/modules/manager/pre-commit/extract.js.map +1 -1
  445. package/dist/modules/manager/pub/extract.js +38 -8
  446. package/dist/modules/manager/pub/extract.js.map +1 -1
  447. package/dist/modules/manager/pub/index.d.ts +0 -1
  448. package/dist/modules/manager/pub/index.js +0 -3
  449. package/dist/modules/manager/pub/index.js.map +1 -1
  450. package/dist/modules/manager/pub/schema.d.ts +25 -79
  451. package/dist/modules/manager/pub/schema.js +17 -10
  452. package/dist/modules/manager/pub/schema.js.map +1 -1
  453. package/dist/modules/manager/pub/utils.d.ts +3 -3
  454. package/dist/modules/manager/pub/utils.js +2 -2
  455. package/dist/modules/manager/pub/utils.js.map +1 -1
  456. package/dist/modules/manager/quadlet/extract.d.ts +2 -0
  457. package/dist/modules/manager/quadlet/extract.js +54 -0
  458. package/dist/modules/manager/quadlet/extract.js.map +1 -0
  459. package/dist/modules/manager/quadlet/index.d.ts +8 -0
  460. package/dist/modules/manager/quadlet/index.js +13 -0
  461. package/dist/modules/manager/quadlet/index.js.map +1 -0
  462. package/dist/modules/manager/quadlet/schema.d.ts +45 -0
  463. package/dist/modules/manager/quadlet/schema.js +23 -0
  464. package/dist/modules/manager/quadlet/schema.js.map +1 -0
  465. package/dist/modules/manager/renovate-config-presets/extract.js +1 -1
  466. package/dist/modules/manager/renovate-config-presets/extract.js.map +1 -1
  467. package/dist/modules/manager/renovate-config-presets/index.js +1 -1
  468. package/dist/modules/manager/renovate-config-presets/index.js.map +1 -1
  469. package/dist/modules/manager/renovate-config-presets/schema.d.ts +1 -1
  470. package/dist/modules/manager/renovate-config-presets/schema.js +2 -2
  471. package/dist/modules/manager/renovate-config-presets/schema.js.map +1 -1
  472. package/dist/modules/manager/swift/extract.js +25 -9
  473. package/dist/modules/manager/swift/extract.js.map +1 -1
  474. package/dist/modules/manager/swift/index.js +7 -1
  475. package/dist/modules/manager/swift/index.js.map +1 -1
  476. package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js +1 -1
  477. package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js.map +1 -1
  478. package/dist/modules/manager/terraform/lockfile/hash.js +1 -1
  479. package/dist/modules/manager/terraform/lockfile/hash.js.map +1 -1
  480. package/dist/modules/manager/terragrunt/util.js +1 -1
  481. package/dist/modules/manager/terragrunt/util.js.map +1 -1
  482. package/dist/modules/manager/types.d.ts +2 -0
  483. package/dist/modules/manager/types.js.map +1 -1
  484. package/dist/modules/manager/typst/extract.d.ts +2 -0
  485. package/dist/modules/manager/typst/extract.js +31 -0
  486. package/dist/modules/manager/typst/extract.js.map +1 -0
  487. package/dist/modules/manager/typst/index.d.ts +7 -0
  488. package/dist/modules/manager/typst/index.js +12 -0
  489. package/dist/modules/manager/typst/index.js.map +1 -0
  490. package/dist/modules/manager/util.js +3 -2
  491. package/dist/modules/manager/util.js.map +1 -1
  492. package/dist/modules/manager/vendir/schema.d.ts +13 -13
  493. package/dist/modules/platform/azure/azure-helper.js +1 -1
  494. package/dist/modules/platform/azure/azure-helper.js.map +1 -1
  495. package/dist/modules/platform/azure/schema.d.ts +3 -3
  496. package/dist/modules/platform/azure/schema.js +4 -4
  497. package/dist/modules/platform/azure/schema.js.map +1 -1
  498. package/dist/modules/platform/bitbucket/index.js +12 -9
  499. package/dist/modules/platform/bitbucket/index.js.map +1 -1
  500. package/dist/modules/platform/bitbucket/schema.d.ts +7 -7
  501. package/dist/modules/platform/bitbucket/schema.js +7 -7
  502. package/dist/modules/platform/bitbucket/schema.js.map +1 -1
  503. package/dist/modules/platform/bitbucket-server/index.js +7 -6
  504. package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
  505. package/dist/modules/platform/bitbucket-server/schema.d.ts +16 -17
  506. package/dist/modules/platform/bitbucket-server/schema.js +6 -8
  507. package/dist/modules/platform/bitbucket-server/schema.js.map +1 -1
  508. package/dist/modules/platform/codecommit/index.d.ts +0 -8
  509. package/dist/modules/platform/codecommit/index.js +16 -16
  510. package/dist/modules/platform/codecommit/index.js.map +1 -1
  511. package/dist/modules/platform/forgejo/index.js +39 -38
  512. package/dist/modules/platform/forgejo/index.js.map +1 -1
  513. package/dist/modules/platform/forgejo/types.d.ts +3 -2
  514. package/dist/modules/platform/forgejo/types.js.map +1 -1
  515. package/dist/modules/platform/forgejo/utils.d.ts +1 -0
  516. package/dist/modules/platform/forgejo/utils.js +17 -0
  517. package/dist/modules/platform/forgejo/utils.js.map +1 -1
  518. package/dist/modules/platform/gerrit/client.d.ts +1 -1
  519. package/dist/modules/platform/gerrit/client.js +32 -33
  520. package/dist/modules/platform/gerrit/client.js.map +1 -1
  521. package/dist/modules/platform/gerrit/index.d.ts +1 -2
  522. package/dist/modules/platform/gerrit/index.js +8 -16
  523. package/dist/modules/platform/gerrit/index.js.map +1 -1
  524. package/dist/modules/platform/gerrit/scm.js +7 -13
  525. package/dist/modules/platform/gerrit/scm.js.map +1 -1
  526. package/dist/modules/platform/gerrit/types.d.ts +27 -1
  527. package/dist/modules/platform/gerrit/types.js.map +1 -1
  528. package/dist/modules/platform/gitea/index.js +34 -37
  529. package/dist/modules/platform/gitea/index.js.map +1 -1
  530. package/dist/modules/platform/gitea/schema.d.ts +3 -3
  531. package/dist/modules/platform/gitea/schema.js +3 -3
  532. package/dist/modules/platform/gitea/schema.js.map +1 -1
  533. package/dist/modules/platform/gitea/types.d.ts +3 -2
  534. package/dist/modules/platform/gitea/types.js.map +1 -1
  535. package/dist/modules/platform/gitea/utils.d.ts +1 -0
  536. package/dist/modules/platform/gitea/utils.js +17 -0
  537. package/dist/modules/platform/gitea/utils.js.map +1 -1
  538. package/dist/modules/platform/github/index.d.ts +1 -1
  539. package/dist/modules/platform/github/index.js +92 -33
  540. package/dist/modules/platform/github/index.js.map +1 -1
  541. package/dist/modules/platform/github/schema.d.ts +32 -2
  542. package/dist/modules/platform/github/schema.js +32 -8
  543. package/dist/modules/platform/github/schema.js.map +1 -1
  544. package/dist/modules/platform/github/types.d.ts +2 -2
  545. package/dist/modules/platform/github/types.js.map +1 -1
  546. package/dist/modules/platform/github/user.d.ts +2 -1
  547. package/dist/modules/platform/github/user.js.map +1 -1
  548. package/dist/modules/platform/gitlab/index.js.map +1 -1
  549. package/dist/modules/platform/gitlab/pr-cache.d.ts +0 -2
  550. package/dist/modules/platform/gitlab/pr-cache.js +28 -37
  551. package/dist/modules/platform/gitlab/pr-cache.js.map +1 -1
  552. package/dist/modules/platform/gitlab/utils.js +1 -0
  553. package/dist/modules/platform/gitlab/utils.js.map +1 -1
  554. package/dist/modules/platform/types.d.ts +1 -1
  555. package/dist/modules/platform/types.js.map +1 -1
  556. package/dist/modules/versioning/api.js +2 -0
  557. package/dist/modules/versioning/api.js.map +1 -1
  558. package/dist/modules/versioning/cargo/index.js +7 -7
  559. package/dist/modules/versioning/cargo/index.js.map +1 -1
  560. package/dist/modules/versioning/composer/index.js +0 -4
  561. package/dist/modules/versioning/composer/index.js.map +1 -1
  562. package/dist/modules/versioning/conan/index.js +1 -1
  563. package/dist/modules/versioning/conan/index.js.map +1 -1
  564. package/dist/modules/versioning/conda/index.d.ts +2 -0
  565. package/dist/modules/versioning/conda/index.js +4 -4
  566. package/dist/modules/versioning/conda/index.js.map +1 -1
  567. package/dist/modules/versioning/debian/index.d.ts +1 -1
  568. package/dist/modules/versioning/debian/index.js +2 -17
  569. package/dist/modules/versioning/debian/index.js.map +1 -1
  570. package/dist/modules/versioning/gradle/index.js +2 -2
  571. package/dist/modules/versioning/gradle/index.js.map +1 -1
  572. package/dist/modules/versioning/hashicorp/index.js +0 -1
  573. package/dist/modules/versioning/hashicorp/index.js.map +1 -1
  574. package/dist/modules/versioning/helm/index.js +0 -1
  575. package/dist/modules/versioning/helm/index.js.map +1 -1
  576. package/dist/modules/versioning/hex/index.js +0 -1
  577. package/dist/modules/versioning/hex/index.js.map +1 -1
  578. package/dist/modules/versioning/ivy/index.js +1 -2
  579. package/dist/modules/versioning/ivy/index.js.map +1 -1
  580. package/dist/modules/versioning/npm/index.js +0 -1
  581. package/dist/modules/versioning/npm/index.js.map +1 -1
  582. package/dist/modules/versioning/npm/range.js +2 -3
  583. package/dist/modules/versioning/npm/range.js.map +1 -1
  584. package/dist/modules/versioning/nuget/index.js +8 -4
  585. package/dist/modules/versioning/nuget/index.js.map +1 -1
  586. package/dist/modules/versioning/pep440/index.js +1 -1
  587. package/dist/modules/versioning/pep440/index.js.map +1 -1
  588. package/dist/modules/versioning/pep440/range.d.ts +1 -0
  589. package/dist/modules/versioning/pep440/range.js +4 -3
  590. package/dist/modules/versioning/pep440/range.js.map +1 -1
  591. package/dist/modules/versioning/poetry/index.js +0 -4
  592. package/dist/modules/versioning/poetry/index.js.map +1 -1
  593. package/dist/modules/versioning/rez/index.js +0 -1
  594. package/dist/modules/versioning/rez/index.js.map +1 -1
  595. package/dist/modules/versioning/ruby/index.js +5 -5
  596. package/dist/modules/versioning/ruby/index.js.map +1 -1
  597. package/dist/modules/versioning/ruby/strategies/index.d.ts +1 -2
  598. package/dist/modules/versioning/ruby/strategies/index.js +1 -3
  599. package/dist/modules/versioning/ruby/strategies/index.js.map +1 -1
  600. package/dist/modules/versioning/semver-partial/index.d.ts +8 -0
  601. package/dist/modules/versioning/semver-partial/index.js +211 -0
  602. package/dist/modules/versioning/semver-partial/index.js.map +1 -0
  603. package/dist/modules/versioning/swift/index.js +0 -1
  604. package/dist/modules/versioning/swift/index.js.map +1 -1
  605. package/dist/modules/versioning/types.d.ts +5 -0
  606. package/dist/modules/versioning/types.js.map +1 -1
  607. package/dist/renovate.js +0 -0
  608. package/dist/util/cache/package/decorator.js +20 -9
  609. package/dist/util/cache/package/decorator.js.map +1 -1
  610. package/dist/util/cache/package/file.d.ts +1 -1
  611. package/dist/util/cache/package/file.js +3 -3
  612. package/dist/util/cache/package/file.js.map +1 -1
  613. package/dist/util/cache/package/index.d.ts +9 -2
  614. package/dist/util/cache/package/index.js +19 -4
  615. package/dist/util/cache/package/index.js.map +1 -1
  616. package/dist/util/cache/package/namespaces.d.ts +1 -1
  617. package/dist/util/cache/package/namespaces.js +3 -0
  618. package/dist/util/cache/package/namespaces.js.map +1 -1
  619. package/dist/util/cache/package/redis.d.ts +1 -1
  620. package/dist/util/cache/package/redis.js +17 -7
  621. package/dist/util/cache/package/redis.js.map +1 -1
  622. package/dist/util/cache/package/sqlite.d.ts +1 -1
  623. package/dist/util/cache/package/sqlite.js +2 -2
  624. package/dist/util/cache/package/sqlite.js.map +1 -1
  625. package/dist/util/cache/package/types.d.ts +1 -1
  626. package/dist/util/cache/package/types.js.map +1 -1
  627. package/dist/util/cache/repository/http-cache.js +1 -1
  628. package/dist/util/cache/repository/http-cache.js.map +1 -1
  629. package/dist/util/cache/repository/schema.d.ts +1 -1
  630. package/dist/util/cache/repository/types.d.ts +1 -0
  631. package/dist/util/cache/repository/types.js.map +1 -1
  632. package/dist/util/emoji.js +2 -2
  633. package/dist/util/emoji.js.map +1 -1
  634. package/dist/util/exec/containerbase.js +5 -0
  635. package/dist/util/exec/containerbase.js.map +1 -1
  636. package/dist/util/git/index.js +6 -3
  637. package/dist/util/git/index.js.map +1 -1
  638. package/dist/util/git/private-key.js +23 -3
  639. package/dist/util/git/private-key.js.map +1 -1
  640. package/dist/util/git/types.d.ts +2 -1
  641. package/dist/util/git/types.js.map +1 -1
  642. package/dist/util/github/graphql/query-adapters/releases-query-adapter.d.ts +6 -6
  643. package/dist/util/http/bitbucket.js +0 -1
  644. package/dist/util/http/bitbucket.js.map +1 -1
  645. package/dist/util/http/cache/abstract-http-cache-provider.d.ts +7 -7
  646. package/dist/util/http/cache/abstract-http-cache-provider.js +11 -11
  647. package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
  648. package/dist/util/http/cache/memory-http-cache-provider.d.ts +3 -3
  649. package/dist/util/http/cache/memory-http-cache-provider.js +8 -8
  650. package/dist/util/http/cache/memory-http-cache-provider.js.map +1 -1
  651. package/dist/util/http/cache/package-http-cache-provider.d.ts +5 -4
  652. package/dist/util/http/cache/package-http-cache-provider.js +17 -11
  653. package/dist/util/http/cache/package-http-cache-provider.js.map +1 -1
  654. package/dist/util/http/cache/repository-http-cache-provider.d.ts +16 -3
  655. package/dist/util/http/cache/repository-http-cache-provider.js +60 -3
  656. package/dist/util/http/cache/repository-http-cache-provider.js.map +1 -1
  657. package/dist/util/http/cache/schema.d.ts +2 -2
  658. package/dist/util/http/cache/schema.js +2 -2
  659. package/dist/util/http/cache/schema.js.map +1 -1
  660. package/dist/util/http/cache/types.d.ts +3 -3
  661. package/dist/util/http/cache/types.js.map +1 -1
  662. package/dist/util/http/gerrit.d.ts +1 -1
  663. package/dist/util/http/gerrit.js +1 -1
  664. package/dist/util/http/gerrit.js.map +1 -1
  665. package/dist/util/http/gitlab.js +0 -1
  666. package/dist/util/http/gitlab.js.map +1 -1
  667. package/dist/util/http/host-rules.js +10 -0
  668. package/dist/util/http/host-rules.js.map +1 -1
  669. package/dist/util/http/http.d.ts +1 -1
  670. package/dist/util/http/http.js +17 -15
  671. package/dist/util/http/http.js.map +1 -1
  672. package/dist/util/http/retry-after.js +1 -1
  673. package/dist/util/http/retry-after.js.map +1 -1
  674. package/dist/util/interpolator.js +2 -0
  675. package/dist/util/interpolator.js.map +1 -1
  676. package/dist/util/markdown.js +3 -3
  677. package/dist/util/markdown.js.map +1 -1
  678. package/dist/util/merge-confidence/index.js +3 -1
  679. package/dist/util/merge-confidence/index.js.map +1 -1
  680. package/dist/util/schema-utils/index.d.ts +8 -4
  681. package/dist/util/schema-utils/index.js +16 -1
  682. package/dist/util/schema-utils/index.js.map +1 -1
  683. package/dist/util/template/index.d.ts +1 -0
  684. package/dist/util/template/index.js +70 -64
  685. package/dist/util/template/index.js.map +1 -1
  686. package/dist/workers/global/config/parse/file.js +6 -0
  687. package/dist/workers/global/config/parse/file.js.map +1 -1
  688. package/dist/workers/global/config/parse/index.js +2 -1
  689. package/dist/workers/global/config/parse/index.js.map +1 -1
  690. package/dist/workers/repository/config-migration/branch/commit-message.js +2 -1
  691. package/dist/workers/repository/config-migration/branch/commit-message.js.map +1 -1
  692. package/dist/workers/repository/config-migration/branch/create.js +1 -0
  693. package/dist/workers/repository/config-migration/branch/create.js.map +1 -1
  694. package/dist/workers/repository/config-migration/branch/rebase.js +1 -0
  695. package/dist/workers/repository/config-migration/branch/rebase.js.map +1 -1
  696. package/dist/workers/repository/dependency-dashboard.js +42 -5
  697. package/dist/workers/repository/dependency-dashboard.js.map +1 -1
  698. package/dist/workers/repository/error-config.js +1 -1
  699. package/dist/workers/repository/error-config.js.map +1 -1
  700. package/dist/workers/repository/error.js +1 -1
  701. package/dist/workers/repository/error.js.map +1 -1
  702. package/dist/workers/repository/extract/supersedes.d.ts +1 -1
  703. package/dist/workers/repository/extract/supersedes.js +31 -17
  704. package/dist/workers/repository/extract/supersedes.js.map +1 -1
  705. package/dist/workers/repository/finalize/index.js +1 -1
  706. package/dist/workers/repository/finalize/index.js.map +1 -1
  707. package/dist/workers/repository/finalize/prune.js +4 -3
  708. package/dist/workers/repository/finalize/prune.js.map +1 -1
  709. package/dist/workers/repository/index.js +49 -20
  710. package/dist/workers/repository/index.js.map +1 -1
  711. package/dist/workers/repository/init/inherited.js +7 -0
  712. package/dist/workers/repository/init/inherited.js.map +1 -1
  713. package/dist/workers/repository/init/merge.js +1 -1
  714. package/dist/workers/repository/init/merge.js.map +1 -1
  715. package/dist/workers/repository/onboarding/branch/check.js +5 -3
  716. package/dist/workers/repository/onboarding/branch/check.js.map +1 -1
  717. package/dist/workers/repository/onboarding/branch/create.js +1 -0
  718. package/dist/workers/repository/onboarding/branch/create.js.map +1 -1
  719. package/dist/workers/repository/onboarding/branch/rebase.js +1 -0
  720. package/dist/workers/repository/onboarding/branch/rebase.js.map +1 -1
  721. package/dist/workers/repository/onboarding/common.js +3 -2
  722. package/dist/workers/repository/onboarding/common.js.map +1 -1
  723. package/dist/workers/repository/process/extract-update.js +2 -2
  724. package/dist/workers/repository/process/extract-update.js.map +1 -1
  725. package/dist/workers/repository/process/fetch.js +4 -3
  726. package/dist/workers/repository/process/fetch.js.map +1 -1
  727. package/dist/workers/repository/process/index.d.ts +1 -0
  728. package/dist/workers/repository/process/index.js +25 -5
  729. package/dist/workers/repository/process/index.js.map +1 -1
  730. package/dist/workers/repository/process/lookup/filter-checks.js +42 -8
  731. package/dist/workers/repository/process/lookup/filter-checks.js.map +1 -1
  732. package/dist/workers/repository/process/lookup/filter.js +5 -7
  733. package/dist/workers/repository/process/lookup/filter.js.map +1 -1
  734. package/dist/workers/repository/process/lookup/index.js +10 -13
  735. package/dist/workers/repository/process/lookup/index.js.map +1 -1
  736. package/dist/workers/repository/process/vulnerabilities.d.ts +1 -1
  737. package/dist/workers/repository/process/vulnerabilities.js +13 -8
  738. package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
  739. package/dist/workers/repository/reconfigure/comment.js +1 -1
  740. package/dist/workers/repository/reconfigure/comment.js.map +1 -1
  741. package/dist/workers/repository/reconfigure/index.js +1 -1
  742. package/dist/workers/repository/reconfigure/index.js.map +1 -1
  743. package/dist/workers/repository/update/branch/commit.js +2 -0
  744. package/dist/workers/repository/update/branch/commit.js.map +1 -1
  745. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +12 -1
  746. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
  747. package/dist/workers/repository/update/branch/index.js +65 -20
  748. package/dist/workers/repository/update/branch/index.js.map +1 -1
  749. package/dist/workers/repository/update/branch/status-checks.js +5 -0
  750. package/dist/workers/repository/update/branch/status-checks.js.map +1 -1
  751. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +1 -1
  752. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
  753. package/dist/workers/repository/update/pr/changelog/forgejo/index.js +3 -3
  754. package/dist/workers/repository/update/pr/changelog/forgejo/index.js.map +1 -1
  755. package/dist/workers/repository/update/pr/changelog/gitea/index.js +3 -3
  756. package/dist/workers/repository/update/pr/changelog/gitea/index.js.map +1 -1
  757. package/dist/workers/repository/update/pr/changelog/release-notes.js +9 -4
  758. package/dist/workers/repository/update/pr/changelog/release-notes.js.map +1 -1
  759. package/dist/workers/repository/update/pr/index.js +28 -11
  760. package/dist/workers/repository/update/pr/index.js.map +1 -1
  761. package/dist/workers/repository/update/pr/pr-reuse.d.ts +1 -1
  762. package/dist/workers/repository/update/pr/pr-reuse.js +2 -2
  763. package/dist/workers/repository/update/pr/pr-reuse.js.map +1 -1
  764. package/dist/workers/repository/updates/generate.js +1 -0
  765. package/dist/workers/repository/updates/generate.js.map +1 -1
  766. package/dist/workers/types.d.ts +1 -0
  767. package/dist/workers/types.js.map +1 -1
  768. package/package.json +136 -153
  769. package/renovate-schema.json +325 -111
  770. package/dist/config/decrypt/kbpgp.d.ts +0 -1
  771. package/dist/config/decrypt/kbpgp.js +0 -58
  772. package/dist/config/decrypt/kbpgp.js.map +0 -1
  773. package/dist/config/decrypt/legacy.d.ts +0 -2
  774. package/dist/config/decrypt/legacy.js +0 -36
  775. package/dist/config/decrypt/legacy.js.map +0 -1
  776. package/dist/modules/versioning/ruby/strategies/pin.d.ts +0 -4
  777. package/dist/modules/versioning/ruby/strategies/pin.js +0 -4
  778. package/dist/modules/versioning/ruby/strategies/pin.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../../lib/workers/repository/finalize/prune.ts"],"names":[],"mappings":";;AA4IA,gDA4CC;;AAxLD,kEAAkC;AAClC,mDAAsD;AAEtD,sEAAuE;AACvE,4CAAyC;AACzC,wDAAqD;AACrD,+DAAkE;AAClE,uDAAoD;AACpD,2CAAqE;AACrE,+CAA0D;AAC1D,iDAAqD;AACrD,gDAAgE;AAEhE,KAAK,UAAU,eAAe,CAC5B,MAAsB,EACtB,iBAA2B;IAE3B,IAAI,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AC;IACF,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,MAAM,CAC/C,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CACzC,CAAC;IACF,eAAM,CAAC,KAAK,CAAC,qBAAqB,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAC/D,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,eAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACxC,OAAO;IACT,CAAC;IAED,MAAM,eAAe,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { GlobalConfig } from '../../../config/global';\nimport type { RenovateConfig } from '../../../config/types';\nimport { REPOSITORY_CHANGED } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { platform } from '../../../modules/platform';\nimport { ensureComment } from '../../../modules/platform/comment';\nimport { scm } from '../../../modules/platform/scm';\nimport { getBranchList, setUserRepoConfig } from '../../../util/git';\nimport { escapeRegExp, regEx } from '../../../util/regex';\nimport { uniqueStrings } from '../../../util/string';\nimport { getReconfigureBranchName } from '../reconfigure/utils';\n\nasync function cleanUpBranches(\n config: RenovateConfig,\n remainingBranches: string[],\n): Promise<void> {\n if (!config.pruneStaleBranches) {\n logger.debug('Branch/PR pruning is disabled - skipping');\n return;\n }\n // set Git author in case the repository is not initialized yet\n setUserRepoConfig(config);\n\n // calculate regex to extract base branch from branch name\n const baseBranchRe = calculateBaseBranchRegex(config);\n\n for (const branchName of remainingBranches) {\n try {\n // get base branch from branch name if base branches are configured\n // use default branch if no base branches are configured\n // use defaul branch name if no match (can happen when base branches are configured later)\n const baseBranch =\n baseBranchRe?.exec(branchName)?.[1] ?? config.defaultBranch!;\n const pr = await platform.findPr({\n branchName,\n state: 'open',\n targetBranch: baseBranch,\n });\n const branchIsModified = await scm.isBranchModified(\n branchName,\n baseBranch,\n );\n if (pr) {\n if (branchIsModified) {\n logger.debug(\n { prNo: pr.number, prTitle: pr.title },\n 'Branch is modified - skipping PR autoclosing',\n );\n if (GlobalConfig.get('dryRun')) {\n logger.info(`DRY-RUN: Would update PR title and ensure comment.`);\n } else {\n if (!pr.title.endsWith('- abandoned')) {\n const newPrTitle = pr.title + ' - abandoned';\n await platform.updatePr({\n number: pr.number,\n prTitle: newPrTitle,\n state: 'open',\n });\n }\n\n await ensureComment({\n number: pr.number,\n topic: 'Autoclosing Skipped',\n content:\n 'This PR has been flagged for autoclosing. However, it is being skipped due to the branch being already modified. Please close/delete it manually or report a bug if you think this is in error.',\n });\n }\n } else if (GlobalConfig.get('dryRun')) {\n logger.info(\n { prNo: pr.number, prTitle: pr.title },\n `DRY-RUN: Would autoclose PR`,\n );\n } else {\n logger.info(\n { branchName, prNo: pr.number, prTitle: pr.title },\n 'Autoclosing PR',\n );\n let newPrTitle = pr.title;\n if (!pr.title.endsWith('- autoclosed')) {\n newPrTitle += ' - autoclosed';\n }\n await platform.updatePr({\n number: pr.number,\n prTitle: newPrTitle,\n state: 'closed',\n });\n await scm.deleteBranch(branchName);\n }\n } else if (branchIsModified) {\n logger.debug('Orphan Branch is modified - skipping branch deletion');\n } else if (GlobalConfig.get('dryRun')) {\n logger.info(`DRY-RUN: Would delete orphan branch ${branchName}`);\n } else {\n logger.info({ branch: branchName }, `Deleting orphan branch`);\n await scm.deleteBranch(branchName);\n }\n } catch (err) /* istanbul ignore next */ {\n if (err.message === 'config-validation') {\n logger.debug(\n 'Cannot prune branch due to collision between tags and branch names',\n );\n } else if (err.message?.includes(\"bad revision 'origin/\")) {\n logger.debug(\n { branchName },\n 'Branch not found on origin when attempting to prune',\n );\n } else if (err.message !== REPOSITORY_CHANGED) {\n logger.warn({ err, branch: branchName }, 'Error pruning branch');\n }\n }\n }\n}\n\n/**\n * Calculates a {RegExp} to extract the base branch from a branch name if base branches are configured.\n * @param config Renovate configuration\n */\nfunction calculateBaseBranchRegex(config: RenovateConfig): RegExp | null {\n if (!config.baseBranchPatterns?.length) {\n return null;\n }\n\n // calculate possible branch prefixes and escape for regex\n const branchPrefixes = [config.branchPrefix, config.branchPrefixOld]\n .filter(is.nonEmptyStringAndNotWhitespace)\n .filter(uniqueStrings)\n .map(escapeRegExp);\n\n // calculate possible base branches and escape for regex\n const baseBranches = config.baseBranchPatterns.map(escapeRegExp);\n\n // create regex to extract base branche from branch name\n const baseBranchRe = regEx(\n `^(?:${branchPrefixes.join('|')})(${baseBranches.join('|')})-`,\n );\n\n return baseBranchRe;\n}\n\nexport async function pruneStaleBranches(\n config: RenovateConfig,\n branchList: string[] | null | undefined,\n): Promise<void> {\n logger.debug('Removing any stale branches');\n logger.trace({ config }, `pruneStaleBranches`);\n // TODO: types (#22198)\n logger.debug(`config.repoIsOnboarded=${config.repoIsOnboarded!}`);\n if (!branchList) {\n logger.debug('No branchList');\n return;\n }\n // TODO: types (#22198)\n let renovateBranches = getBranchList().filter(\n (branchName) =>\n branchName.startsWith(config.branchPrefix!) &&\n branchName !== getReconfigureBranchName(config.branchPrefix!),\n );\n if (!renovateBranches?.length) {\n logger.debug('No renovate branches found');\n return;\n }\n logger.debug(\n {\n branchList: branchList?.sort(),\n renovateBranches: renovateBranches?.sort(),\n },\n 'Branch lists',\n );\n // TODO: types (#22198)\n const lockFileBranch = `${config.branchPrefix!}lock-file-maintenance`;\n renovateBranches = renovateBranches.filter(\n (branch) => branch !== lockFileBranch,\n );\n const remainingBranches = renovateBranches.filter(\n (branch) => !branchList.includes(branch),\n );\n logger.debug(`remainingBranches=${String(remainingBranches)}`);\n if (remainingBranches.length === 0) {\n logger.debug('No branches to clean up');\n return;\n }\n\n await cleanUpBranches(config, remainingBranches);\n}\n"]}
1
+ {"version":3,"file":"prune.js","sourceRoot":"","sources":["../../../../lib/workers/repository/finalize/prune.ts"],"names":[],"mappings":";;AAgJA,gDA4CC;;AA5LD,kEAAkC;AAClC,mDAAsD;AAEtD,sEAAuE;AACvE,4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AE,IAAI,EAAE;KAC3C,EACD,cAAc,CACf,CAAC;IACF,uBAAuB;IACvB,MAAM,cAAc,GAAG,GAAG,MAAM,CAAC,YAAa,uBAAuB,CAAC;IACtE,gBAAgB,GAAG,gBAAgB,CAAC,MAAM,CACxC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,KAAK,cAAc,CACtC,CAAC;IACF,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,MAAM,CAC/C,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CACzC,CAAC;IACF,eAAM,CAAC,KAAK,CAAC,qBAAqB,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;IAC/D,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,eAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACxC,OAAO;IACT,CAAC;IAED,MAAM,eAAe,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { GlobalConfig } from '../../../config/global';\nimport type { RenovateConfig } from '../../../config/types';\nimport { REPOSITORY_CHANGED } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { platform } from '../../../modules/platform';\nimport { ensureComment } from '../../../modules/platform/comment';\nimport { scm } from '../../../modules/platform/scm';\nimport { getBranchList, setUserRepoConfig } from '../../../util/git';\nimport { escapeRegExp, regEx } from '../../../util/regex';\nimport { uniqueStrings } from '../../../util/string';\nimport { getReconfigureBranchName } from '../reconfigure/utils';\n\nasync function cleanUpBranches(\n config: RenovateConfig,\n remainingBranches: string[],\n): Promise<void> {\n if (!config.pruneStaleBranches) {\n logger.debug('Branch/PR pruning is disabled - skipping');\n return;\n }\n // set Git author in case the repository is not initialized yet\n setUserRepoConfig(config);\n\n // calculate regex to extract base branch from branch name\n const baseBranchRe = calculateBaseBranchRegex(config);\n\n for (const branchName of remainingBranches) {\n try {\n // get base branch from branch name if base branches are configured\n // use default branch if no base branches are configured\n // use defaul branch name if no match (can happen when base branches are configured later)\n const baseBranch =\n baseBranchRe?.exec(branchName)?.[1] ?? config.defaultBranch!;\n const pr = await platform.findPr({\n branchName,\n state: 'open',\n targetBranch: baseBranch,\n });\n const branchIsModified = await scm.isBranchModified(\n branchName,\n baseBranch,\n );\n if (pr) {\n if (branchIsModified) {\n logger.debug(\n { prNo: pr.number, prTitle: pr.title },\n 'Branch is modified - skipping PR autoclosing',\n );\n if (GlobalConfig.get('dryRun')) {\n logger.info(`DRY-RUN: Would update PR title and ensure comment.`);\n } else {\n if (!pr.title.endsWith('- abandoned')) {\n const newPrTitle = pr.title + ' - abandoned';\n await platform.updatePr({\n number: pr.number,\n prTitle: newPrTitle,\n state: 'open',\n });\n }\n\n await ensureComment({\n number: pr.number,\n topic: 'Autoclosing Skipped',\n content:\n 'This PR has been flagged for autoclosing. However, it is being skipped due to the branch being already modified. Please close/delete it manually or report a bug if you think this is in error.',\n });\n }\n } else if (GlobalConfig.get('dryRun')) {\n logger.info(\n { prNo: pr.number, prTitle: pr.title },\n `DRY-RUN: Would autoclose PR`,\n );\n } else {\n logger.info(\n { branchName, prNo: pr.number, prTitle: pr.title },\n 'Autoclosing PR',\n );\n let newPrTitle = pr.title;\n if (!pr.title.endsWith('- autoclosed')) {\n newPrTitle += ' - autoclosed';\n }\n await platform.updatePr({\n number: pr.number,\n prTitle: newPrTitle,\n state: 'closed',\n });\n await scm.deleteBranch(branchName);\n }\n } else if (branchIsModified) {\n logger.debug(\n { branch: branchName },\n 'Orphan Branch is modified - skipping branch deletion',\n );\n } else if (GlobalConfig.get('dryRun')) {\n logger.info(`DRY-RUN: Would delete orphan branch ${branchName}`);\n } else {\n logger.info({ branch: branchName }, `Deleting orphan branch`);\n await scm.deleteBranch(branchName);\n }\n } catch (err) /* istanbul ignore next */ {\n if (err.message === 'config-validation') {\n logger.debug(\n 'Cannot prune branch due to collision between tags and branch names',\n );\n } else if (err.message?.includes(\"bad revision 'origin/\")) {\n logger.debug(\n { branchName },\n 'Branch not found on origin when attempting to prune',\n );\n } else if (err.message !== REPOSITORY_CHANGED) {\n logger.warn({ err, branch: branchName }, 'Error pruning branch');\n }\n }\n }\n}\n\n/**\n * Calculates a {RegExp} to extract the base branch from a branch name if base branch patterns is configured.\n * @param config Renovate configuration\n */\nfunction calculateBaseBranchRegex(config: RenovateConfig): RegExp | null {\n if (!config.baseBranchPatterns?.length) {\n return null;\n }\n\n // calculate possible branch prefixes and escape for regex\n const branchPrefixes = [config.branchPrefix, config.branchPrefixOld]\n .filter(is.nonEmptyStringAndNotWhitespace)\n .filter(uniqueStrings)\n .map(escapeRegExp);\n\n // calculate possible base branches and escape for regex\n // if baseBranchPatterns is configured, baseBranches will be defined too\n const baseBranches = config.baseBranches!.map(escapeRegExp);\n\n // create regex to extract base branche from branch name\n const baseBranchRe = regEx(\n `^(?:${branchPrefixes.join('|')})(${baseBranches.join('|')})-`,\n );\n\n return baseBranchRe;\n}\n\nexport async function pruneStaleBranches(\n config: RenovateConfig,\n branchList: string[] | null | undefined,\n): Promise<void> {\n logger.debug('Removing any stale branches');\n logger.trace({ config }, `pruneStaleBranches`);\n // TODO: types (#22198)\n logger.debug(`config.repoIsOnboarded=${config.repoIsOnboarded!}`);\n if (!branchList) {\n logger.debug('No branchList');\n return;\n }\n // TODO: types (#22198)\n let renovateBranches = getBranchList().filter(\n (branchName) =>\n branchName.startsWith(config.branchPrefix!) &&\n branchName !== getReconfigureBranchName(config.branchPrefix!),\n );\n if (!renovateBranches?.length) {\n logger.debug('No renovate branches found');\n return;\n }\n logger.debug(\n {\n branchList: branchList?.sort(),\n renovateBranches: renovateBranches?.sort(),\n },\n 'Branch lists',\n );\n // TODO: types (#22198)\n const lockFileBranch = `${config.branchPrefix!}lock-file-maintenance`;\n renovateBranches = renovateBranches.filter(\n (branch) => branch !== lockFileBranch,\n );\n const remainingBranches = renovateBranches.filter(\n (branch) => !branchList.includes(branch),\n );\n logger.debug(`remainingBranches=${String(remainingBranches)}`);\n if (remainingBranches.length === 0) {\n logger.debug('No branches to clean up');\n return;\n }\n\n await cleanUpBranches(config, remainingBranches);\n}\n"]}
@@ -35,30 +35,51 @@ const result_1 = require("./result");
35
35
  // istanbul ignore next
36
36
  async function renovateRepository(repoConfig, canRetry = true) {
37
37
  (0, split_1.splitInit)();
38
- let config = global_1.GlobalConfig.set((0, secrets_1.applySecretsAndVariablesToConfig)({
39
- config: repoConfig,
40
- deleteVariables: false,
41
- deleteSecrets: false,
42
- }));
43
- await (0, docker_1.removeDanglingContainers)();
44
- (0, logger_1.setMeta)({ repository: config.repository });
45
- logger_1.logger.info({ renovateVersion: expose_cjs_1.pkg.version }, 'Repository started');
46
- logger_1.logger.trace({ config });
47
38
  let repoResult;
48
- queue.clear();
49
- throttle.clear();
50
- const localDir = global_1.GlobalConfig.get('localDir');
39
+ const { config, localDir, errorRes } = await (0, instrumentation_1.instrument)('init', async () => {
40
+ let errorRes;
41
+ let config = global_1.GlobalConfig.set((0, secrets_1.applySecretsAndVariablesToConfig)({
42
+ config: repoConfig,
43
+ deleteVariables: false,
44
+ deleteSecrets: false,
45
+ }));
46
+ await (0, docker_1.removeDanglingContainers)();
47
+ (0, logger_1.setMeta)({ repository: config.repository });
48
+ logger_1.logger.info({ renovateVersion: expose_cjs_1.pkg.version }, 'Repository started');
49
+ logger_1.logger.trace({ config });
50
+ queue.clear();
51
+ throttle.clear();
52
+ const localDir = global_1.GlobalConfig.get('localDir');
53
+ try {
54
+ await fs_extra_1.default.ensureDir(localDir);
55
+ logger_1.logger.debug('Using localDir: ' + localDir);
56
+ config = await (0, init_1.initRepo)(config);
57
+ (0, split_1.addSplit)('init');
58
+ }
59
+ catch (err) /* istanbul ignore next */ {
60
+ (0, logger_1.setMeta)({ repository: config.repository });
61
+ errorRes = await (0, error_1.default)(config, err);
62
+ const pruneWhenErrors = [
63
+ error_messages_1.REPOSITORY_DISABLED_BY_CONFIG,
64
+ error_messages_1.REPOSITORY_FORKED,
65
+ error_messages_1.REPOSITORY_NO_CONFIG,
66
+ ];
67
+ if (pruneWhenErrors.includes(errorRes)) {
68
+ await (0, prune_1.pruneStaleBranches)(config, []);
69
+ }
70
+ repoResult = (0, result_1.processResult)(config, errorRes);
71
+ }
72
+ return { config, localDir, errorRes };
73
+ });
51
74
  try {
52
- await fs_extra_1.default.ensureDir(localDir);
53
- logger_1.logger.debug('Using localDir: ' + localDir);
54
- config = await (0, init_1.initRepo)(config);
55
- (0, split_1.addSplit)('init');
75
+ // only continue if init stage was successful
76
+ if (errorRes) {
77
+ throw new Error(errorRes);
78
+ }
56
79
  const performExtract = config.repoIsOnboarded ||
57
80
  !common_2.OnboardingState.onboardingCacheValid ||
58
81
  common_2.OnboardingState.prUpdateRequested;
59
- const extractResult = performExtract
60
- ? await (0, instrumentation_1.instrument)('extract', () => (0, process_1.extractDependencies)(config))
61
- : emptyExtract(config);
82
+ const extractResult = await (0, instrumentation_1.instrument)('extract', () => performExtract ? (0, process_1.extractDependencies)(config) : emptyExtract(config));
62
83
  (0, reporting_1.addExtractionStats)(config, extractResult);
63
84
  const { branches, branchList, packageFiles } = extractResult;
64
85
  if (config.semanticCommits === 'auto') {
@@ -129,7 +150,15 @@ async function renovateRepository(repoConfig, canRetry = true) {
129
150
  stats_1.ObsoleteCacheHitLogger.report();
130
151
  stats_1.AbandonedPackageStats.report();
131
152
  const cloned = (0, git_1.isCloned)();
132
- logger_1.logger.info({ cloned, durationMs: splits.total }, 'Repository finished');
153
+ /* v8 ignore next 11 -- coverage not required of these `undefined` checks, as we're happy receiving an `undefined` in the logs */
154
+ logger_1.logger.info({
155
+ cloned,
156
+ durationMs: splits.total,
157
+ result: repoResult?.res,
158
+ status: repoResult?.status,
159
+ enabled: repoResult?.enabled,
160
+ onboarded: repoResult?.onboarded,
161
+ }, 'Repository finished');
133
162
  (0, remap_1.resetRepositoryLogLevelRemaps)();
134
163
  return repoResult;
135
164
  }
@@ -1 +1 @@
1
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AI,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,qBAAqB,CAAC,CAAC;IACzE,IAAA,qCAA6B,GAAE,CAAC;IAChC,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,sDAAsD;AACtD,SAAS,YAAY,CAAC,MAAsB;IAC1C,OAAO;QACL,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,CAAC,MAAM,CAAC,gBAAiB,CAAC,EAAE,0BAA0B;QAClE,YAAY,EAAE,EAAE;KACjB,CAAC;AACJ,CAAC;AAED,SAAgB,uBAAuB,CAAC,UAA8B;IACpE,MAAM,YAAY,GAAG,IAAA,4BAAmB,EAAC,UAAU,CAAC,CAAC;IACrD,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC;QACtB,eAAM,CAAC,KAAK,CACV,EAAE,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,EAC1C,qBAAqB,CACtB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import fs from 'fs-extra';\nimport { GlobalConfig } from '../../config/global';\nimport { applySecretsAndVariablesToConfig } from '../../config/secrets';\nimport type { RenovateConfig } from '../../config/types';\nimport {\n REPOSITORY_DISABLED_BY_CONFIG,\n REPOSITORY_FORKED,\n REPOSITORY_NO_CONFIG,\n} from '../../constants/error-messages';\nimport { pkg } from '../../expose.cjs';\nimport { instrument } from '../../instrumentation';\nimport { addExtractionStats } from '../../instrumentation/reporting';\nimport { logger, setMeta } from '../../logger';\nimport { resetRepositoryLogLevelRemaps } from '../../logger/remap';\nimport { removeDanglingContainers } from '../../util/exec/docker';\nimport { deleteLocalFile, privateCacheDir } from '../../util/fs';\nimport { isCloned } from '../../util/git';\nimport { detectSemanticCommits } from '../../util/git/semantic';\nimport * as queue from '../../util/http/queue';\nimport * as throttle from '../../util/http/throttle';\nimport { addSplit, getSplits, splitInit } from '../../util/split';\nimport {\n AbandonedPackageStats,\n DatasourceCacheStats,\n HttpCacheStats,\n HttpStats,\n LookupStats,\n ObsoleteCacheHitLogger,\n PackageCacheStats,\n} from '../../util/stats';\nimport { setBranchCache } from './cache';\nimport { extractRepoProblems } from './common';\nimport { configMigration } from './config-migration';\nimport { ensureDependencyDashboard } from './dependency-dashboard';\nimport handleError from './error';\nimport { finalizeRepo } from './finalize';\nimport { pruneStaleBranches } from './finalize/prune';\nimport { initRepo } from './init';\nimport { OnboardingState } from './onboarding/common';\nimport { ensureOnboardingPr } from './onboarding/pr';\nimport { extractDependencies, updateRepo } from './process';\nimport type { ExtractResult } from './process/extract-update';\nimport type { ProcessResult } from './result';\nimport { processResult } from './result';\n\n// istanbul ignore next\nexport async function renovateRepository(\n repoConfig: RenovateConfig,\n canRetry = true,\n): Promise<ProcessResult | undefined> {\n splitInit();\n let config = GlobalConfig.set(\n applySecretsAndVariablesToConfig({\n config: repoConfig,\n deleteVariables: false,\n deleteSecrets: false,\n }),\n );\n await removeDanglingContainers();\n setMeta({ repository: config.repository });\n logger.info({ renovateVersion: pkg.version }, 'Repository started');\n logger.trace({ config });\n let repoResult: ProcessResult | undefined;\n queue.clear();\n throttle.clear();\n const localDir = GlobalConfig.get('localDir')!;\n try {\n await fs.ensureDir(localDir);\n logger.debug('Using localDir: ' + localDir);\n config = await initRepo(config);\n addSplit('init');\n const performExtract =\n config.repoIsOnboarded! ||\n !OnboardingState.onboardingCacheValid ||\n OnboardingState.prUpdateRequested;\n const extractResult = performExtract\n ? await instrument('extract', () => extractDependencies(config))\n : emptyExtract(config);\n addExtractionStats(config, extractResult);\n\n const { branches, branchList, packageFiles } = extractResult;\n\n if (config.semanticCommits === 'auto') {\n config.semanticCommits = await detectSemanticCommits();\n }\n\n if (\n GlobalConfig.get('dryRun') !== 'lookup' &&\n GlobalConfig.get('dryRun') !== 'extract'\n ) {\n await instrument('onboarding', () =>\n ensureOnboardingPr(config, packageFiles, branches),\n );\n addSplit('onboarding');\n const res = await instrument('update', () =>\n updateRepo(config, branches),\n );\n setMeta({ repository: config.repository });\n addSplit('update');\n if (performExtract) {\n await setBranchCache(branches); // update branch cache if performed extraction\n }\n if (res === 'automerged') {\n if (canRetry) {\n logger.info('Restarting repository job after automerge result');\n const recursiveRes = await renovateRepository(repoConfig, false);\n return recursiveRes;\n }\n logger.debug(`Automerged but already retried once`);\n } else {\n const configMigrationRes = await configMigration(config, branchList);\n await ensureDependencyDashboard(\n config,\n branches,\n packageFiles,\n configMigrationRes,\n );\n }\n await finalizeRepo(config, branchList, repoConfig);\n // TODO #22198\n repoResult = processResult(config, res!);\n }\n printRepositoryProblems(config.repository);\n } catch (err) /* istanbul ignore next */ {\n setMeta({ repository: config.repository });\n const errorRes = await handleError(config, err);\n const pruneWhenErrors = [\n REPOSITORY_DISABLED_BY_CONFIG,\n REPOSITORY_FORKED,\n REPOSITORY_NO_CONFIG,\n ];\n if (pruneWhenErrors.includes(errorRes)) {\n await pruneStaleBranches(config, []);\n }\n repoResult = processResult(config, errorRes);\n }\n if (localDir && !repoConfig.persistRepoData) {\n try {\n await deleteLocalFile('.');\n } catch (err) /* istanbul ignore if */ {\n logger.warn({ err }, 'localDir deletion error');\n }\n }\n try {\n await fs.remove(privateCacheDir());\n } catch (err) /* istanbul ignore if */ {\n logger.warn({ err }, 'privateCacheDir deletion error');\n }\n const splits = getSplits();\n logger.debug(splits, 'Repository timing splits (milliseconds)');\n PackageCacheStats.report();\n DatasourceCacheStats.report();\n HttpStats.report();\n HttpCacheStats.report();\n LookupStats.report();\n ObsoleteCacheHitLogger.report();\n AbandonedPackageStats.report();\n const cloned = isCloned();\n logger.info({ cloned, durationMs: splits.total }, 'Repository finished');\n resetRepositoryLogLevelRemaps();\n return repoResult;\n}\n\n// istanbul ignore next: renovateRepository is ignored\nfunction emptyExtract(config: RenovateConfig): ExtractResult {\n return {\n branches: [],\n branchList: [config.onboardingBranch!], // to prevent auto closing\n packageFiles: {},\n };\n}\n\nexport function printRepositoryProblems(repository: string | undefined): void {\n const repoProblems = extractRepoProblems(repository);\n if (repoProblems.size) {\n logger.debug(\n { repoProblems: Array.from(repoProblems) },\n 'repository problems',\n );\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/workers/repository/index.ts"],"names":[],"mappings":";;AA8CA,gDAgKC;AAWD,0DAQC;;AAjOD,gEAA0B;AAC1B,gDAAmD;AACnD,kDAAwE;AAExE,mEAIwC;AACxC,iDAAuC;AACvC,2DAAmD;AACnD,+DAAqE;AACrE,yCAA+C;AAC/C,8CAAmE;AACnE,mDAAkE;AAClE,sCAAiE;AACjE,wCAA0C;AAC1C,sDAAgE;AAChE,qEAA+C;AAC/C,2EAAqD;AACrD,4CAAkE;AAClE,4CAQ0B;AAC1B,mCAAyC;AACzC,qCAA+C;AAC/C,yDAAqD;AACrD,iEAAmE;AACnE,4DAAkC;AAClC,yCAA0C;AAC1C,4CAAsD;AACtD,iCAAkC;AAClC,gDAAsD;AACtD,wCAAqD;AACrD,uCAA4D;AAG5D,qCAAyC;AAEzC,uBAAuB;AAChB,KAAK,UAAU,kBAAkB,CACtC,UAA0B,EAC1B,QAAQ,GAAG,IAAI;IAEf,IAAA,iBAAS,GAAE,CAAC;IAEZ,IAAI,UAAqC,CAAC;IAC1C,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAA,4BAAU,EACrD,MAAM,EACN,KAAK,IAIF,EAAE;QACH,IAAI,QAA4B,CAAC;QACjC,IAAI,MAAM,GAAG,qBAAY,CAAC,GAAG,CAC3B,IAAA,0CAAgC,EAAC;YAC/B,MAAM,EAAE,UAAU;YAClB,eAAe,EAAE,KAAK;YACtB,aAAa,EAAE,KAAK;SACrB,CAAC,CACH,CAAC;QACF,MAAM,IAAA,iCAAwB,GAAE,CAAC;QACjC,IAAA,gBAAO,EAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QAC3C,eAAM,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,gBAAG,C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UAAU,CAAC;AACpB,CAAC;AAED,sDAAsD;AACtD,SAAS,YAAY,CAAC,MAAsB;IAC1C,OAAO;QACL,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,CAAC,MAAM,CAAC,gBAAiB,CAAC,EAAE,0BAA0B;QAClE,YAAY,EAAE,EAAE;KACjB,CAAC;AACJ,CAAC;AAED,SAAgB,uBAAuB,CAAC,UAA8B;IACpE,MAAM,YAAY,GAAG,IAAA,4BAAmB,EAAC,UAAU,CAAC,CAAC;IACrD,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC;QACtB,eAAM,CAAC,KAAK,CACV,EAAE,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,EAC1C,qBAAqB,CACtB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import fs from 'fs-extra';\nimport { GlobalConfig } from '../../config/global';\nimport { applySecretsAndVariablesToConfig } from '../../config/secrets';\nimport type { RenovateConfig } from '../../config/types';\nimport {\n REPOSITORY_DISABLED_BY_CONFIG,\n REPOSITORY_FORKED,\n REPOSITORY_NO_CONFIG,\n} from '../../constants/error-messages';\nimport { pkg } from '../../expose.cjs';\nimport { instrument } from '../../instrumentation';\nimport { addExtractionStats } from '../../instrumentation/reporting';\nimport { logger, setMeta } from '../../logger';\nimport { resetRepositoryLogLevelRemaps } from '../../logger/remap';\nimport { removeDanglingContainers } from '../../util/exec/docker';\nimport { deleteLocalFile, privateCacheDir } from '../../util/fs';\nimport { isCloned } from '../../util/git';\nimport { detectSemanticCommits } from '../../util/git/semantic';\nimport * as queue from '../../util/http/queue';\nimport * as throttle from '../../util/http/throttle';\nimport { addSplit, getSplits, splitInit } from '../../util/split';\nimport {\n AbandonedPackageStats,\n DatasourceCacheStats,\n HttpCacheStats,\n HttpStats,\n LookupStats,\n ObsoleteCacheHitLogger,\n PackageCacheStats,\n} from '../../util/stats';\nimport { setBranchCache } from './cache';\nimport { extractRepoProblems } from './common';\nimport { configMigration } from './config-migration';\nimport { ensureDependencyDashboard } from './dependency-dashboard';\nimport handleError from './error';\nimport { finalizeRepo } from './finalize';\nimport { pruneStaleBranches } from './finalize/prune';\nimport { initRepo } from './init';\nimport { OnboardingState } from './onboarding/common';\nimport { ensureOnboardingPr } from './onboarding/pr';\nimport { extractDependencies, updateRepo } from './process';\nimport type { ExtractResult } from './process/extract-update';\nimport type { ProcessResult } from './result';\nimport { processResult } from './result';\n\n// istanbul ignore next\nexport async function renovateRepository(\n repoConfig: RenovateConfig,\n canRetry = true,\n): Promise<ProcessResult | undefined> {\n splitInit();\n\n let repoResult: ProcessResult | undefined;\n const { config, localDir, errorRes } = await instrument(\n 'init',\n async (): Promise<{\n config: RenovateConfig;\n localDir: string;\n errorRes?: string;\n }> => {\n let errorRes: string | undefined;\n let config = GlobalConfig.set(\n applySecretsAndVariablesToConfig({\n config: repoConfig,\n deleteVariables: false,\n deleteSecrets: false,\n }),\n );\n await removeDanglingContainers();\n setMeta({ repository: config.repository });\n logger.info({ renovateVersion: pkg.version }, 'Repository started');\n logger.trace({ config });\n queue.clear();\n throttle.clear();\n const localDir = GlobalConfig.get('localDir')!;\n\n try {\n await fs.ensureDir(localDir);\n logger.debug('Using localDir: ' + localDir);\n config = await initRepo(config);\n addSplit('init');\n } catch (err) /* istanbul ignore next */ {\n setMeta({ repository: config.repository });\n errorRes = await handleError(config, err);\n const pruneWhenErrors = [\n REPOSITORY_DISABLED_BY_CONFIG,\n REPOSITORY_FORKED,\n REPOSITORY_NO_CONFIG,\n ];\n if (pruneWhenErrors.includes(errorRes)) {\n await pruneStaleBranches(config, []);\n }\n repoResult = processResult(config, errorRes);\n }\n\n return { config, localDir, errorRes };\n },\n );\n\n try {\n // only continue if init stage was successful\n if (errorRes) {\n throw new Error(errorRes);\n }\n\n const performExtract =\n config.repoIsOnboarded! ||\n !OnboardingState.onboardingCacheValid ||\n OnboardingState.prUpdateRequested;\n const extractResult = await instrument('extract', () =>\n performExtract ? extractDependencies(config) : emptyExtract(config),\n );\n addExtractionStats(config, extractResult);\n\n const { branches, branchList, packageFiles } = extractResult;\n\n if (config.semanticCommits === 'auto') {\n config.semanticCommits = await detectSemanticCommits();\n }\n\n if (\n GlobalConfig.get('dryRun') !== 'lookup' &&\n GlobalConfig.get('dryRun') !== 'extract'\n ) {\n await instrument('onboarding', () =>\n ensureOnboardingPr(config, packageFiles, branches),\n );\n addSplit('onboarding');\n const res = await instrument('update', () =>\n updateRepo(config, branches),\n );\n setMeta({ repository: config.repository });\n addSplit('update');\n if (performExtract) {\n await setBranchCache(branches); // update branch cache if performed extraction\n }\n if (res === 'automerged') {\n if (canRetry) {\n logger.info('Restarting repository job after automerge result');\n const recursiveRes = await renovateRepository(repoConfig, false);\n return recursiveRes;\n }\n logger.debug(`Automerged but already retried once`);\n } else {\n const configMigrationRes = await configMigration(config, branchList);\n await ensureDependencyDashboard(\n config,\n branches,\n packageFiles,\n configMigrationRes,\n );\n }\n await finalizeRepo(config, branchList, repoConfig);\n // TODO #22198\n repoResult = processResult(config, res!);\n }\n printRepositoryProblems(config.repository);\n } catch (err) /* istanbul ignore next */ {\n setMeta({ repository: config.repository });\n const errorRes = await handleError(config, err);\n const pruneWhenErrors = [\n REPOSITORY_DISABLED_BY_CONFIG,\n REPOSITORY_FORKED,\n REPOSITORY_NO_CONFIG,\n ];\n if (pruneWhenErrors.includes(errorRes)) {\n await pruneStaleBranches(config, []);\n }\n repoResult = processResult(config, errorRes);\n }\n if (localDir && !repoConfig.persistRepoData) {\n try {\n await deleteLocalFile('.');\n } catch (err) /* istanbul ignore if */ {\n logger.warn({ err }, 'localDir deletion error');\n }\n }\n try {\n await fs.remove(privateCacheDir());\n } catch (err) /* istanbul ignore if */ {\n logger.warn({ err }, 'privateCacheDir deletion error');\n }\n const splits = getSplits();\n logger.debug(splits, 'Repository timing splits (milliseconds)');\n PackageCacheStats.report();\n DatasourceCacheStats.report();\n HttpStats.report();\n HttpCacheStats.report();\n LookupStats.report();\n ObsoleteCacheHitLogger.report();\n AbandonedPackageStats.report();\n const cloned = isCloned();\n /* v8 ignore next 11 -- coverage not required of these `undefined` checks, as we're happy receiving an `undefined` in the logs */\n logger.info(\n {\n cloned,\n durationMs: splits.total,\n result: repoResult?.res,\n status: repoResult?.status,\n enabled: repoResult?.enabled,\n onboarded: repoResult?.onboarded,\n },\n 'Repository finished',\n );\n resetRepositoryLogLevelRemaps();\n return repoResult;\n}\n\n// istanbul ignore next: renovateRepository is ignored\nfunction emptyExtract(config: RenovateConfig): ExtractResult {\n return {\n branches: [],\n branchList: [config.onboardingBranch!], // to prevent auto closing\n packageFiles: {},\n };\n}\n\nexport function printRepositoryProblems(repository: string | undefined): void {\n const repoProblems = extractRepoProblems(repository);\n if (repoProblems.size) {\n logger.debug(\n { repoProblems: Array.from(repoProblems) },\n 'repository problems',\n );\n }\n}\n"]}
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
6
6
  const dequal_1 = require("dequal");
7
7
  const config_1 = require("../../../config");
8
+ const app_strings_1 = require("../../../config/app-strings");
8
9
  const decrypt_1 = require("../../../config/decrypt");
9
10
  const parse_1 = require("../../../config/parse");
10
11
  const presets_1 = require("../../../config/presets");
@@ -69,6 +70,12 @@ async function mergeInheritedConfig(config) {
69
70
  if (res.warnings.length) {
70
71
  logger_1.logger.warn({ warnings: res.warnings }, 'Found warnings in inherited configuration.');
71
72
  }
73
+ // set user config file name here
74
+ if (is_1.default.nonEmptyArray(inheritedConfig.configFileNames)) {
75
+ logger_1.logger.debug({ configFileNames: inheritedConfig.configFileNames }, 'Updated the config filenames list');
76
+ (0, app_strings_1.setUserConfigFileNames)(inheritedConfig.configFileNames);
77
+ delete config.configFileNames;
78
+ }
72
79
  let decryptedConfig = await (0, decrypt_1.decryptConfig)(inheritedConfig, config.repository);
73
80
  let filteredConfig = (0, config_1.removeGlobalConfig)(decryptedConfig, true);
74
81
  if (!(0, dequal_1.dequal)(decryptedConfig, filteredConfig)) {
@@ -1 +1 @@
1
- {"version":3,"file":"inherited.js","sourceRoot":"","sources":["../../../../lib/workers/repository/init/inherited.ts"],"names":[],"mappings":";;AAqBA,oDA8IC;;AAnKD,kEAAkC;AAClC,mCAAgC;AAChC,4CAAuE;AACvE,qDAAwD;AACxD,iDAAwD;AACxD,qDAA+D;AAC/D,qDAA2E;AAE3E,2DAA4D;AAC5D,sEAI2C;AAC3C,4CAAyC;AACzC,wDAAqD;AACrD,4EAAsD;AACtD,wEAAkD;AAClD,8EAAwD;AACxD,yEAAmD;AAE5C,KAAK,UAAU,oBAAoB,CACxC,MAAsB;IAEtB,+CAA+C;IAC/C,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC;QAChD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IACE,CAAC,YAAE,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC;QACxC,CAAC,YAAE,CAAC,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,EACxC,CAAC;QACD,8CAA8C;QAC9C,eAAM,CAAC,KAAK,CACV;YACE,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;YACnD,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;SACpD,EACD,2BAA2B,CAC5B,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,cAAc,GAAG;QACrB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;KAC9B,CAAC;IACF,MAAM,qBAAqB,GAAG,QAAQ,CAAC,OAAO,CAC5C,MAAM,CAAC,qBAAqB,EAC5B,cAAc,EACd,KAAK,CACN,CAAC;IACF,eAAM,CAAC,KAAK,CACV,EAAE,cAAc,EAAE,qBAAqB,EAAE,EACzC,wCAAwC,CACzC,CAAC;IACF,eAAM,CAAC,KAAK,CACV,sCAAsC,MAAM,CAAC,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AC,CAAC;QAC9C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC;gBACH,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACtB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,uBAAuB;gBACvB,eAAM,CAAC,IAAI,CACT,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EACrB,oCAAoC,CACrC,CAAC;YACJ,CAAC;QACH,CAAC;QACD,oCAAoC;QACpC,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,QAAQ,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC,SAAS,CAAC;IAC1B,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { dequal } from 'dequal';\nimport { mergeChildConfig, removeGlobalConfig } from '../../../config';\nimport { decryptConfig } from '../../../config/decrypt';\nimport { parseFileConfig } from '../../../config/parse';\nimport { resolveConfigPresets } from '../../../config/presets';\nimport { applySecretsAndVariablesToConfig } from '../../../config/secrets';\nimport type { RenovateConfig } from '../../../config/types';\nimport { validateConfig } from '../../../config/validation';\nimport {\n CONFIG_INHERIT_NOT_FOUND,\n CONFIG_INHERIT_PARSE_ERROR,\n CONFIG_VALIDATION,\n} from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { platform } from '../../../modules/platform';\nimport * as hostRules from '../../../util/host-rules';\nimport * as queue from '../../../util/http/queue';\nimport * as throttle from '../../../util/http/throttle';\nimport * as template from '../../../util/template';\n\nexport async function mergeInheritedConfig(\n config: RenovateConfig,\n): Promise<RenovateConfig> {\n // typescript doesn't know that repo is defined\n if (!config.repository || !config.inheritConfig) {\n return config;\n }\n if (\n !is.string(config.inheritConfigRepoName) ||\n !is.string(config.inheritConfigFileName)\n ) {\n // Config validation should prevent this error\n logger.error(\n {\n inheritConfigRepoName: config.inheritConfigRepoName,\n inheritConfigFileName: config.inheritConfigFileName,\n },\n 'Invalid inherited config.',\n );\n return config;\n }\n const templateConfig = {\n topLevelOrg: config.topLevelOrg,\n parentOrg: config.parentOrg,\n repository: config.repository,\n };\n const inheritConfigRepoName = template.compile(\n config.inheritConfigRepoName,\n templateConfig,\n false,\n );\n logger.trace(\n { templateConfig, inheritConfigRepoName },\n 'Compiled inheritConfigRepoName result.',\n );\n logger.debug(\n `Checking for inherited config file ${config.inheritConfigFileName} in repo ${inheritConfigRepoName}.`,\n );\n let configFileRaw: string | null = null;\n try {\n configFileRaw = await platform.getRawFile(\n config.inheritConfigFileName,\n inheritConfigRepoName,\n );\n } catch (err) {\n if (config.inheritConfigStrict) {\n logger.debug({ err }, 'Error getting inherited config.');\n throw new Error(CONFIG_INHERIT_NOT_FOUND);\n }\n logger.trace({ err }, `Error getting inherited config.`);\n }\n if (!configFileRaw) {\n logger.debug(`No inherited config found in ${inheritConfigRepoName}.`);\n return config;\n }\n const parseResult = parseFileConfig(\n config.inheritConfigFileName,\n configFileRaw,\n );\n if (!parseResult.success) {\n logger.debug({ parseResult }, 'Error parsing inherited config.');\n throw new Error(CONFIG_INHERIT_PARSE_ERROR);\n }\n const inheritedConfig = parseResult.parsedContents as RenovateConfig;\n logger.debug({ config: inheritedConfig }, `Inherited config`);\n const res = await validateConfig('inherit', inheritedConfig);\n if (res.errors.length) {\n logger.warn(\n { errors: res.errors },\n 'Found errors in inherited configuration.',\n );\n throw new Error(CONFIG_VALIDATION);\n }\n if (res.warnings.length) {\n logger.warn(\n { warnings: res.warnings },\n 'Found warnings in inherited configuration.',\n );\n }\n\n let decryptedConfig = await decryptConfig(inheritedConfig, config.repository);\n\n let filteredConfig = removeGlobalConfig(decryptedConfig, true);\n if (!dequal(decryptedConfig, filteredConfig)) {\n logger.debug(\n { inheritedConfig: decryptedConfig, filteredConfig },\n 'Removed global config from inherited config.',\n );\n }\n\n if (is.nullOrUndefined(filteredConfig.extends)) {\n filteredConfig = applySecretsAndVariablesToConfig({\n config: filteredConfig,\n secrets: config.secrets ?? {},\n variables: config.variables ?? {},\n });\n setInheritedHostRules(filteredConfig);\n return mergeChildConfig(config, filteredConfig);\n }\n\n logger.debug('Resolving presets found in inherited config');\n const resolvedConfig = await resolveConfigPresets(\n filteredConfig,\n config,\n config.ignorePresets,\n );\n logger.trace({ config: resolvedConfig }, 'Resolved inherited config');\n\n const validationRes = await validateConfig('inherit', resolvedConfig);\n if (validationRes.errors.length) {\n logger.warn(\n { errors: validationRes.errors },\n 'Found errors in presets inside the inherited configuration.',\n );\n throw new Error(CONFIG_VALIDATION);\n }\n if (validationRes.warnings.length) {\n logger.warn(\n { warnings: validationRes.warnings },\n 'Found warnings in presets inside the inherited configuration.',\n );\n }\n\n // decrypt again, as resolved presets could contain encrypted values\n decryptedConfig = await decryptConfig(resolvedConfig, config.repository);\n\n // remove global config options once again, as resolved presets could have added some\n filteredConfig = removeGlobalConfig(decryptedConfig, true);\n if (!dequal(decryptedConfig, filteredConfig)) {\n logger.debug(\n { inheritedConfig: decryptedConfig, filteredConfig },\n 'Removed global config from inherited config presets.',\n );\n }\n\n filteredConfig = applySecretsAndVariablesToConfig({\n config: filteredConfig,\n secrets: config.secrets ?? {},\n variables: config.variables ?? {},\n });\n setInheritedHostRules(filteredConfig);\n return mergeChildConfig(config, filteredConfig);\n}\n\nfunction setInheritedHostRules(config: RenovateConfig): void {\n if (config.hostRules) {\n logger.debug('Setting hostRules from config');\n for (const rule of config.hostRules) {\n try {\n hostRules.add(rule);\n } catch (err) {\n // istanbul ignore next\n logger.warn(\n { err, config: rule },\n 'Error setting hostRule from config',\n );\n }\n }\n // host rules can change concurrency\n queue.clear();\n throttle.clear();\n delete config.hostRules;\n }\n}\n"]}
1
+ {"version":3,"file":"inherited.js","sourceRoot":"","sources":["../../../../lib/workers/repository/init/inherited.ts"],"names":[],"mappings":";;AAsBA,oDAwJC;;AA9KD,kEAAkC;AAClC,mCAAgC;AAChC,4CAAuE;AACvE,6DAAqE;AACrE,qDAAwD;AACxD,iDAAwD;AACxD,qDAA+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;IACnD,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,eAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC9C,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACpC,IAAI,CAAC;gBACH,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACtB,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,uBAAuB;gBACvB,eAAM,CAAC,IAAI,CACT,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,EACrB,oCAAoC,CACrC,CAAC;YACJ,CAAC;QACH,CAAC;QACD,oCAAoC;QACpC,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,QAAQ,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,MAAM,CAAC,SAAS,CAAC;IAC1B,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { dequal } from 'dequal';\nimport { mergeChildConfig, removeGlobalConfig } from '../../../config';\nimport { setUserConfigFileNames } from '../../../config/app-strings';\nimport { decryptConfig } from '../../../config/decrypt';\nimport { parseFileConfig } from '../../../config/parse';\nimport { resolveConfigPresets } from '../../../config/presets';\nimport { applySecretsAndVariablesToConfig } from '../../../config/secrets';\nimport type { RenovateConfig } from '../../../config/types';\nimport { validateConfig } from '../../../config/validation';\nimport {\n CONFIG_INHERIT_NOT_FOUND,\n CONFIG_INHERIT_PARSE_ERROR,\n CONFIG_VALIDATION,\n} from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { platform } from '../../../modules/platform';\nimport * as hostRules from '../../../util/host-rules';\nimport * as queue from '../../../util/http/queue';\nimport * as throttle from '../../../util/http/throttle';\nimport * as template from '../../../util/template';\n\nexport async function mergeInheritedConfig(\n config: RenovateConfig,\n): Promise<RenovateConfig> {\n // typescript doesn't know that repo is defined\n if (!config.repository || !config.inheritConfig) {\n return config;\n }\n if (\n !is.string(config.inheritConfigRepoName) ||\n !is.string(config.inheritConfigFileName)\n ) {\n // Config validation should prevent this error\n logger.error(\n {\n inheritConfigRepoName: config.inheritConfigRepoName,\n inheritConfigFileName: config.inheritConfigFileName,\n },\n 'Invalid inherited config.',\n );\n return config;\n }\n const templateConfig = {\n topLevelOrg: config.topLevelOrg,\n parentOrg: config.parentOrg,\n repository: config.repository,\n };\n const inheritConfigRepoName = template.compile(\n config.inheritConfigRepoName,\n templateConfig,\n false,\n );\n logger.trace(\n { templateConfig, inheritConfigRepoName },\n 'Compiled inheritConfigRepoName result.',\n );\n logger.debug(\n `Checking for inherited config file ${config.inheritConfigFileName} in repo ${inheritConfigRepoName}.`,\n );\n let configFileRaw: string | null = null;\n try {\n configFileRaw = await platform.getRawFile(\n config.inheritConfigFileName,\n inheritConfigRepoName,\n );\n } catch (err) {\n if (config.inheritConfigStrict) {\n logger.debug({ err }, 'Error getting inherited config.');\n throw new Error(CONFIG_INHERIT_NOT_FOUND);\n }\n logger.trace({ err }, `Error getting inherited config.`);\n }\n if (!configFileRaw) {\n logger.debug(`No inherited config found in ${inheritConfigRepoName}.`);\n return config;\n }\n const parseResult = parseFileConfig(\n config.inheritConfigFileName,\n configFileRaw,\n );\n if (!parseResult.success) {\n logger.debug({ parseResult }, 'Error parsing inherited config.');\n throw new Error(CONFIG_INHERIT_PARSE_ERROR);\n }\n const inheritedConfig = parseResult.parsedContents as RenovateConfig;\n logger.debug({ config: inheritedConfig }, `Inherited config`);\n const res = await validateConfig('inherit', inheritedConfig);\n if (res.errors.length) {\n logger.warn(\n { errors: res.errors },\n 'Found errors in inherited configuration.',\n );\n throw new Error(CONFIG_VALIDATION);\n }\n if (res.warnings.length) {\n logger.warn(\n { warnings: res.warnings },\n 'Found warnings in inherited configuration.',\n );\n }\n\n // set user config file name here\n if (is.nonEmptyArray(inheritedConfig.configFileNames)) {\n logger.debug(\n { configFileNames: inheritedConfig.configFileNames },\n 'Updated the config filenames list',\n );\n setUserConfigFileNames(inheritedConfig.configFileNames);\n delete config.configFileNames;\n }\n\n let decryptedConfig = await decryptConfig(inheritedConfig, config.repository);\n\n let filteredConfig = removeGlobalConfig(decryptedConfig, true);\n if (!dequal(decryptedConfig, filteredConfig)) {\n logger.debug(\n { inheritedConfig: decryptedConfig, filteredConfig },\n 'Removed global config from inherited config.',\n );\n }\n\n if (is.nullOrUndefined(filteredConfig.extends)) {\n filteredConfig = applySecretsAndVariablesToConfig({\n config: filteredConfig,\n secrets: config.secrets ?? {},\n variables: config.variables ?? {},\n });\n setInheritedHostRules(filteredConfig);\n return mergeChildConfig(config, filteredConfig);\n }\n\n logger.debug('Resolving presets found in inherited config');\n const resolvedConfig = await resolveConfigPresets(\n filteredConfig,\n config,\n config.ignorePresets,\n );\n logger.trace({ config: resolvedConfig }, 'Resolved inherited config');\n\n const validationRes = await validateConfig('inherit', resolvedConfig);\n if (validationRes.errors.length) {\n logger.warn(\n { errors: validationRes.errors },\n 'Found errors in presets inside the inherited configuration.',\n );\n throw new Error(CONFIG_VALIDATION);\n }\n if (validationRes.warnings.length) {\n logger.warn(\n { warnings: validationRes.warnings },\n 'Found warnings in presets inside the inherited configuration.',\n );\n }\n\n // decrypt again, as resolved presets could contain encrypted values\n decryptedConfig = await decryptConfig(resolvedConfig, config.repository);\n\n // remove global config options once again, as resolved presets could have added some\n filteredConfig = removeGlobalConfig(decryptedConfig, true);\n if (!dequal(decryptedConfig, filteredConfig)) {\n logger.debug(\n { inheritedConfig: decryptedConfig, filteredConfig },\n 'Removed global config from inherited config presets.',\n );\n }\n\n filteredConfig = applySecretsAndVariablesToConfig({\n config: filteredConfig,\n secrets: config.secrets ?? {},\n variables: config.variables ?? {},\n });\n setInheritedHostRules(filteredConfig);\n return mergeChildConfig(config, filteredConfig);\n}\n\nfunction setInheritedHostRules(config: RenovateConfig): void {\n if (config.hostRules) {\n logger.debug('Setting hostRules from config');\n for (const rule of config.hostRules) {\n try {\n hostRules.add(rule);\n } catch (err) {\n // istanbul ignore next\n logger.warn(\n { err, config: rule },\n 'Error setting hostRule from config',\n );\n }\n }\n // host rules can change concurrency\n queue.clear();\n throttle.clear();\n delete config.hostRules;\n }\n}\n"]}
@@ -39,7 +39,7 @@ const onboarding_branch_cache_1 = require("../onboarding/branch/onboarding-branc
39
39
  const common_2 = require("../onboarding/common");
40
40
  async function detectConfigFile() {
41
41
  const fileList = await scm_1.scm.getFileList();
42
- for (const fileName of app_strings_1.configFileNames) {
42
+ for (const fileName of (0, app_strings_1.getConfigFileNames)()) {
43
43
  if (fileName === 'package.json') {
44
44
  try {
45
45
  const pJson = JSON.parse((await (0, fs_1.readLocalFile)('package.json', 'utf8')));
@@ -1 +1 @@
1
- {"version":3,"file":"merge.js","sourceRoot":"","sources":["../../../../lib/workers/repository/init/merge.ts"],"names":[],"mappings":";;AAyCA,4CAsBC;AAED,oDAqGC;AAED,0DASC;AAGD,kDAmIC;AAGD,gDA2BC;AAED,0DAsBC;AAED,kEAuCC;AAED,8CAYC;;AApaD,kEAAkC;AAClC,4CAAmD;AACnD,6DAA8D;AAC9D,qDAAwD;AACxD,uEAAsE;AACtE,yDAA0D;AAC1D,iDAAwD;AACxD,yEAAmD;AACnD,qDAA2E;AAE3E,qFAA+D;AAC/D,sEAG2C;AAC3C,4CAAyC;AACzC,gFAA0D;AAC1D,wDAAqD;AACrD,uDAAoD;AACpD,mFAA8E;AAC9E,+DAA0D;AAC1D,iDAAiD;AACjD,2CAA+C;AAC/C,yCAAiE;AACjE,4EAAsD;AACtD,wEAAkD;AAClD,8EAAwD;AACxD,6CAA+C;AAC/C,+CAA4C;AAC5C,wDAAkE;AAClE,0FAIsD;AACtD,iDAG8B;AAGvB,KAAK,UAAU,gBAAgB;IACpC,MAAM,QAAQ,GAAG,MAAM,SAAG,CAAC,WAAW,EAAE,CAAC;IACzC,KAAK,MAAM,QAAQ,IAAI,6BAAe,EAAE,CAAC;QACvC,IAAI,QAAQ,KAAK,cAAc,EAAE,CAAC;YAChC,IAAI,CAAC;gBACH,MAAM,KAAK,GAAG,IAAI,CAAC,KA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C;IACJ,CAAC;IAED,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED,SAAgB,iBAAiB,CAC/B,MAAiB,EACjB,gBAA2B;IAE3B,gBAAgB;IAChB,IAAI,YAAE,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/C,MAAM,CAAC,OAAO,GAAG,CAAC,GAAG,gBAAgB,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;QAC1E,OAAO,gBAAgB,CAAC,OAAO,CAAC;IAClC,CAAC;IAED,oEAAoE;IACpE,OAAO,IAAA,yBAAgB,EAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { mergeChildConfig } from '../../../config';\nimport { configFileNames } from '../../../config/app-strings';\nimport { decryptConfig } from '../../../config/decrypt';\nimport { migrateAndValidate } from '../../../config/migrate-validate';\nimport { migrateConfig } from '../../../config/migration';\nimport { parseFileConfig } from '../../../config/parse';\nimport * as presets from '../../../config/presets';\nimport { applySecretsAndVariablesToConfig } from '../../../config/secrets';\nimport type { AllConfig, RenovateConfig } from '../../../config/types';\nimport * as configValidation from '../../../config/validation';\nimport {\n CONFIG_VALIDATION,\n REPOSITORY_CHANGED,\n} from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport * as npmApi from '../../../modules/datasource/npm';\nimport { platform } from '../../../modules/platform';\nimport { scm } from '../../../modules/platform/scm';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport { getCache } from '../../../util/cache/repository';\nimport { parseJson } from '../../../util/common';\nimport { setUserEnv } from '../../../util/env';\nimport { readLocalFile, readSystemFile } from '../../../util/fs';\nimport * as hostRules from '../../../util/host-rules';\nimport * as queue from '../../../util/http/queue';\nimport * as throttle from '../../../util/http/throttle';\nimport { maskToken } from '../../../util/mask';\nimport { regEx } from '../../../util/regex';\nimport { getOnboardingConfig } from '../onboarding/branch/config';\nimport {\n getOnboardingConfigFromCache,\n getOnboardingFileNameFromCache,\n setOnboardingConfigDetails,\n} from '../onboarding/branch/onboarding-branch-cache';\nimport {\n OnboardingState,\n getDefaultConfigFileName,\n} from '../onboarding/common';\nimport type { RepoFileConfig } from './types';\n\nexport async function detectConfigFile(): Promise<string | null> {\n const fileList = await scm.getFileList();\n for (const fileName of configFileNames) {\n if (fileName === 'package.json') {\n try {\n const pJson = JSON.parse(\n (await readLocalFile('package.json', 'utf8'))!,\n );\n if (pJson.renovate) {\n logger.warn(\n 'Using package.json for Renovate config is deprecated - please use a dedicated configuration file instead',\n );\n return 'package.json';\n }\n } catch {\n // Do nothing\n }\n } else if (fileList.includes(fileName)) {\n return fileName;\n }\n }\n return null;\n}\n\nexport async function detectRepoFileConfig(\n branchName?: string,\n): Promise<RepoFileConfig> {\n const cache = getCache();\n let { configFileName } = cache;\n if (is.nonEmptyString(configFileName)) {\n let configFileRaw: string | null;\n try {\n configFileRaw = await platform.getRawFile(\n configFileName,\n undefined,\n branchName,\n );\n } catch (err) {\n // istanbul ignore if\n if (err instanceof ExternalHostError) {\n throw err;\n }\n configFileRaw = null;\n }\n if (configFileRaw) {\n let configFileParsed = parseJson(configFileRaw, configFileName) as any;\n if (configFileName === 'package.json') {\n configFileParsed = configFileParsed.renovate;\n }\n return { configFileName, configFileParsed };\n } else {\n logger.debug('Existing config file no longer exists');\n delete cache.configFileName;\n }\n }\n\n if (OnboardingState.onboardingCacheValid) {\n configFileName = getOnboardingFileNameFromCache();\n } else {\n configFileName = (await detectConfigFile()) ?? undefined;\n }\n\n if (!configFileName) {\n logger.debug('No renovate config file found');\n cache.configFileName = '';\n return {};\n }\n cache.configFileName = configFileName;\n logger.debug(`Found ${configFileName} config file`);\n // TODO #22198\n let configFileParsed: any;\n let configFileRaw: string | undefined | null;\n\n if (OnboardingState.onboardingCacheValid) {\n const cachedConfig = getOnboardingConfigFromCache();\n const parsedConfig = cachedConfig ? JSON.parse(cachedConfig) : undefined;\n if (parsedConfig) {\n setOnboardingConfigDetails(configFileName, JSON.stringify(parsedConfig));\n return { configFileName, configFileParsed: parsedConfig };\n }\n }\n\n if (configFileName === 'package.json') {\n // We already know it parses\n configFileParsed = JSON.parse(\n // TODO #22198\n (await readLocalFile('package.json', 'utf8'))!,\n ).renovate;\n if (is.string(configFileParsed)) {\n logger.debug('Massaging string renovate config to extends array');\n configFileParsed = { extends: [configFileParsed] };\n }\n logger.debug({ config: configFileParsed }, 'package.json>renovate config');\n } else {\n configFileRaw = await readLocalFile(configFileName, 'utf8');\n // istanbul ignore if\n if (!is.string(configFileRaw)) {\n logger.warn({ configFileName }, 'Null contents when reading config file');\n throw new Error(REPOSITORY_CHANGED);\n }\n // istanbul ignore if\n if (!configFileRaw.length) {\n configFileRaw = '{}';\n }\n\n const parseResult = parseFileConfig(configFileName, configFileRaw);\n\n if (!parseResult.success) {\n return {\n configFileName,\n configFileParseError: {\n validationError: parseResult.validationError,\n validationMessage: parseResult.validationMessage,\n },\n };\n }\n configFileParsed = parseResult.parsedContents;\n logger.debug(\n { fileName: configFileName, config: configFileParsed },\n 'Repository config',\n );\n }\n\n setOnboardingConfigDetails(configFileName, JSON.stringify(configFileParsed));\n return { configFileName, configFileParsed };\n}\n\nexport function checkForRepoConfigError(repoConfig: RepoFileConfig): void {\n if (!repoConfig.configFileParseError) {\n return;\n }\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = repoConfig.configFileName;\n error.validationError = repoConfig.configFileParseError.validationError;\n error.validationMessage = repoConfig.configFileParseError.validationMessage;\n throw error;\n}\n\n// Check for repository config\nexport async function mergeRenovateConfig(\n config: RenovateConfig,\n branchName?: string,\n): Promise<RenovateConfig> {\n let returnConfig = { ...config };\n let repoConfig: RepoFileConfig = {};\n if (config.requireConfig !== 'ignored') {\n repoConfig = await detectRepoFileConfig(branchName);\n }\n if (!repoConfig.configFileParsed && config.mode === 'silent') {\n logger.debug(\n 'When mode=silent and repo has no config file, we use the onboarding config as repo config',\n );\n const configFileName = getDefaultConfigFileName(config);\n repoConfig = {\n configFileName,\n configFileParsed: await getOnboardingConfig(config),\n };\n }\n const configFileParsed = repoConfig?.configFileParsed ?? {};\n const resolvedRepoConfig = await resolveStaticRepoConfig(\n configFileParsed,\n process.env.RENOVATE_X_STATIC_REPO_CONFIG_FILE,\n );\n\n if (is.nonEmptyArray(returnConfig.extends)) {\n resolvedRepoConfig.extends = [\n ...returnConfig.extends,\n ...(resolvedRepoConfig.extends ?? []),\n ];\n delete returnConfig.extends;\n }\n checkForRepoConfigError(repoConfig);\n const migratedConfig = await migrateAndValidate(config, resolvedRepoConfig);\n if (migratedConfig.errors?.length) {\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = repoConfig.configFileName;\n error.validationError =\n 'The renovate configuration file contains some invalid settings';\n error.validationMessage = migratedConfig.errors\n .map((e) => e.message)\n .join(', ');\n throw error;\n }\n if (migratedConfig.warnings) {\n returnConfig.warnings = [\n ...(returnConfig.warnings ?? []),\n ...migratedConfig.warnings,\n ];\n }\n delete migratedConfig.errors;\n delete migratedConfig.warnings;\n // TODO #22198\n const repository = config.repository!;\n // Decrypt before resolving in case we need npm authentication for any presets\n const decryptedConfig = await decryptConfig(migratedConfig, repository);\n setNpmTokenInNpmrc(decryptedConfig);\n // istanbul ignore if\n if (is.string(decryptedConfig.npmrc)) {\n logger.debug('Found npmrc in decrypted config - setting');\n npmApi.setNpmrc(decryptedConfig.npmrc);\n }\n // Decrypt after resolving in case the preset contains npm authentication instead\n let resolvedConfig = await decryptConfig(\n await presets.resolveConfigPresets(\n decryptedConfig,\n config,\n config.ignorePresets,\n ),\n repository,\n );\n logger.trace({ config: resolvedConfig }, 'resolved config');\n const migrationResult = migrateConfig(resolvedConfig);\n if (migrationResult.isMigrated) {\n logger.debug('Resolved config needs migrating');\n logger.trace({ config: resolvedConfig }, 'resolved config after migrating');\n resolvedConfig = migrationResult.migratedConfig;\n }\n setNpmTokenInNpmrc(resolvedConfig);\n // istanbul ignore if\n if (is.string(resolvedConfig.npmrc)) {\n logger.debug(\n 'Ignoring any .npmrc files in repository due to configured npmrc',\n );\n npmApi.setNpmrc(resolvedConfig.npmrc);\n }\n resolvedConfig = applySecretsAndVariablesToConfig({\n config: resolvedConfig,\n secrets: mergeChildConfig(\n config.secrets ?? {},\n resolvedConfig.secrets ?? {},\n ),\n variables: mergeChildConfig(\n config.variables ?? {},\n resolvedConfig.variables ?? {},\n ),\n });\n\n // istanbul ignore if\n if (resolvedConfig.hostRules) {\n logger.debug('Setting hostRules from config');\n for (const rule of resolvedConfig.hostRules) {\n try {\n hostRules.add(rule);\n } catch (err) {\n logger.warn(\n { err, config: rule },\n 'Error setting hostRule from config',\n );\n }\n }\n // host rules can change concurrency\n queue.clear();\n throttle.clear();\n delete resolvedConfig.hostRules;\n }\n returnConfig = mergeChildConfig(returnConfig, resolvedConfig);\n returnConfig = await presets.resolveConfigPresets(returnConfig, config);\n returnConfig.renovateJsonPresent = true;\n // istanbul ignore if\n if (returnConfig.ignorePaths?.length) {\n logger.debug(\n { ignorePaths: returnConfig.ignorePaths },\n `Found repo ignorePaths`,\n );\n }\n\n setUserEnv(returnConfig.env);\n delete returnConfig.env;\n\n return returnConfig;\n}\n\n/** needed when using portal secrets for npmToken */\nexport function setNpmTokenInNpmrc(config: RenovateConfig): void {\n if (!is.string(config.npmToken)) {\n return;\n }\n\n const token = config.npmToken;\n logger.debug({ npmToken: maskToken(token) }, 'Migrating npmToken to npmrc');\n\n if (!is.string(config.npmrc)) {\n logger.debug('Adding npmrc to config');\n config.npmrc = `//registry.npmjs.org/:_authToken=${token}\\n`;\n delete config.npmToken;\n return;\n }\n\n if (config.npmrc.includes(`\\${NPM_TOKEN}`)) {\n logger.debug(`Replacing \\${NPM_TOKEN} with npmToken`);\n config.npmrc = config.npmrc.replace(regEx(/\\${NPM_TOKEN}/g), token);\n } else {\n logger.debug('Appending _authToken= to end of existing npmrc');\n config.npmrc = config.npmrc.replace(\n regEx(/\\n?$/),\n `\\n_authToken=${token}\\n`,\n );\n }\n\n delete config.npmToken;\n}\n\nexport async function resolveStaticRepoConfig(\n config: AllConfig,\n filename: string | undefined,\n): Promise<AllConfig> {\n if (!is.nonEmptyString(filename)) {\n return config;\n }\n\n let staticRepoConfig: AllConfig;\n\n try {\n staticRepoConfig = await tryReadStaticRepoFileConfig(filename);\n } catch (err) {\n logger.fatal({ err }, 'Failed to load static repository config file');\n process.exit(1);\n }\n\n if (!is.nonEmptyObject(staticRepoConfig)) {\n return config;\n }\n\n return mergeStaticConfig(config, staticRepoConfig);\n}\n\nexport async function tryReadStaticRepoFileConfig(\n staticRepoConfigFile: string,\n): Promise<AllConfig> {\n logger.debug(`Reading static repo config file from ${staticRepoConfigFile}`);\n\n let staticRepoConfigRaw: string;\n try {\n staticRepoConfigRaw = await readSystemFile(staticRepoConfigFile, 'utf8');\n } catch (err) {\n throw new Error(\n `Failed to read static repo config file: \"${staticRepoConfigFile}\"`,\n { cause: err },\n );\n }\n\n const staticRepoConfig = parseJson(\n staticRepoConfigRaw,\n staticRepoConfigFile,\n ) as AllConfig;\n\n // validate and log issues here to preserve context, caller handles migration and full validation.\n const { errors, warnings } = await configValidation.validateConfig(\n 'repo',\n staticRepoConfig,\n );\n\n if (is.nonEmptyArray(errors) || is.nonEmptyArray(warnings)) {\n logger.info(\n { errors, warnings },\n 'Static repo config validation issues detected',\n );\n } else {\n logger.debug(\n { staticRepoConfig },\n 'Static repository config file successfully parsed and validated',\n );\n }\n\n return staticRepoConfig;\n}\n\nexport function mergeStaticConfig(\n config: AllConfig,\n staticRepoConfig: AllConfig,\n): AllConfig {\n // merge extends\n if (is.nonEmptyArray(staticRepoConfig.extends)) {\n config.extends = [...staticRepoConfig.extends, ...(config.extends ?? [])];\n delete staticRepoConfig.extends;\n }\n\n // renovate repo config overrides RENOVATE_STATIC_REPO_CONFIG[_FILE]\n return mergeChildConfig(staticRepoConfig, config);\n}\n"]}
1
+ {"version":3,"file":"merge.js","sourceRoot":"","sources":["../../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AAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { mergeChildConfig } from '../../../config';\nimport { getConfigFileNames } from '../../../config/app-strings';\nimport { decryptConfig } from '../../../config/decrypt';\nimport { migrateAndValidate } from '../../../config/migrate-validate';\nimport { migrateConfig } from '../../../config/migration';\nimport { parseFileConfig } from '../../../config/parse';\nimport * as presets from '../../../config/presets';\nimport { applySecretsAndVariablesToConfig } from '../../../config/secrets';\nimport type { AllConfig, RenovateConfig } from '../../../config/types';\nimport * as configValidation from '../../../config/validation';\nimport {\n CONFIG_VALIDATION,\n REPOSITORY_CHANGED,\n} from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport * as npmApi from '../../../modules/datasource/npm';\nimport { platform } from '../../../modules/platform';\nimport { scm } from '../../../modules/platform/scm';\nimport { ExternalHostError } from '../../../types/errors/external-host-error';\nimport { getCache } from '../../../util/cache/repository';\nimport { parseJson } from '../../../util/common';\nimport { setUserEnv } from '../../../util/env';\nimport { readLocalFile, readSystemFile } from '../../../util/fs';\nimport * as hostRules from '../../../util/host-rules';\nimport * as queue from '../../../util/http/queue';\nimport * as throttle from '../../../util/http/throttle';\nimport { maskToken } from '../../../util/mask';\nimport { regEx } from '../../../util/regex';\nimport { getOnboardingConfig } from '../onboarding/branch/config';\nimport {\n getOnboardingConfigFromCache,\n getOnboardingFileNameFromCache,\n setOnboardingConfigDetails,\n} from '../onboarding/branch/onboarding-branch-cache';\nimport {\n OnboardingState,\n getDefaultConfigFileName,\n} from '../onboarding/common';\nimport type { RepoFileConfig } from './types';\n\nexport async function detectConfigFile(): Promise<string | null> {\n const fileList = await scm.getFileList();\n for (const fileName of getConfigFileNames()) {\n if (fileName === 'package.json') {\n try {\n const pJson = JSON.parse(\n (await readLocalFile('package.json', 'utf8'))!,\n );\n if (pJson.renovate) {\n logger.warn(\n 'Using package.json for Renovate config is deprecated - please use a dedicated configuration file instead',\n );\n return 'package.json';\n }\n } catch {\n // Do nothing\n }\n } else if (fileList.includes(fileName)) {\n return fileName;\n }\n }\n return null;\n}\n\nexport async function detectRepoFileConfig(\n branchName?: string,\n): Promise<RepoFileConfig> {\n const cache = getCache();\n let { configFileName } = cache;\n if (is.nonEmptyString(configFileName)) {\n let configFileRaw: string | null;\n try {\n configFileRaw = await platform.getRawFile(\n configFileName,\n undefined,\n branchName,\n );\n } catch (err) {\n // istanbul ignore if\n if (err instanceof ExternalHostError) {\n throw err;\n }\n configFileRaw = null;\n }\n if (configFileRaw) {\n let configFileParsed = parseJson(configFileRaw, configFileName) as any;\n if (configFileName === 'package.json') {\n configFileParsed = configFileParsed.renovate;\n }\n return { configFileName, configFileParsed };\n } else {\n logger.debug('Existing config file no longer exists');\n delete cache.configFileName;\n }\n }\n\n if (OnboardingState.onboardingCacheValid) {\n configFileName = getOnboardingFileNameFromCache();\n } else {\n configFileName = (await detectConfigFile()) ?? undefined;\n }\n\n if (!configFileName) {\n logger.debug('No renovate config file found');\n cache.configFileName = '';\n return {};\n }\n cache.configFileName = configFileName;\n logger.debug(`Found ${configFileName} config file`);\n // TODO #22198\n let configFileParsed: any;\n let configFileRaw: string | undefined | null;\n\n if (OnboardingState.onboardingCacheValid) {\n const cachedConfig = getOnboardingConfigFromCache();\n const parsedConfig = cachedConfig ? JSON.parse(cachedConfig) : undefined;\n if (parsedConfig) {\n setOnboardingConfigDetails(configFileName, JSON.stringify(parsedConfig));\n return { configFileName, configFileParsed: parsedConfig };\n }\n }\n\n if (configFileName === 'package.json') {\n // We already know it parses\n configFileParsed = JSON.parse(\n // TODO #22198\n (await readLocalFile('package.json', 'utf8'))!,\n ).renovate;\n if (is.string(configFileParsed)) {\n logger.debug('Massaging string renovate config to extends array');\n configFileParsed = { extends: [configFileParsed] };\n }\n logger.debug({ config: configFileParsed }, 'package.json>renovate config');\n } else {\n configFileRaw = await readLocalFile(configFileName, 'utf8');\n // istanbul ignore if\n if (!is.string(configFileRaw)) {\n logger.warn({ configFileName }, 'Null contents when reading config file');\n throw new Error(REPOSITORY_CHANGED);\n }\n // istanbul ignore if\n if (!configFileRaw.length) {\n configFileRaw = '{}';\n }\n\n const parseResult = parseFileConfig(configFileName, configFileRaw);\n\n if (!parseResult.success) {\n return {\n configFileName,\n configFileParseError: {\n validationError: parseResult.validationError,\n validationMessage: parseResult.validationMessage,\n },\n };\n }\n configFileParsed = parseResult.parsedContents;\n logger.debug(\n { fileName: configFileName, config: configFileParsed },\n 'Repository config',\n );\n }\n\n setOnboardingConfigDetails(configFileName, JSON.stringify(configFileParsed));\n return { configFileName, configFileParsed };\n}\n\nexport function checkForRepoConfigError(repoConfig: RepoFileConfig): void {\n if (!repoConfig.configFileParseError) {\n return;\n }\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = repoConfig.configFileName;\n error.validationError = repoConfig.configFileParseError.validationError;\n error.validationMessage = repoConfig.configFileParseError.validationMessage;\n throw error;\n}\n\n// Check for repository config\nexport async function mergeRenovateConfig(\n config: RenovateConfig,\n branchName?: string,\n): Promise<RenovateConfig> {\n let returnConfig = { ...config };\n let repoConfig: RepoFileConfig = {};\n if (config.requireConfig !== 'ignored') {\n repoConfig = await detectRepoFileConfig(branchName);\n }\n if (!repoConfig.configFileParsed && config.mode === 'silent') {\n logger.debug(\n 'When mode=silent and repo has no config file, we use the onboarding config as repo config',\n );\n const configFileName = getDefaultConfigFileName(config);\n repoConfig = {\n configFileName,\n configFileParsed: await getOnboardingConfig(config),\n };\n }\n const configFileParsed = repoConfig?.configFileParsed ?? {};\n const resolvedRepoConfig = await resolveStaticRepoConfig(\n configFileParsed,\n process.env.RENOVATE_X_STATIC_REPO_CONFIG_FILE,\n );\n\n if (is.nonEmptyArray(returnConfig.extends)) {\n resolvedRepoConfig.extends = [\n ...returnConfig.extends,\n ...(resolvedRepoConfig.extends ?? []),\n ];\n delete returnConfig.extends;\n }\n checkForRepoConfigError(repoConfig);\n const migratedConfig = await migrateAndValidate(config, resolvedRepoConfig);\n if (migratedConfig.errors?.length) {\n const error = new Error(CONFIG_VALIDATION);\n error.validationSource = repoConfig.configFileName;\n error.validationError =\n 'The renovate configuration file contains some invalid settings';\n error.validationMessage = migratedConfig.errors\n .map((e) => e.message)\n .join(', ');\n throw error;\n }\n if (migratedConfig.warnings) {\n returnConfig.warnings = [\n ...(returnConfig.warnings ?? []),\n ...migratedConfig.warnings,\n ];\n }\n delete migratedConfig.errors;\n delete migratedConfig.warnings;\n // TODO #22198\n const repository = config.repository!;\n // Decrypt before resolving in case we need npm authentication for any presets\n const decryptedConfig = await decryptConfig(migratedConfig, repository);\n setNpmTokenInNpmrc(decryptedConfig);\n // istanbul ignore if\n if (is.string(decryptedConfig.npmrc)) {\n logger.debug('Found npmrc in decrypted config - setting');\n npmApi.setNpmrc(decryptedConfig.npmrc);\n }\n // Decrypt after resolving in case the preset contains npm authentication instead\n let resolvedConfig = await decryptConfig(\n await presets.resolveConfigPresets(\n decryptedConfig,\n config,\n config.ignorePresets,\n ),\n repository,\n );\n logger.trace({ config: resolvedConfig }, 'resolved config');\n const migrationResult = migrateConfig(resolvedConfig);\n if (migrationResult.isMigrated) {\n logger.debug('Resolved config needs migrating');\n logger.trace({ config: resolvedConfig }, 'resolved config after migrating');\n resolvedConfig = migrationResult.migratedConfig;\n }\n setNpmTokenInNpmrc(resolvedConfig);\n // istanbul ignore if\n if (is.string(resolvedConfig.npmrc)) {\n logger.debug(\n 'Ignoring any .npmrc files in repository due to configured npmrc',\n );\n npmApi.setNpmrc(resolvedConfig.npmrc);\n }\n resolvedConfig = applySecretsAndVariablesToConfig({\n config: resolvedConfig,\n secrets: mergeChildConfig(\n config.secrets ?? {},\n resolvedConfig.secrets ?? {},\n ),\n variables: mergeChildConfig(\n config.variables ?? {},\n resolvedConfig.variables ?? {},\n ),\n });\n\n // istanbul ignore if\n if (resolvedConfig.hostRules) {\n logger.debug('Setting hostRules from config');\n for (const rule of resolvedConfig.hostRules) {\n try {\n hostRules.add(rule);\n } catch (err) {\n logger.warn(\n { err, config: rule },\n 'Error setting hostRule from config',\n );\n }\n }\n // host rules can change concurrency\n queue.clear();\n throttle.clear();\n delete resolvedConfig.hostRules;\n }\n returnConfig = mergeChildConfig(returnConfig, resolvedConfig);\n returnConfig = await presets.resolveConfigPresets(returnConfig, config);\n returnConfig.renovateJsonPresent = true;\n // istanbul ignore if\n if (returnConfig.ignorePaths?.length) {\n logger.debug(\n { ignorePaths: returnConfig.ignorePaths },\n `Found repo ignorePaths`,\n );\n }\n\n setUserEnv(returnConfig.env);\n delete returnConfig.env;\n\n return returnConfig;\n}\n\n/** needed when using portal secrets for npmToken */\nexport function setNpmTokenInNpmrc(config: RenovateConfig): void {\n if (!is.string(config.npmToken)) {\n return;\n }\n\n const token = config.npmToken;\n logger.debug({ npmToken: maskToken(token) }, 'Migrating npmToken to npmrc');\n\n if (!is.string(config.npmrc)) {\n logger.debug('Adding npmrc to config');\n config.npmrc = `//registry.npmjs.org/:_authToken=${token}\\n`;\n delete config.npmToken;\n return;\n }\n\n if (config.npmrc.includes(`\\${NPM_TOKEN}`)) {\n logger.debug(`Replacing \\${NPM_TOKEN} with npmToken`);\n config.npmrc = config.npmrc.replace(regEx(/\\${NPM_TOKEN}/g), token);\n } else {\n logger.debug('Appending _authToken= to end of existing npmrc');\n config.npmrc = config.npmrc.replace(\n regEx(/\\n?$/),\n `\\n_authToken=${token}\\n`,\n );\n }\n\n delete config.npmToken;\n}\n\nexport async function resolveStaticRepoConfig(\n config: AllConfig,\n filename: string | undefined,\n): Promise<AllConfig> {\n if (!is.nonEmptyString(filename)) {\n return config;\n }\n\n let staticRepoConfig: AllConfig;\n\n try {\n staticRepoConfig = await tryReadStaticRepoFileConfig(filename);\n } catch (err) {\n logger.fatal({ err }, 'Failed to load static repository config file');\n process.exit(1);\n }\n\n if (!is.nonEmptyObject(staticRepoConfig)) {\n return config;\n }\n\n return mergeStaticConfig(config, staticRepoConfig);\n}\n\nexport async function tryReadStaticRepoFileConfig(\n staticRepoConfigFile: string,\n): Promise<AllConfig> {\n logger.debug(`Reading static repo config file from ${staticRepoConfigFile}`);\n\n let staticRepoConfigRaw: string;\n try {\n staticRepoConfigRaw = await readSystemFile(staticRepoConfigFile, 'utf8');\n } catch (err) {\n throw new Error(\n `Failed to read static repo config file: \"${staticRepoConfigFile}\"`,\n { cause: err },\n );\n }\n\n const staticRepoConfig = parseJson(\n staticRepoConfigRaw,\n staticRepoConfigFile,\n ) as AllConfig;\n\n // validate and log issues here to preserve context, caller handles migration and full validation.\n const { errors, warnings } = await configValidation.validateConfig(\n 'repo',\n staticRepoConfig,\n );\n\n if (is.nonEmptyArray(errors) || is.nonEmptyArray(warnings)) {\n logger.info(\n { errors, warnings },\n 'Static repo config validation issues detected',\n );\n } else {\n logger.debug(\n { staticRepoConfig },\n 'Static repository config file successfully parsed and validated',\n );\n }\n\n return staticRepoConfig;\n}\n\nexport function mergeStaticConfig(\n config: AllConfig,\n staticRepoConfig: AllConfig,\n): AllConfig {\n // merge extends\n if (is.nonEmptyArray(staticRepoConfig.extends)) {\n config.extends = [...staticRepoConfig.extends, ...(config.extends ?? [])];\n delete staticRepoConfig.extends;\n }\n\n // renovate repo config overrides RENOVATE_STATIC_REPO_CONFIG[_FILE]\n return mergeChildConfig(staticRepoConfig, config);\n}\n"]}
@@ -18,7 +18,7 @@ async function findFile(fileName) {
18
18
  return fileList.includes(fileName);
19
19
  }
20
20
  async function configFileExists() {
21
- for (const fileName of app_strings_1.configFileNames) {
21
+ for (const fileName of (0, app_strings_1.getConfigFileNames)()) {
22
22
  if (fileName !== 'package.json' && (await findFile(fileName))) {
23
23
  logger_1.logger.debug(`Config file exists, fileName: ${fileName}`);
24
24
  return true;
@@ -78,7 +78,7 @@ async function isOnboarded(config) {
78
78
  const closedOnboardingPr = await closedPrExists(config);
79
79
  const cache = (0, repository_1.getCache)();
80
80
  const onboardingBranchCache = cache?.onboardingBranchCache;
81
- // if onboarding cache is present and base branch has not been updated branch is not onboarded
81
+ // if onboarding cache is present and base branch has not been updated; branch is not onboarded
82
82
  // if closed pr exists then presence of onboarding cache doesn't matter as we need to skip onboarding
83
83
  if (config.onboarding &&
84
84
  !closedOnboardingPr &&
@@ -88,7 +88,9 @@ async function isOnboarded(config) {
88
88
  logger_1.logger.debug('Onboarding cache is valid. Repo is not onboarded');
89
89
  return false;
90
90
  }
91
- if (cache.configFileName) {
91
+ // when bot is ran is fork mode ... do not fetch file using api call instead use the git.fileList so we get sync first and get the latest config
92
+ // prevents https://github.com/renovatebot/renovate/discussions/37328
93
+ if (cache.configFileName && !config.forkToken) {
92
94
  logger_1.logger.debug('Checking cached config file name');
93
95
  try {
94
96
  const configFileContent = await platform_1.platform.getJsonFile(cache.configFileName);
@@ -1 +1 @@
1
- {"version":3,"file":"check.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/onboarding/branch/check.ts"],"names":[],"mappings":";;AA8DA,kCAsGC;AAED,0CAOC;AA7KD,gEAAiE;AAEjE,yEAG8C;AAC9C,+CAA4C;AAE5C,2DAAwD;AACxD,kEAAqE;AACrE,0DAAuD;AACvD,kEAA6D;AAC7D,4CAAoD;AACpD,8CAAuD;AACvD,sCAAqD;AAErD,KAAK,UAAU,QAAQ,CAAC,QAAgB;IACtC,eAAM,CAAC,KAAK,CAAC,YAAY,QAAQ,GAAG,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,MAAM,SAAG,CAAC,WAAW,EAAE,CAAC;IACzC,OAAO,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AAED,KAAK,UAAU,gBAAgB;IAC7B,KAAK,MAAM,QAAQ,IAAI,6BAAe,EAAE,CAAC;QACvC,IAAI,QAAQ,KAAK,cAAc,IAAI,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;YAC9D,eAAM,CAAC,KAAK,CAAC,iCAAiC,QAAQ,EAAE,CAAC,CAAC;YAC1D,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,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AAM;YACjC,KAAK,EAAE,sBAAsB;YAC7B,OAAO,EAAE,kRAAkR;SAC5R,CAAC,CAAC;IACL,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,6CAA4B,CAAC,CAAC;AAChD,CAAC;AAEM,KAAK,UAAU,eAAe,CACnC,MAAsB;IAEtB,OAAO,MAAM,mBAAQ,CAAC,WAAW,CAC/B,MAAM,CAAC,gBAAiB,EACxB,MAAM,CAAC,UAAU,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { configFileNames } from '../../../../config/app-strings';\nimport type { RenovateConfig } from '../../../../config/types';\nimport {\n REPOSITORY_CLOSED_ONBOARDING,\n REPOSITORY_NO_CONFIG,\n} from '../../../../constants/error-messages';\nimport { logger } from '../../../../logger';\nimport type { Pr } from '../../../../modules/platform';\nimport { platform } from '../../../../modules/platform';\nimport { ensureComment } from '../../../../modules/platform/comment';\nimport { scm } from '../../../../modules/platform/scm';\nimport { getCache } from '../../../../util/cache/repository';\nimport { readLocalFile } from '../../../../util/fs';\nimport { getBranchCommit } from '../../../../util/git';\nimport { getSemanticCommitPrTitle } from '../common';\n\nasync function findFile(fileName: string): Promise<boolean> {\n logger.debug(`findFile(${fileName})`);\n const fileList = await scm.getFileList();\n return fileList.includes(fileName);\n}\n\nasync function configFileExists(): Promise<boolean> {\n for (const fileName of configFileNames) {\n if (fileName !== 'package.json' && (await findFile(fileName))) {\n logger.debug(`Config file exists, fileName: ${fileName}`);\n return true;\n }\n }\n return false;\n}\n\nasync function packageJsonConfigExists(): Promise<boolean> {\n try {\n // TODO #22198\n const pJson = JSON.parse((await readLocalFile('package.json', 'utf8'))!);\n if (pJson.renovate) {\n return true;\n }\n } catch {\n // Do nothing\n }\n return false;\n}\n\nasync function closedPrExists(config: RenovateConfig): Promise<Pr | null> {\n return (\n (await platform.findPr({\n branchName: config.onboardingBranch!,\n prTitle: config.onboardingPrTitle,\n state: '!open',\n targetBranch: config.baseBranch,\n })) ??\n (await platform.findPr({\n branchName: config.onboardingBranch!,\n prTitle: getSemanticCommitPrTitle(config),\n state: '!open',\n targetBranch: config.baseBranch,\n }))\n );\n}\n\nexport async function isOnboarded(config: RenovateConfig): Promise<boolean> {\n logger.debug('isOnboarded()');\n const title = `Action required: Add a Renovate config`;\n\n // Repo is onboarded if in silent mode\n if (config.mode === 'silent') {\n logger.debug('Silent mode enabled so repo is considered onboarded');\n return true;\n }\n\n // Repo is onboarded if global config is bypassing onboarding and does not require a\n // configuration file.\n // The repo is considered \"not onboarded\" if:\n // - An onboarding cache is present, and\n // - The current default branch SHA matches the default SHA found in the cache\n // Also if there is a closed pr skip using cache as it is outdated\n if (config.requireConfig === 'optional' && config.onboarding === false) {\n // Return early and avoid checking for config files\n return true;\n }\n if (config.requireConfig === 'ignored') {\n logger.debug('Config file will be ignored');\n return true;\n }\n\n const closedOnboardingPr = await closedPrExists(config);\n const cache = getCache();\n const onboardingBranchCache = cache?.onboardingBranchCache;\n // if onboarding cache is present and base branch has not been updated branch is not onboarded\n // if closed pr exists then presence of onboarding cache doesn't matter as we need to skip onboarding\n if (\n config.onboarding &&\n !closedOnboardingPr &&\n onboardingBranchCache &&\n onboardingBranchCache.defaultBranchSha ===\n getBranchCommit(config.defaultBranch!)\n ) {\n logger.debug('Onboarding cache is valid. Repo is not onboarded');\n return false;\n }\n\n if (cache.configFileName) {\n logger.debug('Checking cached config file name');\n try {\n const configFileContent = await platform.getJsonFile(\n cache.configFileName,\n );\n if (configFileContent) {\n if (\n cache.configFileName !== 'package.json' ||\n configFileContent.renovate\n ) {\n logger.debug('Existing config file confirmed');\n logger.debug(\n { fileName: cache.configFileName, config: configFileContent },\n 'Repository config',\n );\n return true;\n }\n }\n } catch {\n // probably file doesn't exist\n }\n logger.debug('Existing config file no longer exists');\n delete cache.configFileName;\n }\n if (await configFileExists()) {\n await platform.ensureIssueClosing(title);\n return true;\n }\n logger.debug('config file not found');\n if (await packageJsonConfigExists()) {\n logger.debug('package.json contains config');\n await platform.ensureIssueClosing(title);\n return true;\n }\n\n // If onboarding has been disabled and config files are required then the\n // repository has not been onboarded yet\n if (config.requireConfig === 'required' && config.onboarding === false) {\n throw new Error(REPOSITORY_NO_CONFIG);\n }\n\n if (!closedOnboardingPr) {\n logger.debug('Found no closed onboarding PR');\n return false;\n }\n logger.debug('Found closed onboarding PR');\n if (config.requireConfig === 'optional') {\n logger.debug('Config not mandatory so repo is considered onboarded');\n return true;\n }\n logger.debug('Repo is not onboarded and no merged PRs exist');\n if (!config.suppressNotifications!.includes('onboardingClose')) {\n // ensure PR comment\n await ensureComment({\n number: closedOnboardingPr.number,\n topic: `Renovate is disabled`,\n content: `Renovate is disabled because there is no Renovate configuration file. To enable Renovate, you can either (a) change this PR's title to get a new onboarding PR, and merge the new onboarding PR, or (b) create a Renovate config file, and commit that file to your base branch.`,\n });\n }\n throw new Error(REPOSITORY_CLOSED_ONBOARDING);\n}\n\nexport async function getOnboardingPr(\n config: RenovateConfig,\n): Promise<Pr | null> {\n return await platform.getBranchPr(\n config.onboardingBranch!,\n config.baseBranch,\n );\n}\n"]}
1
+ {"version":3,"file":"check.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/onboarding/branch/check.ts"],"names":[],"mappings":";;AA8DA,kCAwGC;AAED,0CAOC;AA/KD,gEAAoE;AAEpE,yEAG8C;AAC9C,+CAA4C;AAE5C,2DAAwD;AACxD,kEAAqE;AACrE,0DAAuD;AACvD,kEAA6D;AAC7D,4CAAoD;AACpD,8CAAuD;AACvD,sCAAqD;AAErD,KAAK,UAAU,QAAQ,CAAC,QAAgB;IACtC,eAAM,CAAC,KAAK,CAAC,YAAY,QAAQ,GAAG,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,MAAM,SAAG,CAAC,WAAW,EAAE,CAAC;IACzC,OAAO,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AAED,KAAK,UAAU,gBAAgB;IAC7B,KAAK,MAAM,QAAQ,IAAI,IAAA,gCAAkB,GAAE,EAAE,C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M,CAAC,KAAK,CAAC,sDAAsD,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,eAAM,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;IAC9D,IAAI,CAAC,MAAM,CAAC,qBAAsB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC/D,oBAAoB;QACpB,MAAM,IAAA,uBAAa,EAAC;YAClB,MAAM,EAAE,kBAAkB,CAAC,MAAM;YACjC,KAAK,EAAE,sBAAsB;YAC7B,OAAO,EAAE,kRAAkR;SAC5R,CAAC,CAAC;IACL,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,6CAA4B,CAAC,CAAC;AAChD,CAAC;AAEM,KAAK,UAAU,eAAe,CACnC,MAAsB;IAEtB,OAAO,MAAM,mBAAQ,CAAC,WAAW,CAC/B,MAAM,CAAC,gBAAiB,EACxB,MAAM,CAAC,UAAU,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { getConfigFileNames } from '../../../../config/app-strings';\nimport type { RenovateConfig } from '../../../../config/types';\nimport {\n REPOSITORY_CLOSED_ONBOARDING,\n REPOSITORY_NO_CONFIG,\n} from '../../../../constants/error-messages';\nimport { logger } from '../../../../logger';\nimport type { Pr } from '../../../../modules/platform';\nimport { platform } from '../../../../modules/platform';\nimport { ensureComment } from '../../../../modules/platform/comment';\nimport { scm } from '../../../../modules/platform/scm';\nimport { getCache } from '../../../../util/cache/repository';\nimport { readLocalFile } from '../../../../util/fs';\nimport { getBranchCommit } from '../../../../util/git';\nimport { getSemanticCommitPrTitle } from '../common';\n\nasync function findFile(fileName: string): Promise<boolean> {\n logger.debug(`findFile(${fileName})`);\n const fileList = await scm.getFileList();\n return fileList.includes(fileName);\n}\n\nasync function configFileExists(): Promise<boolean> {\n for (const fileName of getConfigFileNames()) {\n if (fileName !== 'package.json' && (await findFile(fileName))) {\n logger.debug(`Config file exists, fileName: ${fileName}`);\n return true;\n }\n }\n return false;\n}\n\nasync function packageJsonConfigExists(): Promise<boolean> {\n try {\n // TODO #22198\n const pJson = JSON.parse((await readLocalFile('package.json', 'utf8'))!);\n if (pJson.renovate) {\n return true;\n }\n } catch {\n // Do nothing\n }\n return false;\n}\n\nasync function closedPrExists(config: RenovateConfig): Promise<Pr | null> {\n return (\n (await platform.findPr({\n branchName: config.onboardingBranch!,\n prTitle: config.onboardingPrTitle,\n state: '!open',\n targetBranch: config.baseBranch,\n })) ??\n (await platform.findPr({\n branchName: config.onboardingBranch!,\n prTitle: getSemanticCommitPrTitle(config),\n state: '!open',\n targetBranch: config.baseBranch,\n }))\n );\n}\n\nexport async function isOnboarded(config: RenovateConfig): Promise<boolean> {\n logger.debug('isOnboarded()');\n const title = `Action required: Add a Renovate config`;\n\n // Repo is onboarded if in silent mode\n if (config.mode === 'silent') {\n logger.debug('Silent mode enabled so repo is considered onboarded');\n return true;\n }\n\n // Repo is onboarded if global config is bypassing onboarding and does not require a\n // configuration file.\n // The repo is considered \"not onboarded\" if:\n // - An onboarding cache is present, and\n // - The current default branch SHA matches the default SHA found in the cache\n // Also if there is a closed pr skip using cache as it is outdated\n if (config.requireConfig === 'optional' && config.onboarding === false) {\n // Return early and avoid checking for config files\n return true;\n }\n if (config.requireConfig === 'ignored') {\n logger.debug('Config file will be ignored');\n return true;\n }\n\n const closedOnboardingPr = await closedPrExists(config);\n const cache = getCache();\n const onboardingBranchCache = cache?.onboardingBranchCache;\n // if onboarding cache is present and base branch has not been updated; branch is not onboarded\n // if closed pr exists then presence of onboarding cache doesn't matter as we need to skip onboarding\n if (\n config.onboarding &&\n !closedOnboardingPr &&\n onboardingBranchCache &&\n onboardingBranchCache.defaultBranchSha ===\n getBranchCommit(config.defaultBranch!)\n ) {\n logger.debug('Onboarding cache is valid. Repo is not onboarded');\n return false;\n }\n\n // when bot is ran is fork mode ... do not fetch file using api call instead use the git.fileList so we get sync first and get the latest config\n // prevents https://github.com/renovatebot/renovate/discussions/37328\n if (cache.configFileName && !config.forkToken) {\n logger.debug('Checking cached config file name');\n try {\n const configFileContent = await platform.getJsonFile(\n cache.configFileName,\n );\n if (configFileContent) {\n if (\n cache.configFileName !== 'package.json' ||\n configFileContent.renovate\n ) {\n logger.debug('Existing config file confirmed');\n logger.debug(\n { fileName: cache.configFileName, config: configFileContent },\n 'Repository config',\n );\n return true;\n }\n }\n } catch {\n // probably file doesn't exist\n }\n logger.debug('Existing config file no longer exists');\n delete cache.configFileName;\n }\n if (await configFileExists()) {\n await platform.ensureIssueClosing(title);\n return true;\n }\n logger.debug('config file not found');\n if (await packageJsonConfigExists()) {\n logger.debug('package.json contains config');\n await platform.ensureIssueClosing(title);\n return true;\n }\n\n // If onboarding has been disabled and config files are required then the\n // repository has not been onboarded yet\n if (config.requireConfig === 'required' && config.onboarding === false) {\n throw new Error(REPOSITORY_NO_CONFIG);\n }\n\n if (!closedOnboardingPr) {\n logger.debug('Found no closed onboarding PR');\n return false;\n }\n logger.debug('Found closed onboarding PR');\n if (config.requireConfig === 'optional') {\n logger.debug('Config not mandatory so repo is considered onboarded');\n return true;\n }\n logger.debug('Repo is not onboarded and no merged PRs exist');\n if (!config.suppressNotifications!.includes('onboardingClose')) {\n // ensure PR comment\n await ensureComment({\n number: closedOnboardingPr.number,\n topic: `Renovate is disabled`,\n content: `Renovate is disabled because there is no Renovate configuration file. To enable Renovate, you can either (a) change this PR's title to get a new onboarding PR, and merge the new onboarding PR, or (b) create a Renovate config file, and commit that file to your base branch.`,\n });\n }\n throw new Error(REPOSITORY_CLOSED_ONBOARDING);\n}\n\nexport async function getOnboardingPr(\n config: RenovateConfig,\n): Promise<Pr | null> {\n return await platform.getBranchPr(\n config.onboardingBranch!,\n config.baseBranch,\n );\n}\n"]}
@@ -41,6 +41,7 @@ async function createOnboardingBranch(config) {
41
41
  message: commitMessage,
42
42
  platformCommit: config.platformCommit,
43
43
  force: true,
44
+ labels: config.labels,
44
45
  });
45
46
  }
46
47
  //# sourceMappingURL=create.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"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gBAChB,cAAc;gBACd,IAAI,EAAE,UAAU;gBAChB,QAAQ;aACT;SACF;QACD,OAAO,EAAE,aAAa;QACtB,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,KAAK,EAAE,IAAI;KACZ,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { GlobalConfig } from '../../../../config/global';\nimport type { RenovateConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport { scm } from '../../../../modules/platform/scm';\nimport { compile } from '../../../../util/template';\nimport { getDefaultConfigFileName } from '../common';\nimport { OnboardingCommitMessageFactory } from './commit-message';\nimport { getOnboardingConfigContents } from './config';\n\nexport async function createOnboardingBranch(\n config: Partial<RenovateConfig>,\n): Promise<string | null> {\n logger.debug('createOnboardingBranch()');\n const configFile = getDefaultConfigFileName(config);\n // TODO #22198\n const contents = await getOnboardingConfigContents(config, configFile);\n logger.debug('Creating onboarding branch');\n\n const commitMessageFactory = new OnboardingCommitMessageFactory(\n config,\n configFile,\n );\n let commitMessage = commitMessageFactory.create().toString();\n\n if (config.commitBody) {\n commitMessage = `${commitMessage}\\n\\n${compile(\n config.commitBody,\n // only allow gitAuthor template value in the commitBody\n { gitAuthor: config.gitAuthor },\n )}`;\n\n logger.trace(`commitMessage: ${commitMessage}`);\n }\n\n // istanbul ignore if\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would commit files to onboarding branch');\n return null;\n }\n\n return scm.commitAndPush({\n baseBranch: config.baseBranch,\n branchName: config.onboardingBranch!,\n files: [\n {\n type: 'addition',\n // TODO #22198\n path: configFile,\n contents,\n },\n ],\n message: commitMessage,\n platformCommit: config.platformCommit,\n force: true,\n });\n}\n"]}
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/onboarding/branch/create.ts"],"names":[],"mappings":";;AASA,wDA+CC;AAxDD,sDAAyD;AAEzD,+CAA4C;AAC5C,0DAAuD;AACvD,wDAAoD;AACpD,sCAAqD;AACrD,qDAAkE;AAClE,q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KACtB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { GlobalConfig } from '../../../../config/global';\nimport type { RenovateConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport { scm } from '../../../../modules/platform/scm';\nimport { compile } from '../../../../util/template';\nimport { getDefaultConfigFileName } from '../common';\nimport { OnboardingCommitMessageFactory } from './commit-message';\nimport { getOnboardingConfigContents } from './config';\n\nexport async function createOnboardingBranch(\n config: Partial<RenovateConfig>,\n): Promise<string | null> {\n logger.debug('createOnboardingBranch()');\n const configFile = getDefaultConfigFileName(config);\n // TODO #22198\n const contents = await getOnboardingConfigContents(config, configFile);\n logger.debug('Creating onboarding branch');\n\n const commitMessageFactory = new OnboardingCommitMessageFactory(\n config,\n configFile,\n );\n let commitMessage = commitMessageFactory.create().toString();\n\n if (config.commitBody) {\n commitMessage = `${commitMessage}\\n\\n${compile(\n config.commitBody,\n // only allow gitAuthor template value in the commitBody\n { gitAuthor: config.gitAuthor },\n )}`;\n\n logger.trace(`commitMessage: ${commitMessage}`);\n }\n\n // istanbul ignore if\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would commit files to onboarding branch');\n return null;\n }\n\n return scm.commitAndPush({\n baseBranch: config.baseBranch,\n branchName: config.onboardingBranch!,\n files: [\n {\n type: 'addition',\n // TODO #22198\n path: configFile,\n contents,\n },\n ],\n message: commitMessage,\n platformCommit: config.platformCommit,\n force: true,\n labels: config.labels,\n });\n}\n"]}
@@ -43,6 +43,7 @@ async function rebaseOnboardingBranch(config, previousConfigHash) {
43
43
  ],
44
44
  message: commitMessage.toString(),
45
45
  platformCommit: config.platformCommit,
46
+ labels: config.labels,
46
47
  });
47
48
  }
48
49
  //# sourceMappingURL=rebase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rebase.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/onboarding/branch/rebase.ts"],"names":[],"mappings":";;AASA,wDAqDC;AA9DD,sDAAyD;AAEzD,+CAA4C;AAC5C,0DAA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,EAAE,MAAM,CAAC,UAAU;QAC7B,UAAU,EAAE,MAAM,CAAC,gBAAiB;QACpC,KAAK,EAAE;YACL;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,UAAU;gBAChB,QAAQ;aACT;SACF;QACD,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;QACjC,cAAc,EAAE,MAAM,CAAC,cAAc;KACtC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { GlobalConfig } from '../../../../config/global';\nimport type { RenovateConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport { scm } from '../../../../modules/platform/scm';\nimport { toSha256 } from '../../../../util/hash';\nimport { getDefaultConfigFileName } from '../common';\nimport { OnboardingCommitMessageFactory } from './commit-message';\nimport { getOnboardingConfigContents } from './config';\n\nexport async function rebaseOnboardingBranch(\n config: RenovateConfig,\n previousConfigHash: string | undefined,\n): Promise<string | null> {\n logger.debug('Checking if onboarding branch needs rebasing');\n\n // skip platforms that do not support html comments in pr\n const platform = GlobalConfig.get('platform')!;\n if (!['github', 'gitea', 'gitlab'].includes(platform)) {\n logger.debug(\n `Skipping rebase as ${platform} does not support html comments`,\n );\n return null;\n }\n\n const configFile = getDefaultConfigFileName(config);\n const contents = await getOnboardingConfigContents(config, configFile);\n const currentConfigHash = toSha256(contents);\n\n if (previousConfigHash === currentConfigHash) {\n logger.debug('No rebase needed');\n return null;\n }\n logger.debug(\n { previousConfigHash, currentConfigHash },\n 'Rebasing onboarding branch',\n );\n\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would rebase files in onboarding branch');\n return null;\n }\n\n const commitMessageFactory = new OnboardingCommitMessageFactory(\n config,\n configFile,\n );\n const commitMessage = commitMessageFactory.create();\n\n // TODO #22198\n return scm.commitAndPush({\n baseBranch: config.baseBranch,\n branchName: config.onboardingBranch!,\n files: [\n {\n type: 'addition',\n path: configFile,\n contents,\n },\n ],\n message: commitMessage.toString(),\n platformCommit: config.platformCommit,\n });\n}\n"]}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AC7D,MAAM,EACN,UAAU,CACX,CAAC;IACF,MAAM,aAAa,GAAG,oBAAoB,CAAC,MAAM,EAAE,CAAC;IAEpD,cAAc;IACd,OAAO,SAAG,CAAC,aAAa,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,UAAU,EAAE,MAAM,CAAC,gBAAiB;QACpC,KAAK,EAAE;YACL;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,UAAU;gBAChB,QAAQ;aACT;SACF;QACD,OAAO,EAAE,aAAa,CAAC,QAAQ,EAAE;QACjC,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { GlobalConfig } from '../../../../config/global';\nimport type { RenovateConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport { scm } from '../../../../modules/platform/scm';\nimport { toSha256 } from '../../../../util/hash';\nimport { getDefaultConfigFileName } from '../common';\nimport { OnboardingCommitMessageFactory } from './commit-message';\nimport { getOnboardingConfigContents } from './config';\n\nexport async function rebaseOnboardingBranch(\n config: RenovateConfig,\n previousConfigHash: string | undefined,\n): Promise<string | null> {\n logger.debug('Checking if onboarding branch needs rebasing');\n\n // skip platforms that do not support html comments in pr\n const platform = GlobalConfig.get('platform')!;\n if (!['github', 'gitea', 'gitlab'].includes(platform)) {\n logger.debug(\n `Skipping rebase as ${platform} does not support html comments`,\n );\n return null;\n }\n\n const configFile = getDefaultConfigFileName(config);\n const contents = await getOnboardingConfigContents(config, configFile);\n const currentConfigHash = toSha256(contents);\n\n if (previousConfigHash === currentConfigHash) {\n logger.debug('No rebase needed');\n return null;\n }\n logger.debug(\n { previousConfigHash, currentConfigHash },\n 'Rebasing onboarding branch',\n );\n\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would rebase files in onboarding branch');\n return null;\n }\n\n const commitMessageFactory = new OnboardingCommitMessageFactory(\n config,\n configFile,\n );\n const commitMessage = commitMessageFactory.create();\n\n // TODO #22198\n return scm.commitAndPush({\n baseBranch: config.baseBranch,\n branchName: config.onboardingBranch!,\n files: [\n {\n type: 'addition',\n path: configFile,\n contents,\n },\n ],\n message: commitMessage.toString(),\n platformCommit: config.platformCommit,\n labels: config.labels,\n });\n}\n"]}
@@ -11,9 +11,10 @@ function getSemanticCommitPrTitle(config) {
11
11
  return `${config.semanticCommitType ?? 'chore'}: ${config.onboardingPrTitle}`;
12
12
  }
13
13
  function getDefaultConfigFileName(config) {
14
- return app_strings_1.configFileNames.includes(config.onboardingConfigFileName)
14
+ const configFileNames = (0, app_strings_1.getConfigFileNames)();
15
+ return configFileNames.includes(config.onboardingConfigFileName)
15
16
  ? config.onboardingConfigFileName
16
- : app_strings_1.configFileNames[0];
17
+ : configFileNames[0];
17
18
  }
18
19
  class OnboardingState {
19
20
  static cacheKey = 'OnboardingState';