renovate 39.176.3 → 40.0.0-next.1

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 (244) hide show
  1. package/dist/config/migrations/custom/package-rules-migration.js.map +1 -1
  2. package/dist/config/migrations/migrations-service.d.ts +2 -2
  3. package/dist/config/migrations/migrations-service.js.map +1 -1
  4. package/dist/config/migrations/types.d.ts +1 -3
  5. package/dist/config/migrations/types.js.map +1 -1
  6. package/dist/config/options/index.js +1 -1
  7. package/dist/config/options/index.js.map +1 -1
  8. package/dist/config/presets/internal/group.js +0 -1
  9. package/dist/config/presets/internal/group.js.map +1 -1
  10. package/dist/config/presets/types.d.ts +4 -4
  11. package/dist/config/presets/types.js.map +1 -1
  12. package/dist/config-validator.js.map +1 -1
  13. package/dist/logger/utils.js +4 -2
  14. package/dist/logger/utils.js.map +1 -1
  15. package/dist/modules/datasource/artifactory/index.js +1 -1
  16. package/dist/modules/datasource/artifactory/index.js.map +1 -1
  17. package/dist/modules/datasource/conan/index.js +1 -1
  18. package/dist/modules/datasource/conan/index.js.map +1 -1
  19. package/dist/modules/datasource/crate/index.js.map +1 -1
  20. package/dist/modules/datasource/datasource.d.ts +1 -1
  21. package/dist/modules/datasource/datasource.js +3 -1
  22. package/dist/modules/datasource/datasource.js.map +1 -1
  23. package/dist/modules/datasource/deb/common.d.ts +3 -3
  24. package/dist/modules/datasource/deb/common.js.map +1 -1
  25. package/dist/modules/datasource/docker/ecr.js +1 -1
  26. package/dist/modules/datasource/docker/ecr.js.map +1 -1
  27. package/dist/modules/datasource/docker/index.js.map +1 -1
  28. package/dist/modules/datasource/hexpm-bob/index.js +1 -1
  29. package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
  30. package/dist/modules/datasource/nuget/v2.js +1 -1
  31. package/dist/modules/datasource/nuget/v2.js.map +1 -1
  32. package/dist/modules/datasource/pod/index.js +1 -2
  33. package/dist/modules/datasource/pod/index.js.map +1 -1
  34. package/dist/modules/datasource/rubygems/metadata-cache.js.map +1 -1
  35. package/dist/modules/datasource/sbt-plugin/index.js +1 -2
  36. package/dist/modules/datasource/sbt-plugin/index.js.map +1 -1
  37. package/dist/modules/manager/ansible-galaxy/collections-metadata.js +1 -2
  38. package/dist/modules/manager/ansible-galaxy/collections-metadata.js.map +1 -1
  39. package/dist/modules/manager/asdf/upgradeable-tooling.js +4 -4
  40. package/dist/modules/manager/asdf/upgradeable-tooling.js.map +1 -1
  41. package/dist/modules/manager/batect/extract.js.map +1 -1
  42. package/dist/modules/manager/bazel/artifacts.js +2 -2
  43. package/dist/modules/manager/bazel/artifacts.js.map +1 -1
  44. package/dist/modules/manager/bazel/common.js +1 -2
  45. package/dist/modules/manager/bazel/common.js.map +1 -1
  46. package/dist/modules/manager/bazel/parser.js +1 -1
  47. package/dist/modules/manager/bazel/parser.js.map +1 -1
  48. package/dist/modules/manager/bazel-module/parser/context.d.ts +4 -3
  49. package/dist/modules/manager/bazel-module/parser/context.js +9 -6
  50. package/dist/modules/manager/bazel-module/parser/context.js.map +1 -1
  51. package/dist/modules/manager/bazel-module/parser/extension-tags.js +10 -2
  52. package/dist/modules/manager/bazel-module/parser/extension-tags.js.map +1 -1
  53. package/dist/modules/manager/bazel-module/parser/fragments.d.ts +20 -2
  54. package/dist/modules/manager/bazel-module/parser/fragments.js +8 -2
  55. package/dist/modules/manager/bazel-module/parser/fragments.js.map +1 -1
  56. package/dist/modules/manager/bazel-module/parser/index.js +1 -1
  57. package/dist/modules/manager/bazel-module/parser/index.js.map +1 -1
  58. package/dist/modules/manager/bazel-module/parser/maven.d.ts +16 -0
  59. package/dist/modules/manager/bazel-module/parser/oci.d.ts +8 -0
  60. package/dist/modules/manager/bazel-module/parser/oci.js +4 -1
  61. package/dist/modules/manager/bazel-module/parser/oci.js.map +1 -1
  62. package/dist/modules/manager/bun/artifacts.js +1 -1
  63. package/dist/modules/manager/bun/artifacts.js.map +1 -1
  64. package/dist/modules/manager/bundler/extract.js.map +1 -1
  65. package/dist/modules/manager/cargo/artifacts.js +1 -1
  66. package/dist/modules/manager/cargo/artifacts.js.map +1 -1
  67. package/dist/modules/manager/cargo/extract.js.map +1 -1
  68. package/dist/modules/manager/cargo/types.d.ts +1 -3
  69. package/dist/modules/manager/cargo/types.js.map +1 -1
  70. package/dist/modules/manager/composer/utils.js +4 -4
  71. package/dist/modules/manager/composer/utils.js.map +1 -1
  72. package/dist/modules/manager/deps-edn/extract.js +3 -3
  73. package/dist/modules/manager/deps-edn/extract.js.map +1 -1
  74. package/dist/modules/manager/deps-edn/types.js.map +1 -1
  75. package/dist/modules/manager/dockerfile/extract.js +2 -3
  76. package/dist/modules/manager/dockerfile/extract.js.map +1 -1
  77. package/dist/modules/manager/fingerprint.generated.js +17 -17
  78. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  79. package/dist/modules/manager/flux/types.d.ts +3 -3
  80. package/dist/modules/manager/flux/types.js.map +1 -1
  81. package/dist/modules/manager/git-submodules/types.d.ts +2 -2
  82. package/dist/modules/manager/git-submodules/types.js.map +1 -1
  83. package/dist/modules/manager/github-actions/extract.js +2 -2
  84. package/dist/modules/manager/github-actions/extract.js.map +1 -1
  85. package/dist/modules/manager/glasskube/types.d.ts +2 -2
  86. package/dist/modules/manager/glasskube/types.js.map +1 -1
  87. package/dist/modules/manager/gleam/artifacts.js +1 -1
  88. package/dist/modules/manager/gleam/artifacts.js.map +1 -1
  89. package/dist/modules/manager/gradle/utils.js +6 -2
  90. package/dist/modules/manager/gradle/utils.js.map +1 -1
  91. package/dist/modules/manager/haskell-cabal/extract.js +1 -1
  92. package/dist/modules/manager/haskell-cabal/extract.js.map +1 -1
  93. package/dist/modules/manager/helmfile/artifacts.js +1 -1
  94. package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
  95. package/dist/modules/manager/helmfile/extract.js +2 -2
  96. package/dist/modules/manager/helmfile/extract.js.map +1 -1
  97. package/dist/modules/manager/helmv3/artifacts.js +1 -1
  98. package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
  99. package/dist/modules/manager/helmv3/extract.js.map +1 -1
  100. package/dist/modules/manager/helmv3/utils.js +1 -1
  101. package/dist/modules/manager/helmv3/utils.js.map +1 -1
  102. package/dist/modules/manager/homebrew/util.js +1 -2
  103. package/dist/modules/manager/homebrew/util.js.map +1 -1
  104. package/dist/modules/manager/jsonnet-bundler/extract.js +1 -1
  105. package/dist/modules/manager/jsonnet-bundler/extract.js.map +1 -1
  106. package/dist/modules/manager/leiningen/extract.js +1 -2
  107. package/dist/modules/manager/leiningen/extract.js.map +1 -1
  108. package/dist/modules/manager/maven/extract.js.map +1 -1
  109. package/dist/modules/manager/maven/update.js.map +1 -1
  110. package/dist/modules/manager/mise/upgradeable-tooling.js +7 -7
  111. package/dist/modules/manager/mise/upgradeable-tooling.js.map +1 -1
  112. package/dist/modules/manager/nix/extract.js +1 -1
  113. package/dist/modules/manager/nix/extract.js.map +1 -1
  114. package/dist/modules/manager/npm/extract/pnpm.js +1 -1
  115. package/dist/modules/manager/npm/extract/pnpm.js.map +1 -1
  116. package/dist/modules/manager/npm/post-update/index.js +1 -1
  117. package/dist/modules/manager/npm/post-update/index.js.map +1 -1
  118. package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
  119. package/dist/modules/manager/npm/update/dependency/index.js +1 -1
  120. package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
  121. package/dist/modules/manager/nuget/config-formatter.js +1 -2
  122. package/dist/modules/manager/nuget/config-formatter.js.map +1 -1
  123. package/dist/modules/manager/nuget/package-tree.js +1 -1
  124. package/dist/modules/manager/nuget/package-tree.js.map +1 -1
  125. package/dist/modules/manager/nuget/util.js +2 -2
  126. package/dist/modules/manager/nuget/util.js.map +1 -1
  127. package/dist/modules/manager/osgi/extract.js +3 -3
  128. package/dist/modules/manager/osgi/extract.js.map +1 -1
  129. package/dist/modules/manager/pep621/processors/pdm.js +1 -1
  130. package/dist/modules/manager/pep621/processors/pdm.js.map +1 -1
  131. package/dist/modules/manager/pep621/processors/uv.js +3 -2
  132. package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
  133. package/dist/modules/manager/pip-compile/artifacts.js +8 -2
  134. package/dist/modules/manager/pip-compile/artifacts.js.map +1 -1
  135. package/dist/modules/manager/pip-compile/common.d.ts +5 -3
  136. package/dist/modules/manager/pip-compile/common.js +34 -13
  137. package/dist/modules/manager/pip-compile/common.js.map +1 -1
  138. package/dist/modules/manager/pip-compile/extract.js.map +1 -1
  139. package/dist/modules/manager/pip-compile/types.d.ts +1 -0
  140. package/dist/modules/manager/pip-compile/types.js.map +1 -1
  141. package/dist/modules/manager/poetry/artifacts.js +2 -2
  142. package/dist/modules/manager/poetry/artifacts.js.map +1 -1
  143. package/dist/modules/manager/pre-commit/types.d.ts +2 -2
  144. package/dist/modules/manager/pre-commit/types.js.map +1 -1
  145. package/dist/modules/manager/pub/artifacts.js +1 -1
  146. package/dist/modules/manager/pub/artifacts.js.map +1 -1
  147. package/dist/modules/manager/swift/extract.js +1 -2
  148. package/dist/modules/manager/swift/extract.js.map +1 -1
  149. package/dist/modules/manager/terraform/extractors/terraform-block/required-provider.js +2 -2
  150. package/dist/modules/manager/terraform/extractors/terraform-block/required-provider.js.map +1 -1
  151. package/dist/modules/manager/terraform/hcl/types.d.ts +1 -3
  152. package/dist/modules/manager/terraform/hcl/types.js.map +1 -1
  153. package/dist/modules/manager/terraform/lockfile/index.js +1 -1
  154. package/dist/modules/manager/terraform/lockfile/index.js.map +1 -1
  155. package/dist/modules/manager/terragrunt/artifacts.js +1 -1
  156. package/dist/modules/manager/terragrunt/artifacts.js.map +1 -1
  157. package/dist/modules/manager/types.d.ts +1 -0
  158. package/dist/modules/manager/types.js.map +1 -1
  159. package/dist/modules/manager/woodpecker/types.d.ts +2 -2
  160. package/dist/modules/manager/woodpecker/types.js.map +1 -1
  161. package/dist/modules/platform/azure/azure-helper.js.map +1 -1
  162. package/dist/modules/platform/azure/index.js +1 -1
  163. package/dist/modules/platform/azure/index.js.map +1 -1
  164. package/dist/modules/platform/bitbucket/index.js.map +1 -1
  165. package/dist/modules/platform/bitbucket/utils.js.map +1 -1
  166. package/dist/modules/platform/bitbucket-server/index.js +2 -2
  167. package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
  168. package/dist/modules/platform/gerrit/scm.js +1 -1
  169. package/dist/modules/platform/gerrit/scm.js.map +1 -1
  170. package/dist/modules/platform/gitea/index.js +6 -5
  171. package/dist/modules/platform/gitea/index.js.map +1 -1
  172. package/dist/modules/platform/gitea/pr-cache.d.ts +3 -2
  173. package/dist/modules/platform/gitea/pr-cache.js +21 -12
  174. package/dist/modules/platform/gitea/pr-cache.js.map +1 -1
  175. package/dist/modules/platform/github/index.js.map +1 -1
  176. package/dist/modules/platform/gitlab/index.js +20 -16
  177. package/dist/modules/platform/gitlab/index.js.map +1 -1
  178. package/dist/modules/platform/types.d.ts +2 -2
  179. package/dist/modules/platform/types.js.map +1 -1
  180. package/dist/modules/versioning/bazel-module/bzlmod-version.d.ts +1 -1
  181. package/dist/modules/versioning/bazel-module/bzlmod-version.js.map +1 -1
  182. package/dist/modules/versioning/generic.d.ts +2 -6
  183. package/dist/modules/versioning/generic.js.map +1 -1
  184. package/dist/modules/versioning/gradle/compare.d.ts +2 -2
  185. package/dist/modules/versioning/gradle/compare.js.map +1 -1
  186. package/dist/modules/versioning/gradle/index.js +1 -1
  187. package/dist/modules/versioning/gradle/index.js.map +1 -1
  188. package/dist/modules/versioning/pvp/range.js +2 -2
  189. package/dist/modules/versioning/pvp/range.js.map +1 -1
  190. package/dist/modules/versioning/rpm/index.js +5 -5
  191. package/dist/modules/versioning/rpm/index.js.map +1 -1
  192. package/dist/modules/versioning/semver-coerced/index.js +4 -4
  193. package/dist/modules/versioning/semver-coerced/index.js.map +1 -1
  194. package/dist/modules/versioning/types.d.ts +1 -3
  195. package/dist/modules/versioning/types.js.map +1 -1
  196. package/dist/types/git.d.ts +2 -2
  197. package/dist/types/git.js.map +1 -1
  198. package/dist/types/platform/github/index.d.ts +4 -4
  199. package/dist/types/platform/github/index.js.map +1 -1
  200. package/dist/types/platform/gitlab/index.d.ts +2 -2
  201. package/dist/types/platform/gitlab/index.js.map +1 -1
  202. package/dist/util/assign-keys.d.ts +1 -3
  203. package/dist/util/assign-keys.js.map +1 -1
  204. package/dist/util/cache/repository/http-cache.js +1 -1
  205. package/dist/util/cache/repository/http-cache.js.map +1 -1
  206. package/dist/util/exec/types.d.ts +2 -2
  207. package/dist/util/exec/types.js.map +1 -1
  208. package/dist/util/git/auth.js +1 -1
  209. package/dist/util/git/auth.js.map +1 -1
  210. package/dist/util/git/index.d.ts +10 -10
  211. package/dist/util/git/index.js +22 -26
  212. package/dist/util/git/index.js.map +1 -1
  213. package/dist/util/http/bitbucket.js.map +1 -1
  214. package/dist/util/http/cache/abstract-http-cache-provider.js +1 -1
  215. package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
  216. package/dist/util/http/index.js.map +1 -1
  217. package/dist/util/http/types.d.ts +3 -5
  218. package/dist/util/http/types.js.map +1 -1
  219. package/dist/util/pretty-time.js.map +1 -1
  220. package/dist/util/schema-utils.js.map +1 -1
  221. package/dist/util/stats.js +1 -0
  222. package/dist/util/stats.js.map +1 -1
  223. package/dist/workers/repository/dependency-dashboard.js +2 -2
  224. package/dist/workers/repository/dependency-dashboard.js.map +1 -1
  225. package/dist/workers/repository/init/config.d.ts +1 -2
  226. package/dist/workers/repository/init/config.js +0 -13
  227. package/dist/workers/repository/init/config.js.map +1 -1
  228. package/dist/workers/repository/init/merge.d.ts +2 -1
  229. package/dist/workers/repository/init/merge.js +13 -3
  230. package/dist/workers/repository/init/merge.js.map +1 -1
  231. package/dist/workers/repository/model/commit-message.js.map +1 -1
  232. package/dist/workers/repository/process/vulnerabilities.js +3 -1
  233. package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
  234. package/dist/workers/repository/process/write.js +1 -1
  235. package/dist/workers/repository/process/write.js.map +1 -1
  236. package/dist/workers/repository/reconfigure/validate.js +3 -1
  237. package/dist/workers/repository/reconfigure/validate.js.map +1 -1
  238. package/dist/workers/repository/update/branch/schedule.js +1 -1
  239. package/dist/workers/repository/update/branch/schedule.js.map +1 -1
  240. package/dist/workers/repository/update/pr/body/updates-table.js.map +1 -1
  241. package/dist/workers/repository/updates/generate.js +9 -0
  242. package/dist/workers/repository/updates/generate.js.map +1 -1
  243. package/package.json +32 -25
  244. package/renovate-schema.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/types/platform/gitlab/index.ts"],"names":[],"mappings":"","sourcesContent":["import type { GitTreeNode } from '../../git';\n\nexport type GitLabBranch = {\n default: boolean;\n name: string;\n};\n\n/**\n * https://docs.gitlab.com/13.2/ee/api/repositories.html#list-repository-tree\n */\nexport type GitlabTreeNode = {\n id: string;\n name: string;\n} & GitTreeNode;\n\n/**\n * https://docs.gitlab.com/ee/api/projects.html#get-single-project\n */\nexport interface GitlabProject {\n default_branch: string;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/types/platform/gitlab/index.ts"],"names":[],"mappings":"","sourcesContent":["import type { GitTreeNode } from '../../git';\n\nexport interface GitLabBranch {\n default: boolean;\n name: string;\n}\n\n/**\n * https://docs.gitlab.com/13.2/ee/api/repositories.html#list-repository-tree\n */\nexport type GitlabTreeNode = {\n id: string;\n name: string;\n} & GitTreeNode;\n\n/**\n * https://docs.gitlab.com/ee/api/projects.html#get-single-project\n */\nexport interface GitlabProject {\n default_branch: string;\n}\n"]}
@@ -1,8 +1,6 @@
1
1
  /**
2
2
  * Assigns non-nullish values from `right` to `left` for the given `keys`.
3
3
  */
4
- export declare function assignKeys<Left extends {
5
- [key in K]?: unknown;
6
- }, Right extends {
4
+ export declare function assignKeys<Left extends Partial<Record<K, unknown>>, Right extends {
7
5
  [key in K]?: Left[key];
8
6
  }, K extends keyof Right>(left: Left, right: Right, keys: K[]): Left;
@@ -1 +1 @@
1
- {"version":3,"file":"assign-keys.js","sourceRoot":"","sources":["../../lib/util/assign-keys.ts"],"names":[],"mappings":";;AAKA,gCAYC;;AAjBD,kEAAkC;AAElC;;GAEG;AACH,SAAgB,UAAU,CAIxB,IAAU,EAAE,KAAY,EAAE,IAAS;IACnC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,YAAE,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,GAAG,GAAkC,CAAC;QACjD,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import is from '@sindresorhus/is';\n\n/**\n * Assigns non-nullish values from `right` to `left` for the given `keys`.\n */\nexport function assignKeys<\n Left extends { [key in K]?: unknown },\n Right extends { [key in K]?: Left[key] },\n K extends keyof Right,\n>(left: Left, right: Right, keys: K[]): Left {\n for (const key of keys) {\n const val = right[key];\n if (!is.nullOrUndefined(val)) {\n left[key] = val as unknown as Left[typeof key];\n }\n }\n return left;\n}\n"]}
1
+ {"version":3,"file":"assign-keys.js","sourceRoot":"","sources":["../../lib/util/assign-keys.ts"],"names":[],"mappings":";;AAKA,gCAYC;;AAjBD,kEAAkC;AAElC;;GAEG;AACH,SAAgB,UAAU,CAIxB,IAAU,EAAE,KAAY,EAAE,IAAS;IACnC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,YAAE,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,GAAG,CAAC,GAAG,GAAkC,CAAC;QACjD,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import is from '@sindresorhus/is';\n\n/**\n * Assigns non-nullish values from `right` to `left` for the given `keys`.\n */\nexport function assignKeys<\n Left extends Partial<Record<K, unknown>>,\n Right extends { [key in K]?: Left[key] },\n K extends keyof Right,\n>(left: Left, right: Right, keys: K[]): Left {\n for (const key of keys) {\n const val = right[key];\n if (!is.nullOrUndefined(val)) {\n left[key] = val as unknown as Left[typeof key];\n }\n }\n return left;\n}\n"]}
@@ -14,7 +14,7 @@ function cleanupHttpCache(cacheData) {
14
14
  const ttlDays = global_1.GlobalConfig.get('httpCacheTtlDays', 90);
15
15
  if (ttlDays === 0) {
16
16
  logger_1.logger.trace('cleanupHttpCache: zero value received, removing the cache');
17
- delete cacheData['httpCache'];
17
+ delete cacheData.httpCache;
18
18
  return;
19
19
  }
20
20
  const now = luxon_1.DateTime.now();
@@ -1 +1 @@
1
- {"version":3,"file":"http-cache.js","sourceRoot":"","sources":["../../../../lib/util/cache/repository/http-cache.ts"],"names":[],"mappings":";;AAMA,4CA0BC;AAhCD,iCAAiC;AACjC,mDAAsD;AACtD,4CAAyC;AACzC,oDAA0D;AAG1D,SAAgB,gBAAgB,CAAC,SAAwB;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IAChC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,eAAM,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAC5D,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,qBAAY,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACzD,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;QAClB,eAAM,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;QAC1E,OAAO,SAAS,CAAC,WAAW,CAAC,CAAC;QAC9B,OAAO;IACT,CAAC;IAED,MAAM,GAAG,GAAG,gBAAQ,CAAC,GAAG,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,wBAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAClC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACzB,MAAM,MAAM,GAAG,gBAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;YACxE,IAAI,MAAM,GAAG,GAAG,EAAE,CAAC;gBACjB,eAAM,CAAC,KAAK,CAAC,0CAA0C,GAAG,EAAE,CAAC,CAAC;gBAC9D,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { DateTime } from 'luxon';\nimport { GlobalConfig } from '../../../config/global';\nimport { logger } from '../../../logger';\nimport { HttpCacheSchema } from '../../http/cache/schema';\nimport type { RepoCacheData } from './types';\n\nexport function cleanupHttpCache(cacheData: RepoCacheData): void {\n const { httpCache } = cacheData;\n if (!httpCache) {\n logger.trace('cleanupHttpCache: no http cache to clean up');\n return;\n }\n\n const ttlDays = GlobalConfig.get('httpCacheTtlDays', 90);\n if (ttlDays === 0) {\n logger.trace('cleanupHttpCache: zero value received, removing the cache');\n delete cacheData['httpCache'];\n return;\n }\n\n const now = DateTime.now();\n for (const [url, item] of Object.entries(httpCache)) {\n const parsed = HttpCacheSchema.safeParse(item);\n if (parsed.success && parsed.data) {\n const item = parsed.data;\n const expiry = DateTime.fromISO(item.timestamp).plus({ days: ttlDays });\n if (expiry < now) {\n logger.debug(`http cache: removing expired cache for ${url}`);\n delete httpCache[url];\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"http-cache.js","sourceRoot":"","sources":["../../../../lib/util/cache/repository/http-cache.ts"],"names":[],"mappings":";;AAMA,4CA0BC;AAhCD,iCAAiC;AACjC,mDAAsD;AACtD,4CAAyC;AACzC,oDAA0D;AAG1D,SAAgB,gBAAgB,CAAC,SAAwB;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IAChC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,eAAM,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAC5D,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,qBAAY,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACzD,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;QAClB,eAAM,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;QAC1E,OAAO,SAAS,CAAC,SAAS,CAAC;QAC3B,OAAO;IACT,CAAC;IAED,MAAM,GAAG,GAAG,gBAAQ,CAAC,GAAG,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,wBAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;YAClC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACzB,MAAM,MAAM,GAAG,gBAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;YACxE,IAAI,MAAM,GAAG,GAAG,EAAE,CAAC;gBACjB,eAAM,CAAC,KAAK,CAAC,0CAA0C,GAAG,EAAE,CAAC,CAAC;gBAC9D,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { DateTime } from 'luxon';\nimport { GlobalConfig } from '../../../config/global';\nimport { logger } from '../../../logger';\nimport { HttpCacheSchema } from '../../http/cache/schema';\nimport type { RepoCacheData } from './types';\n\nexport function cleanupHttpCache(cacheData: RepoCacheData): void {\n const { httpCache } = cacheData;\n if (!httpCache) {\n logger.trace('cleanupHttpCache: no http cache to clean up');\n return;\n }\n\n const ttlDays = GlobalConfig.get('httpCacheTtlDays', 90);\n if (ttlDays === 0) {\n logger.trace('cleanupHttpCache: zero value received, removing the cache');\n delete cacheData.httpCache;\n return;\n }\n\n const now = DateTime.now();\n for (const [url, item] of Object.entries(httpCache)) {\n const parsed = HttpCacheSchema.safeParse(item);\n if (parsed.success && parsed.data) {\n const item = parsed.data;\n const expiry = DateTime.fromISO(item.timestamp).plus({ days: ttlDays });\n if (expiry < now) {\n logger.debug(`http cache: removing expired cache for ${url}`);\n delete httpCache[url];\n }\n }\n }\n}\n"]}
@@ -20,10 +20,10 @@ export interface DockerOptions {
20
20
  cwd?: Opt<string>;
21
21
  }
22
22
  export type DataListener = (chunk: any) => void;
23
- export type OutputListeners = {
23
+ export interface OutputListeners {
24
24
  stdout?: DataListener[];
25
25
  stderr?: DataListener[];
26
- };
26
+ }
27
27
  export interface RawExecOptions extends ChildProcessSpawnOptions {
28
28
  /**
29
29
  * @deprecated renovate uses utf8, encoding property is ignored.
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/util/exec/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpawnOptions as ChildProcessSpawnOptions } from 'node:child_process';\nimport type { UserEnv } from '../../config/types';\n\nexport interface ToolConstraint {\n toolName: string;\n constraint?: string | null;\n}\n\nexport interface ToolConfig {\n datasource: string;\n extractVersion?: string;\n packageName: string;\n hash?: boolean;\n versioning: string;\n}\n\nexport type Opt<T> = T | null | undefined;\n\nexport type VolumesPair = [string, string];\nexport type VolumeOption = Opt<string | VolumesPair>;\n\nexport interface DockerOptions {\n volumes?: Opt<VolumeOption[]>;\n envVars?: Opt<Opt<string>[]>;\n cwd?: Opt<string>;\n}\n\nexport type DataListener = (chunk: any) => void;\nexport type OutputListeners = {\n stdout?: DataListener[];\n stderr?: DataListener[];\n};\n\nexport interface RawExecOptions extends ChildProcessSpawnOptions {\n // TODO: to be removed in #16655\n /**\n * @deprecated renovate uses utf8, encoding property is ignored.\n */\n encoding: string;\n maxBuffer?: number | undefined;\n cwd?: string;\n outputListeners?: OutputListeners;\n}\n\nexport interface ExecResult {\n stdout: string;\n stderr: string;\n}\n\nexport type ExtraEnv<T = unknown> = Record<string, T>;\n\nexport interface ExecOptions {\n cwd?: string;\n cwdFile?: string;\n env?: Opt<ExtraEnv>;\n userConfiguredEnv?: UserEnv;\n extraEnv?: Opt<ExtraEnv>;\n docker?: Opt<DockerOptions>;\n toolConstraints?: Opt<ToolConstraint[]>;\n preCommands?: Opt<string[]>;\n ignoreStdout?: boolean;\n // Following are pass-through to child process\n maxBuffer?: number | undefined;\n timeout?: number | undefined;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/util/exec/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SpawnOptions as ChildProcessSpawnOptions } from 'node:child_process';\nimport type { UserEnv } from '../../config/types';\n\nexport interface ToolConstraint {\n toolName: string;\n constraint?: string | null;\n}\n\nexport interface ToolConfig {\n datasource: string;\n extractVersion?: string;\n packageName: string;\n hash?: boolean;\n versioning: string;\n}\n\nexport type Opt<T> = T | null | undefined;\n\nexport type VolumesPair = [string, string];\nexport type VolumeOption = Opt<string | VolumesPair>;\n\nexport interface DockerOptions {\n volumes?: Opt<VolumeOption[]>;\n envVars?: Opt<Opt<string>[]>;\n cwd?: Opt<string>;\n}\n\nexport type DataListener = (chunk: any) => void;\nexport interface OutputListeners {\n stdout?: DataListener[];\n stderr?: DataListener[];\n}\n\nexport interface RawExecOptions extends ChildProcessSpawnOptions {\n // TODO: to be removed in #16655\n /**\n * @deprecated renovate uses utf8, encoding property is ignored.\n */\n encoding: string;\n maxBuffer?: number | undefined;\n cwd?: string;\n outputListeners?: OutputListeners;\n}\n\nexport interface ExecResult {\n stdout: string;\n stderr: string;\n}\n\nexport type ExtraEnv<T = unknown> = Record<string, T>;\n\nexport interface ExecOptions {\n cwd?: string;\n cwdFile?: string;\n env?: Opt<ExtraEnv>;\n userConfiguredEnv?: UserEnv;\n extraEnv?: Opt<ExtraEnv>;\n docker?: Opt<DockerOptions>;\n toolConstraints?: Opt<ToolConstraint[]>;\n preCommands?: Opt<string[]>;\n ignoreStdout?: boolean;\n // Following are pass-through to child process\n maxBuffer?: number | undefined;\n timeout?: number | undefined;\n}\n"]}
@@ -60,7 +60,7 @@ function getGitAuthenticatedEnvironmentVariables(originalGitUrl, { token, userna
60
60
  rule.insteadOf;
61
61
  gitConfigCount++;
62
62
  }
63
- newEnvironmentVariables['GIT_CONFIG_COUNT'] = gitConfigCount.toString();
63
+ newEnvironmentVariables.GIT_CONFIG_COUNT = gitConfigCount.toString();
64
64
  return newEnvironmentVariables;
65
65
  }
66
66
  function getAuthenticationRulesWithToken(url, hostType, authToken) {
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../lib/util/git/auth.ts"],"names":[],"mappings":";;AAqBA,0FAgEC;AAyBD,wDAsDC;AAED,gEAyCC;AA/MD,yDAAgE;AAChE,yCAAsC;AAEtC,sCAA2C;AAC3C,8CAA6C;AAC7C,oCAAiC;AACjC,gCAA2D;AAE3D,+BAAoC;AAEpC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,YAAY;IACZ,gBAAgB;IAChB,wBAAwB;IACxB,yBAAyB;CAC1B,CAAC,CAAC;AAEH;;;GAGG;AACH,SAAgB,uCAAuC,CACrD,cAAsB,EACtB,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAY,EAC5D,oBAAwC;IAExC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,CAAC;QACtC,eAAM,CAAC,IAAI,CACT,EAAE,IAAI,EAAE,SAAS,EAAE,EACnB,kGAAkG,CACnG,CAAC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AAC,QAAQ,CAAC,SAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;IACxE,IAAI,IAAA,eAAS,EAAC,OAAO,CAAC,EAAE,CAAC;QACvB,eAAM,CAAC,KAAK,CAAC,iCAAiC,OAAO,oBAAoB,CAAC,CAAC;QAC3E,oBAAoB,GAAG,uCAAuC,CAC5D,OAAQ,EACR,QAAQ,EACR,oBAAoB,CACrB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,eAAM,CAAC,KAAK,CACV,+BAA+B,QAAQ,CAAC,SAAU,iCAAiC,CACpF,CAAC;IACJ,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC","sourcesContent":["import { PLATFORM_HOST_TYPES } from '../../constants/platforms';\nimport { logger } from '../../logger';\nimport type { HostRule } from '../../types';\nimport { detectPlatform } from '../common';\nimport { find, getAll } from '../host-rules';\nimport { regEx } from '../regex';\nimport { createURLFromHostOrURL, isHttpUrl } from '../url';\nimport type { AuthenticationRule } from './types';\nimport { parseGitUrl } from './url';\n\nconst githubApiUrls = new Set([\n 'github.com',\n 'api.github.com',\n 'https://api.github.com',\n 'https://api.github.com/',\n]);\n\n/**\n * Add authorization to a Git Url and returns a new environment variables object\n * @returns a new NodeJS.ProcessEnv object without modifying any input parameters\n */\nexport function getGitAuthenticatedEnvironmentVariables(\n originalGitUrl: string,\n { token, username, password, hostType, matchHost }: HostRule,\n environmentVariables?: NodeJS.ProcessEnv,\n): NodeJS.ProcessEnv {\n if (!token && !(username && password)) {\n logger.warn(\n { host: matchHost },\n `Could not create environment variable for host as neither token or username and password was set`,\n );\n return { ...environmentVariables };\n }\n\n // check if the environmentVariables already contain a GIT_CONFIG_COUNT or if the process has one\n const gitConfigCountEnvVariable =\n environmentVariables?.GIT_CONFIG_COUNT ?? process.env.GIT_CONFIG_COUNT;\n let gitConfigCount = 0;\n if (gitConfigCountEnvVariable) {\n // passthrough the gitConfigCountEnvVariable environment variable as start value of the index count\n gitConfigCount = parseInt(gitConfigCountEnvVariable, 10);\n if (Number.isNaN(gitConfigCount)) {\n logger.warn(\n {\n GIT_CONFIG_COUNT: process.env.GIT_CONFIG_COUNT,\n },\n `Found GIT_CONFIG_COUNT env variable, but couldn't parse the value to an integer. Ignoring it.`,\n );\n gitConfigCount = 0;\n }\n }\n let authenticationRules: AuthenticationRule[];\n if (token) {\n authenticationRules = getAuthenticationRulesWithToken(\n originalGitUrl,\n hostType,\n token,\n );\n } else {\n const encodedUsername = encodeURIComponent(username!);\n const encodedPassword = encodeURIComponent(password!);\n\n authenticationRules = getAuthenticationRules(\n originalGitUrl,\n hostType,\n `${encodedUsername}:${encodedPassword}`,\n );\n }\n\n // create a shallow copy of the environmentVariables as base so we don't modify the input parameter object\n // add the two new config key and value to the returnEnvironmentVariables object\n // increase the CONFIG_COUNT by one for each rule and add it to the object\n const newEnvironmentVariables = {\n ...environmentVariables,\n };\n for (const rule of authenticationRules) {\n newEnvironmentVariables[`GIT_CONFIG_KEY_${gitConfigCount}`] =\n `url.${rule.url}.insteadOf`;\n newEnvironmentVariables[`GIT_CONFIG_VALUE_${gitConfigCount}`] =\n rule.insteadOf;\n gitConfigCount++;\n }\n newEnvironmentVariables['GIT_CONFIG_COUNT'] = gitConfigCount.toString();\n\n return newEnvironmentVariables;\n}\n\nfunction getAuthenticationRulesWithToken(\n url: string,\n hostType: string | undefined | null,\n authToken: string,\n): AuthenticationRule[] {\n let token = authToken;\n let type = hostType;\n if (!type) {\n type = detectPlatform(url);\n }\n if (type === 'gitlab') {\n token = `gitlab-ci-token:${authToken}`;\n }\n return getAuthenticationRules(url, type, token);\n}\n\n/**\n * Generates the authentication rules for later git usage for the given host\n * @link https://coolaj86.com/articles/vanilla-devops-git-credentials-cheatsheet/\n * @param gitUrl Git repository URL\n * @param hostType Git host type\n * @param token Authentication token or `username:password` string\n */\nexport function getAuthenticationRules(\n gitUrl: string,\n hostType: string | undefined | null,\n token: string,\n): AuthenticationRule[] {\n const authenticationRules = [];\n const hasUser = token.split(':').length > 1;\n const insteadUrl = parseGitUrl(gitUrl);\n let sshPort = insteadUrl.port;\n\n if (hostType === 'bitbucket-server') {\n // For Bitbucket Server/Data Center, `source` must be `bitbucket-server`\n // to generate HTTP(s) URLs correctly.\n // https://github.com/IonicaBizau/git-url-parse/blob/28828546c148d58bbcff61409915a4e1e8f7eb11/lib/index.js#L304\n insteadUrl.source = 'bitbucket-server';\n\n if (!sshPort) {\n // By default, bitbucket-server SSH port is 7999.\n // For non-default port, the generated auth config will likely be incorrect.\n sshPort = 7999;\n }\n }\n\n const url = { ...insteadUrl };\n const protocol = regEx(/^https?$/).test(url.protocol)\n ? url.protocol\n : 'https';\n\n // ssh protocol with user if empty\n url.token = hasUser ? token : `ssh:${token}`;\n authenticationRules.push({\n url: url.toString(protocol),\n // only edge case, need to stringify ourself because the exact syntax is not supported by the library\n // https://github.com/IonicaBizau/git-url-parse/blob/246c9119fb42c2ea1c280028fe77c53eb34c190c/lib/index.js#L246\n insteadOf: `ssh://git@${insteadUrl.resource}${\n sshPort ? `:${sshPort}` : ''\n }/${insteadUrl.full_name}${insteadUrl.git_suffix ? '.git' : ''}`,\n });\n\n // alternative ssh protocol with user if empty\n url.token = hasUser ? token : `git:${token}`;\n authenticationRules.push({\n url: url.toString(protocol),\n insteadOf: { ...insteadUrl, port: sshPort }.toString('ssh'),\n });\n\n // https protocol with no user as default fallback\n url.token = token;\n authenticationRules.push({\n url: url.toString(protocol),\n insteadOf: insteadUrl.toString(protocol),\n });\n\n return authenticationRules;\n}\n\nexport function getGitEnvironmentVariables(\n additionalHostTypes: string[] = [],\n): NodeJS.ProcessEnv {\n let environmentVariables: NodeJS.ProcessEnv = {};\n\n // hard-coded logic to use authentication for github.com based on the githubToken for api.github.com\n const gitHubHostRule = find({\n hostType: 'github',\n url: 'https://api.github.com/',\n });\n\n if (gitHubHostRule?.token) {\n environmentVariables = getGitAuthenticatedEnvironmentVariables(\n 'https://github.com/',\n gitHubHostRule,\n );\n }\n\n // construct the Set of allowed hostTypes consisting of the standard Git provides\n // plus additionalHostTypes, which are provided as parameter\n const gitAllowedHostTypes = new Set<string>([\n ...PLATFORM_HOST_TYPES,\n ...additionalHostTypes,\n ]);\n\n // filter rules without `matchHost` and `token` or username and password and github api github rules\n const hostRules = getAll()\n .filter((r) => r.matchHost && (r.token ?? (r.username && r.password)))\n .filter((r) => !gitHubHostRule || !githubApiUrls.has(r.matchHost!));\n\n // for each hostRule without hostType we add additional authentication variables to the environmentVariables\n // for each hostRule with hostType we add additional authentication variables to the environmentVariables\n for (const hostRule of hostRules) {\n if (!hostRule.hostType || gitAllowedHostTypes.has(hostRule.hostType)) {\n environmentVariables = addAuthFromHostRule(\n hostRule,\n environmentVariables,\n );\n }\n }\n return environmentVariables;\n}\n\nfunction addAuthFromHostRule(\n hostRule: HostRule,\n env: NodeJS.ProcessEnv,\n): NodeJS.ProcessEnv {\n let environmentVariables = env;\n const httpUrl = createURLFromHostOrURL(hostRule.matchHost!)?.toString();\n if (isHttpUrl(httpUrl)) {\n logger.trace(`Adding Git authentication for ${httpUrl} using token auth.`);\n environmentVariables = getGitAuthenticatedEnvironmentVariables(\n httpUrl!,\n hostRule,\n environmentVariables,\n );\n } else {\n logger.debug(\n `Could not parse registryUrl ${hostRule.matchHost!} or not using http(s). Ignoring`,\n );\n }\n return environmentVariables;\n}\n"]}
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../lib/util/git/auth.ts"],"names":[],"mappings":";;AAqBA,0FAgEC;AAyBD,wDAsDC;AAED,gEAyCC;AA/MD,yDAAgE;AAChE,yCAAsC;AAEtC,sCAA2C;AAC3C,8CAA6C;AAC7C,oCAAiC;AACjC,gCAA2D;AAE3D,+BAAoC;AAEpC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,YAAY;IACZ,gBAAgB;IAChB,wBAAwB;IACxB,yBAAyB;CAC1B,CAAC,CAAC;AAEH;;;GAGG;AACH,SAAgB,uCAAuC,CACrD,cAAsB,EACtB,EAAE,KAAK,EAA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,CACxC,QAAQ,EACR,oBAAoB,CACrB,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED,SAAS,mBAAmB,CAC1B,QAAkB,EAClB,GAAsB;IAEtB,IAAI,oBAAoB,GAAG,GAAG,CAAC;IAC/B,MAAM,OAAO,GAAG,IAAA,4BAAsB,EAAC,QAAQ,CAAC,SAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;IACxE,IAAI,IAAA,eAAS,EAAC,OAAO,CAAC,EAAE,CAAC;QACvB,eAAM,CAAC,KAAK,CAAC,iCAAiC,OAAO,oBAAoB,CAAC,CAAC;QAC3E,oBAAoB,GAAG,uCAAuC,CAC5D,OAAQ,EACR,QAAQ,EACR,oBAAoB,CACrB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,eAAM,CAAC,KAAK,CACV,+BAA+B,QAAQ,CAAC,SAAU,iCAAiC,CACpF,CAAC;IACJ,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC","sourcesContent":["import { PLATFORM_HOST_TYPES } from '../../constants/platforms';\nimport { logger } from '../../logger';\nimport type { HostRule } from '../../types';\nimport { detectPlatform } from '../common';\nimport { find, getAll } from '../host-rules';\nimport { regEx } from '../regex';\nimport { createURLFromHostOrURL, isHttpUrl } from '../url';\nimport type { AuthenticationRule } from './types';\nimport { parseGitUrl } from './url';\n\nconst githubApiUrls = new Set([\n 'github.com',\n 'api.github.com',\n 'https://api.github.com',\n 'https://api.github.com/',\n]);\n\n/**\n * Add authorization to a Git Url and returns a new environment variables object\n * @returns a new NodeJS.ProcessEnv object without modifying any input parameters\n */\nexport function getGitAuthenticatedEnvironmentVariables(\n originalGitUrl: string,\n { token, username, password, hostType, matchHost }: HostRule,\n environmentVariables?: NodeJS.ProcessEnv,\n): NodeJS.ProcessEnv {\n if (!token && !(username && password)) {\n logger.warn(\n { host: matchHost },\n `Could not create environment variable for host as neither token or username and password was set`,\n );\n return { ...environmentVariables };\n }\n\n // check if the environmentVariables already contain a GIT_CONFIG_COUNT or if the process has one\n const gitConfigCountEnvVariable =\n environmentVariables?.GIT_CONFIG_COUNT ?? process.env.GIT_CONFIG_COUNT;\n let gitConfigCount = 0;\n if (gitConfigCountEnvVariable) {\n // passthrough the gitConfigCountEnvVariable environment variable as start value of the index count\n gitConfigCount = parseInt(gitConfigCountEnvVariable, 10);\n if (Number.isNaN(gitConfigCount)) {\n logger.warn(\n {\n GIT_CONFIG_COUNT: process.env.GIT_CONFIG_COUNT,\n },\n `Found GIT_CONFIG_COUNT env variable, but couldn't parse the value to an integer. Ignoring it.`,\n );\n gitConfigCount = 0;\n }\n }\n let authenticationRules: AuthenticationRule[];\n if (token) {\n authenticationRules = getAuthenticationRulesWithToken(\n originalGitUrl,\n hostType,\n token,\n );\n } else {\n const encodedUsername = encodeURIComponent(username!);\n const encodedPassword = encodeURIComponent(password!);\n\n authenticationRules = getAuthenticationRules(\n originalGitUrl,\n hostType,\n `${encodedUsername}:${encodedPassword}`,\n );\n }\n\n // create a shallow copy of the environmentVariables as base so we don't modify the input parameter object\n // add the two new config key and value to the returnEnvironmentVariables object\n // increase the CONFIG_COUNT by one for each rule and add it to the object\n const newEnvironmentVariables = {\n ...environmentVariables,\n };\n for (const rule of authenticationRules) {\n newEnvironmentVariables[`GIT_CONFIG_KEY_${gitConfigCount}`] =\n `url.${rule.url}.insteadOf`;\n newEnvironmentVariables[`GIT_CONFIG_VALUE_${gitConfigCount}`] =\n rule.insteadOf;\n gitConfigCount++;\n }\n newEnvironmentVariables.GIT_CONFIG_COUNT = gitConfigCount.toString();\n\n return newEnvironmentVariables;\n}\n\nfunction getAuthenticationRulesWithToken(\n url: string,\n hostType: string | undefined | null,\n authToken: string,\n): AuthenticationRule[] {\n let token = authToken;\n let type = hostType;\n if (!type) {\n type = detectPlatform(url);\n }\n if (type === 'gitlab') {\n token = `gitlab-ci-token:${authToken}`;\n }\n return getAuthenticationRules(url, type, token);\n}\n\n/**\n * Generates the authentication rules for later git usage for the given host\n * @link https://coolaj86.com/articles/vanilla-devops-git-credentials-cheatsheet/\n * @param gitUrl Git repository URL\n * @param hostType Git host type\n * @param token Authentication token or `username:password` string\n */\nexport function getAuthenticationRules(\n gitUrl: string,\n hostType: string | undefined | null,\n token: string,\n): AuthenticationRule[] {\n const authenticationRules = [];\n const hasUser = token.split(':').length > 1;\n const insteadUrl = parseGitUrl(gitUrl);\n let sshPort = insteadUrl.port;\n\n if (hostType === 'bitbucket-server') {\n // For Bitbucket Server/Data Center, `source` must be `bitbucket-server`\n // to generate HTTP(s) URLs correctly.\n // https://github.com/IonicaBizau/git-url-parse/blob/28828546c148d58bbcff61409915a4e1e8f7eb11/lib/index.js#L304\n insteadUrl.source = 'bitbucket-server';\n\n if (!sshPort) {\n // By default, bitbucket-server SSH port is 7999.\n // For non-default port, the generated auth config will likely be incorrect.\n sshPort = 7999;\n }\n }\n\n const url = { ...insteadUrl };\n const protocol = regEx(/^https?$/).test(url.protocol)\n ? url.protocol\n : 'https';\n\n // ssh protocol with user if empty\n url.token = hasUser ? token : `ssh:${token}`;\n authenticationRules.push({\n url: url.toString(protocol),\n // only edge case, need to stringify ourself because the exact syntax is not supported by the library\n // https://github.com/IonicaBizau/git-url-parse/blob/246c9119fb42c2ea1c280028fe77c53eb34c190c/lib/index.js#L246\n insteadOf: `ssh://git@${insteadUrl.resource}${\n sshPort ? `:${sshPort}` : ''\n }/${insteadUrl.full_name}${insteadUrl.git_suffix ? '.git' : ''}`,\n });\n\n // alternative ssh protocol with user if empty\n url.token = hasUser ? token : `git:${token}`;\n authenticationRules.push({\n url: url.toString(protocol),\n insteadOf: { ...insteadUrl, port: sshPort }.toString('ssh'),\n });\n\n // https protocol with no user as default fallback\n url.token = token;\n authenticationRules.push({\n url: url.toString(protocol),\n insteadOf: insteadUrl.toString(protocol),\n });\n\n return authenticationRules;\n}\n\nexport function getGitEnvironmentVariables(\n additionalHostTypes: string[] = [],\n): NodeJS.ProcessEnv {\n let environmentVariables: NodeJS.ProcessEnv = {};\n\n // hard-coded logic to use authentication for github.com based on the githubToken for api.github.com\n const gitHubHostRule = find({\n hostType: 'github',\n url: 'https://api.github.com/',\n });\n\n if (gitHubHostRule?.token) {\n environmentVariables = getGitAuthenticatedEnvironmentVariables(\n 'https://github.com/',\n gitHubHostRule,\n );\n }\n\n // construct the Set of allowed hostTypes consisting of the standard Git provides\n // plus additionalHostTypes, which are provided as parameter\n const gitAllowedHostTypes = new Set<string>([\n ...PLATFORM_HOST_TYPES,\n ...additionalHostTypes,\n ]);\n\n // filter rules without `matchHost` and `token` or username and password and github api github rules\n const hostRules = getAll()\n .filter((r) => r.matchHost && (r.token ?? (r.username && r.password)))\n .filter((r) => !gitHubHostRule || !githubApiUrls.has(r.matchHost!));\n\n // for each hostRule without hostType we add additional authentication variables to the environmentVariables\n // for each hostRule with hostType we add additional authentication variables to the environmentVariables\n for (const hostRule of hostRules) {\n if (!hostRule.hostType || gitAllowedHostTypes.has(hostRule.hostType)) {\n environmentVariables = addAuthFromHostRule(\n hostRule,\n environmentVariables,\n );\n }\n }\n return environmentVariables;\n}\n\nfunction addAuthFromHostRule(\n hostRule: HostRule,\n env: NodeJS.ProcessEnv,\n): NodeJS.ProcessEnv {\n let environmentVariables = env;\n const httpUrl = createURLFromHostOrURL(hostRule.matchHost!)?.toString();\n if (isHttpUrl(httpUrl)) {\n logger.trace(`Adding Git authentication for ${httpUrl} using token auth.`);\n environmentVariables = getGitAuthenticatedEnvironmentVariables(\n httpUrl!,\n hostRule,\n environmentVariables,\n );\n } else {\n logger.debug(\n `Could not parse registryUrl ${hostRule.matchHost!} or not using http(s). Ignoring`,\n );\n }\n return environmentVariables;\n}\n"]}
@@ -65,29 +65,29 @@ export declare function getUrl({ protocol, auth, hostname, host, repository, }:
65
65
  * @see https://stackoverflow.com/questions/63866947/pushing-git-non-branch-references-to-a-remote/63868286
66
66
  *
67
67
  */
68
- export declare function pushCommitToRenovateRef(commitSha: string, refName: string, section?: string): Promise<void>;
68
+ export declare function pushCommitToRenovateRef(commitSha: string, refName: string): Promise<void>;
69
69
  /**
70
70
  *
71
- * Removes all remote "refs/renovate/*" refs in two steps:
71
+ * Removes all remote "refs/renovate/branches/*" refs in two steps:
72
72
  *
73
73
  * Step 1: list refs
74
74
  *
75
- * $ git ls-remote origin "refs/renovate/*"
75
+ * $ git ls-remote origin "refs/renovate/branches/*"
76
76
  *
77
- * > cca38e9ea6d10946bdb2d0ca5a52c205783897aa refs/renovate/foo
78
- * > 29ac154936c880068994e17eb7f12da7fdca70e5 refs/renovate/bar
79
- * > 3fafaddc339894b6d4f97595940fd91af71d0355 refs/renovate/baz
77
+ * > cca38e9ea6d10946bdb2d0ca5a52c205783897aa refs/renovate/branches/foo
78
+ * > 29ac154936c880068994e17eb7f12da7fdca70e5 refs/renovate/branches/bar
79
+ * > 3fafaddc339894b6d4f97595940fd91af71d0355 refs/renovate/branches/baz
80
80
  * > ...
81
81
  *
82
82
  * Step 2:
83
83
  *
84
- * $ git push --delete origin refs/renovate/foo refs/renovate/bar refs/renovate/baz
84
+ * $ git push --delete origin refs/renovate/branches/foo refs/renovate/branches/bar refs/renovate/branches/baz
85
85
  *
86
86
  * If Step 2 fails because the repo doesn't allow bulk changes, we'll remove them one by one instead:
87
87
  *
88
- * $ git push --delete origin refs/renovate/foo
89
- * $ git push --delete origin refs/renovate/bar
90
- * $ git push --delete origin refs/renovate/baz
88
+ * $ git push --delete origin refs/renovate/branches/foo
89
+ * $ git push --delete origin refs/renovate/branches/bar
90
+ * $ git push --delete origin refs/renovate/branches/baz
91
91
  */
92
92
  export declare function clearRenovateRefs(): Promise<void>;
93
93
  /**
@@ -1046,80 +1046,76 @@ let remoteRefsExist = false;
1046
1046
  * @see https://stackoverflow.com/questions/63866947/pushing-git-non-branch-references-to-a-remote/63868286
1047
1047
  *
1048
1048
  */
1049
- async function pushCommitToRenovateRef(commitSha, refName, section = 'branches') {
1050
- const fullRefName = `refs/renovate/${section}/${refName}`;
1049
+ async function pushCommitToRenovateRef(commitSha, refName) {
1050
+ const fullRefName = `refs/renovate/branches/${refName}`;
1051
1051
  await git.raw(['update-ref', fullRefName, commitSha]);
1052
1052
  await git.push(['--force', 'origin', fullRefName]);
1053
1053
  remoteRefsExist = true;
1054
1054
  }
1055
1055
  /**
1056
1056
  *
1057
- * Removes all remote "refs/renovate/*" refs in two steps:
1057
+ * Removes all remote "refs/renovate/branches/*" refs in two steps:
1058
1058
  *
1059
1059
  * Step 1: list refs
1060
1060
  *
1061
- * $ git ls-remote origin "refs/renovate/*"
1061
+ * $ git ls-remote origin "refs/renovate/branches/*"
1062
1062
  *
1063
- * > cca38e9ea6d10946bdb2d0ca5a52c205783897aa refs/renovate/foo
1064
- * > 29ac154936c880068994e17eb7f12da7fdca70e5 refs/renovate/bar
1065
- * > 3fafaddc339894b6d4f97595940fd91af71d0355 refs/renovate/baz
1063
+ * > cca38e9ea6d10946bdb2d0ca5a52c205783897aa refs/renovate/branches/foo
1064
+ * > 29ac154936c880068994e17eb7f12da7fdca70e5 refs/renovate/branches/bar
1065
+ * > 3fafaddc339894b6d4f97595940fd91af71d0355 refs/renovate/branches/baz
1066
1066
  * > ...
1067
1067
  *
1068
1068
  * Step 2:
1069
1069
  *
1070
- * $ git push --delete origin refs/renovate/foo refs/renovate/bar refs/renovate/baz
1070
+ * $ git push --delete origin refs/renovate/branches/foo refs/renovate/branches/bar refs/renovate/branches/baz
1071
1071
  *
1072
1072
  * If Step 2 fails because the repo doesn't allow bulk changes, we'll remove them one by one instead:
1073
1073
  *
1074
- * $ git push --delete origin refs/renovate/foo
1075
- * $ git push --delete origin refs/renovate/bar
1076
- * $ git push --delete origin refs/renovate/baz
1074
+ * $ git push --delete origin refs/renovate/branches/foo
1075
+ * $ git push --delete origin refs/renovate/branches/bar
1076
+ * $ git push --delete origin refs/renovate/branches/baz
1077
1077
  */
1078
1078
  async function clearRenovateRefs() {
1079
1079
  if (!gitInitialized || !remoteRefsExist) {
1080
1080
  return;
1081
1081
  }
1082
- logger_1.logger.debug(`Cleaning up Renovate refs: refs/renovate/*`);
1082
+ logger_1.logger.debug(`Cleaning up Renovate refs: refs/renovate/branches/*`);
1083
1083
  const renovateRefs = [];
1084
- const obsoleteRefs = [];
1085
1084
  try {
1086
- const rawOutput = await git.listRemote([config.url, 'refs/renovate/*']);
1085
+ const rawOutput = await git.listRemote([
1086
+ config.url,
1087
+ 'refs/renovate/branches/*',
1088
+ ]);
1087
1089
  const refs = rawOutput
1088
1090
  .split(regex_1.newlineRegex)
1089
1091
  .map((line) => line.replace((0, regex_1.regEx)(/[0-9a-f]+\s+/i), '').trim())
1090
- .filter((line) => line.startsWith('refs/renovate/'));
1092
+ .filter((line) => line.startsWith('refs/renovate/branches/'));
1091
1093
  renovateRefs.push(...refs);
1092
1094
  }
1093
1095
  catch (err) /* istanbul ignore next */ {
1094
1096
  logger_1.logger.warn({ err }, `Renovate refs cleanup error`);
1095
1097
  }
1096
- const nonSectionedRefs = renovateRefs.filter((ref) => {
1097
- return ref.split('/').length === 3;
1098
- });
1099
- obsoleteRefs.push(...nonSectionedRefs);
1100
- const renovateBranchRefs = renovateRefs.filter((ref) => ref.startsWith('refs/renovate/branches/'));
1101
- obsoleteRefs.push(...renovateBranchRefs);
1102
- if (obsoleteRefs.length) {
1098
+ if (renovateRefs.length) {
1103
1099
  try {
1104
- const pushOpts = ['--delete', 'origin', ...obsoleteRefs];
1100
+ const pushOpts = ['--delete', 'origin', ...renovateRefs];
1105
1101
  await git.push(pushOpts);
1106
1102
  }
1107
1103
  catch (err) {
1108
1104
  /* istanbul ignore else */
1109
1105
  if ((0, error_1.bulkChangesDisallowed)(err)) {
1110
- for (const ref of obsoleteRefs) {
1106
+ for (const ref of renovateRefs) {
1111
1107
  try {
1112
1108
  const pushOpts = ['--delete', 'origin', ref];
1113
1109
  await git.push(pushOpts);
1114
1110
  }
1115
1111
  catch (err) /* istanbul ignore next */ {
1116
- logger_1.logger.debug({ err }, 'Error deleting obsolete refs');
1112
+ logger_1.logger.debug({ err }, 'Error deleting "refs/renovate/branches/*"');
1117
1113
  break;
1118
1114
  }
1119
1115
  }
1120
1116
  }
1121
1117
  else {
1122
- logger_1.logger.warn({ err }, 'Error deleting obsolete refs');
1118
+ logger_1.logger.warn({ err }, 'Error deleting "refs/renovate/branches/*"');
1123
1119
  }
1124
1120
  }
1125
1121
  }