renovate 44.25.0 → 44.26.3
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.
- package/dist/config/options/index.js +1 -1
- package/dist/config/options/index.js.map +1 -1
- package/dist/global-config-option-defaults.generated.js +1 -1
- package/dist/global-config-option-defaults.generated.js.map +1 -1
- package/dist/modules/manager/fingerprint.generated.js +8 -8
- package/dist/modules/manager/fingerprint.generated.js.map +1 -1
- package/dist/modules/manager/github-actions/parse.js +1 -1
- package/dist/modules/manager/github-actions/parse.js.map +1 -1
- package/dist/modules/manager/npm/post-update/pnpm.js +1 -1
- package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
- package/dist/modules/manager/terraform/lockfile/hash.js +60 -57
- package/dist/modules/manager/terraform/lockfile/hash.js.map +1 -1
- package/dist/modules/platform/azure/azure-got-wrapper.js +18 -1
- package/dist/modules/platform/azure/azure-got-wrapper.js.map +1 -1
- package/dist/modules/platform/azure/issue.js +20 -16
- package/dist/modules/platform/azure/issue.js.map +1 -1
- package/dist/util/fs/index.js +1 -16
- package/dist/util/fs/index.js.map +1 -1
- package/package.json +6 -2
- package/renovate-schema.json +2 -2
|
@@ -23,7 +23,7 @@ const globalConfigOptionDefaults = {
|
|
|
23
23
|
"detectHostRulesFromEnv": false,
|
|
24
24
|
"dockerChildPrefix": "renovate_",
|
|
25
25
|
"dockerMaxPages": 20,
|
|
26
|
-
"dockerSidecarImage": "ghcr.io/renovatebot/base-image:13.
|
|
26
|
+
"dockerSidecarImage": "ghcr.io/renovatebot/base-image:13.85.1",
|
|
27
27
|
"dockerUser": "12021",
|
|
28
28
|
"executionTimeout": 15,
|
|
29
29
|
"exposeAllEnv": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-config-option-defaults.generated.js","names":[],"sources":["../lib/global-config-option-defaults.generated.ts"],"sourcesContent":["\nexport const globalConfigOptionDefaults: Record<string, unknown> = {\n \"allowCustomCrateRegistries\": false,\n \"allowedCommands\": [],\n \"allowedEnv\": [],\n \"allowedHeaders\": [\n \"X-*\"\n ],\n \"allowedUnsafeExecutions\": [],\n \"allowPlugins\": false,\n \"allowScripts\": false,\n \"allowShellExecutorForPostUpgradeCommands\": false,\n \"autodiscover\": false,\n \"bbUseDevelopmentBranch\": false,\n \"binarySource\": \"install\",\n \"cacheHardTtlMinutes\": 10080,\n \"cachePrivatePackages\": false,\n \"cacheTtlOverride\": {},\n \"checkedBranches\": [],\n \"configValidationError\": false,\n \"customEnvVariables\": {},\n \"deleteAdditionalConfigFile\": false,\n \"deleteConfigFile\": false,\n \"detectGlobalManagerConfig\": false,\n \"detectHostRulesFromEnv\": false,\n \"dockerChildPrefix\": \"renovate_\",\n \"dockerMaxPages\": 20,\n \"dockerSidecarImage\": \"ghcr.io/renovatebot/base-image:13.
|
|
1
|
+
{"version":3,"file":"global-config-option-defaults.generated.js","names":[],"sources":["../lib/global-config-option-defaults.generated.ts"],"sourcesContent":["\nexport const globalConfigOptionDefaults: Record<string, unknown> = {\n \"allowCustomCrateRegistries\": false,\n \"allowedCommands\": [],\n \"allowedEnv\": [],\n \"allowedHeaders\": [\n \"X-*\"\n ],\n \"allowedUnsafeExecutions\": [],\n \"allowPlugins\": false,\n \"allowScripts\": false,\n \"allowShellExecutorForPostUpgradeCommands\": false,\n \"autodiscover\": false,\n \"bbUseDevelopmentBranch\": false,\n \"binarySource\": \"install\",\n \"cacheHardTtlMinutes\": 10080,\n \"cachePrivatePackages\": false,\n \"cacheTtlOverride\": {},\n \"checkedBranches\": [],\n \"configValidationError\": false,\n \"customEnvVariables\": {},\n \"deleteAdditionalConfigFile\": false,\n \"deleteConfigFile\": false,\n \"detectGlobalManagerConfig\": false,\n \"detectHostRulesFromEnv\": false,\n \"dockerChildPrefix\": \"renovate_\",\n \"dockerMaxPages\": 20,\n \"dockerSidecarImage\": \"ghcr.io/renovatebot/base-image:13.85.1\",\n \"dockerUser\": \"12021\",\n \"executionTimeout\": 15,\n \"exposeAllEnv\": false,\n \"forceCli\": true,\n \"forkCreation\": true,\n \"githubTokenWarn\": true,\n \"gitNoVerify\": [\n \"commit\",\n \"push\"\n ],\n \"gitTimeout\": 0,\n \"gitUrl\": \"default\",\n \"httpCacheTtlDays\": 90,\n \"ignorePrAuthor\": false,\n \"includeMirrors\": false,\n \"inheritConfig\": false,\n \"inheritConfigFileName\": \"org-inherited-config.json\",\n \"inheritConfigRepoName\": \"{{parentOrg}}/renovate-config\",\n \"inheritConfigStrict\": false,\n \"mergeConfidenceDatasources\": [\n \"go\",\n \"maven\",\n \"npm\",\n \"nuget\",\n \"packagist\",\n \"pypi\",\n \"rubygems\"\n ],\n \"mergeConfidenceEndpoint\": \"https://developer.mend.io/\",\n \"migratePresets\": {},\n \"onboardingBranch\": \"renovate/configure\",\n \"onboardingConfig\": {\n \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\"\n },\n \"onboardingConfigFileName\": \"renovate.json\",\n \"onboardingNoDeps\": \"auto\",\n \"onboardingPrTitle\": \"Configure Renovate\",\n \"onboardingRebaseCheckbox\": false,\n \"optimizeForDisabled\": false,\n \"persistRepoData\": false,\n \"platform\": \"github\",\n \"prCacheSyncMaxPages\": 100,\n \"prCommitsPerRunLimit\": 0,\n \"presetCachePersistence\": false,\n \"processEnv\": {},\n \"productLinks\": {\n \"documentation\": \"https://docs.renovatebot.com/\",\n \"help\": \"https://github.com/renovatebot/renovate/discussions\",\n \"homepage\": \"https://github.com/renovatebot/renovate\"\n },\n \"rebaseAllOpenBranches\": false,\n \"reportFormatting\": false,\n \"repositoryCache\": \"disabled\",\n \"repositoryCacheForceLocal\": false,\n \"repositoryCacheType\": \"local\",\n \"requireConfig\": \"required\",\n \"s3PathStyle\": false,\n \"secrets\": {},\n \"unicodeEmoji\": true,\n \"useCloudMetadataServices\": true,\n \"userAgent\": \"Renovate/{{renovateVersion}} (https://github.com/renovatebot/renovate)\",\n \"variables\": {}\n};\n"],"mappings":";AACA,MAAa,6BAAsD;CACjE,8BAA8B;CAC9B,mBAAmB,CAAC;CACpB,cAAc,CAAC;CACf,kBAAkB,CAChB,KACF;CACA,2BAA2B,CAAC;CAC5B,gBAAgB;CAChB,gBAAgB;CAChB,4CAA4C;CAC5C,gBAAgB;CAChB,0BAA0B;CAC1B,gBAAgB;CAChB,uBAAuB;CACvB,wBAAwB;CACxB,oBAAoB,CAAC;CACrB,mBAAmB,CAAC;CACpB,yBAAyB;CACzB,sBAAsB,CAAC;CACvB,8BAA8B;CAC9B,oBAAoB;CACpB,6BAA6B;CAC7B,0BAA0B;CAC1B,qBAAqB;CACrB,kBAAkB;CAClB,sBAAsB;CACtB,cAAc;CACd,oBAAoB;CACpB,gBAAgB;CAChB,YAAY;CACZ,gBAAgB;CAChB,mBAAmB;CACnB,eAAe,CACb,UACA,MACF;CACA,cAAc;CACd,UAAU;CACV,oBAAoB;CACpB,kBAAkB;CAClB,kBAAkB;CAClB,iBAAiB;CACjB,yBAAyB;CACzB,yBAAyB;CACzB,uBAAuB;CACvB,8BAA8B;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;CACF;CACA,2BAA2B;CAC3B,kBAAkB,CAAC;CACnB,oBAAoB;CACpB,oBAAoB,EAClB,WAAW,oDACb;CACA,4BAA4B;CAC5B,oBAAoB;CACpB,qBAAqB;CACrB,4BAA4B;CAC5B,uBAAuB;CACvB,mBAAmB;CACnB,YAAY;CACZ,uBAAuB;CACvB,wBAAwB;CACxB,0BAA0B;CAC1B,cAAc,CAAC;CACf,gBAAgB;EACd,iBAAiB;EACjB,QAAQ;EACR,YAAY;CACd;CACA,yBAAyB;CACzB,oBAAoB;CACpB,mBAAmB;CACnB,6BAA6B;CAC7B,uBAAuB;CACvB,iBAAiB;CACjB,eAAe;CACf,WAAW,CAAC;CACZ,gBAAgB;CAChB,4BAA4B;CAC5B,aAAa;CACb,aAAa,CAAC;AAChB"}
|
|
@@ -16,7 +16,7 @@ hashMap.set("bitbucket-pipelines", "59c0503494ab1442b127914503c01b97ac17b6742b19
|
|
|
16
16
|
hashMap.set("bitrise", "478dfd316221fad7c29e177c70d1018d832fb2626b53308a5d0f1f0380e69f42");
|
|
17
17
|
hashMap.set("buildkite", "a93effb1f1c5d65b3277c3b4709924eacde282e8efd028a8e3d8c1ce3ef69407");
|
|
18
18
|
hashMap.set("buildpacks", "6bef3cb04d66b5cfbb195adb4829bcbccae6408518706744d291bacf0610421f");
|
|
19
|
-
hashMap.set("bun", "
|
|
19
|
+
hashMap.set("bun", "691aa0bd20c20f7e05be5d231ed14dccdf81b9399d062448794176403aa53d94");
|
|
20
20
|
hashMap.set("bun-version", "df3ae8e4a5de1fa1b4544f3d7fc8117e80adb1e151c46d1ede54a4dbea6521e4");
|
|
21
21
|
hashMap.set("bundler", "4f70ac0377893683eb30013bf4d23a8bd7213a883847c9eaadf1217f5f190ee1");
|
|
22
22
|
hashMap.set("cake", "ed6d14c96161f1d3d927adc7e333b96585164e1f25151a87990914d57ae17fe1");
|
|
@@ -31,7 +31,7 @@ hashMap.set("copier", "06a52206ba5542f99f056c832245196afd4b78bffeca088f710a5df95
|
|
|
31
31
|
hashMap.set("cpanfile", "07813fec3f3c2197056500e9266a0553b9774c02f2c74d5ca2e213188c7c12d3");
|
|
32
32
|
hashMap.set("crossplane", "5c26b1201a1a51454ffb94d829e223a76a781569bf79cdb1e47087c30233ec40");
|
|
33
33
|
hashMap.set("crow", "eb9a5f9f95041855dded67bcce3dd54724f690995ed6268d272e8a666ff28fd0");
|
|
34
|
-
hashMap.set("deno", "
|
|
34
|
+
hashMap.set("deno", "a43016a9a469e0472f00855c8db64bb65ef5ffa773e7bbfade02a21400f67690");
|
|
35
35
|
hashMap.set("deps-edn", "c87dd5e88587147ad1a78f047b814f3c4aa60d6de30d0c49d849391eeaf1b64c");
|
|
36
36
|
hashMap.set("devbox", "a608d1e6db93a8f997d41f8dee7b67533452a956057865978342e2819272e0a9");
|
|
37
37
|
hashMap.set("devcontainer", "24320ed1cb6191d04cb8b2707214d82c08c682597aed1d84f250aa00ad1632ec");
|
|
@@ -42,7 +42,7 @@ hashMap.set("fleet", "d73d5d35f10df0599a561d9c8d25f3935350407d0e3bd3a1d1545295f2
|
|
|
42
42
|
hashMap.set("flux", "70833dd068ea0a746a9392469e7904021562c7629428d0cd554603bad4eb6ce5");
|
|
43
43
|
hashMap.set("fvm", "9b161df0f14bc6e536368952adf373e343630097121a913cea60ee284027fb90");
|
|
44
44
|
hashMap.set("git-submodules", "e95bbc9b69a36dee82e255e8983640b7179cb5f17d24b035c6cf01d9635b35bd");
|
|
45
|
-
hashMap.set("github-actions", "
|
|
45
|
+
hashMap.set("github-actions", "0a77751d4307d7e923bf2d05bf49084e77a23d7f1e498a1373202dd1ebdcc48a");
|
|
46
46
|
hashMap.set("gitlabci", "33c264edf7837fb8fbc4cf0078c8bd2d5a75431039b1db65bf47356df7753125");
|
|
47
47
|
hashMap.set("gitlabci-include", "ef696c478c2ac1723b3aca070ba9779be0e702fff0844054251ba0029523d0eb");
|
|
48
48
|
hashMap.set("glasskube", "93e7b9000a17efa15a1abaaf320b5af9169b1ecd828fc0c881d98570ef9d9e30");
|
|
@@ -74,8 +74,8 @@ hashMap.set("mise", "8463d355091f5f167e3f4a8adbebfe49310ad9ac45c89d60455ef8e110d
|
|
|
74
74
|
hashMap.set("mix", "5eb001e2af7cd664d811ad2d9928bf785527ed292de1e567de57f7e2cecc1ecc");
|
|
75
75
|
hashMap.set("nix", "d3283c2b948695a16c1089da4e2689faacd50eaa7d734d6fa5d6661aef6db7e7");
|
|
76
76
|
hashMap.set("nodenv", "ac652c28481b001f7471f4183eac07b45d98ecbe83efc275830b0a1b2e0459b8");
|
|
77
|
-
hashMap.set("npm", "
|
|
78
|
-
hashMap.set("nuget", "
|
|
77
|
+
hashMap.set("npm", "95ddcec26d4db9ee54028f00fdcac118c458cd1513623737dd1b3f79d05a11a4");
|
|
78
|
+
hashMap.set("nuget", "d4f3c5cbc0f6e6e8baf80b8ad8e184d186ff6686486b1c97995a0c87151abbe3");
|
|
79
79
|
hashMap.set("nvm", "3eb77c7b0acf6d64753de78fad2499b352719853aa6872878c40675d14152322");
|
|
80
80
|
hashMap.set("ocb", "032b216684c14b0954e0bb019513a2aca3faaee5748587acb668d377d7c891ca");
|
|
81
81
|
hashMap.set("osgi", "32233a1a8a2725699d7448ba438e3d0b78141f7799cd2b588de278d41e26ed10");
|
|
@@ -84,7 +84,7 @@ hashMap.set("pep723", "b96683163de63ed93207ec0538066705b1e58a1cd5b8bd11c63fc28b2
|
|
|
84
84
|
hashMap.set("pip-compile", "9711b1c00da18ff785e624c50e4b042519e7ad615c5f018f08459fac8394fec5");
|
|
85
85
|
hashMap.set("pip_requirements", "537ef9d7b43b5adcfbfbb86392e0c7a8a0ee91c804118af83cf92e1868949e1a");
|
|
86
86
|
hashMap.set("pip_setup", "0175fe550c19d9bd31c978bd83fdc088cb40fcacd5d6751f640164274ae64e61");
|
|
87
|
-
hashMap.set("pipenv", "
|
|
87
|
+
hashMap.set("pipenv", "a7d45859427263c17f1109a08c8b48a1f24812290f9853013ec1774f2484a769");
|
|
88
88
|
hashMap.set("pixi", "3732f052617efd5007ddbe31091a2ba026909288bac4cbbe6d2bd6ac64d85393");
|
|
89
89
|
hashMap.set("poetry", "6cf6bc5116458761b2d6779caf465d6e26768fbe6e2ffba54b5da981aa8c385f");
|
|
90
90
|
hashMap.set("pre-commit", "17a5f183985ebffe98785a541d3609bf25efedc387deb3d50e9f00f02b25f615");
|
|
@@ -104,7 +104,7 @@ hashMap.set("smithy", "9641b91d065ffb63be0dd888139a0402dba41e550f8b44c592db9daf5
|
|
|
104
104
|
hashMap.set("sveltos", "05b3158e88771ed4629e171592cf4f1bf0ff342f8aeae89be0b340c630cc6d8e");
|
|
105
105
|
hashMap.set("swift", "eb5f7c3c4dabf28eed36916269ca9be16ab9ddb83993db03ea66b9195ad7bdc6");
|
|
106
106
|
hashMap.set("tekton", "fdc5b9b5edec2a90cda2f858f3ebc532aa8efb1187d1e0b7c89b07796e9cb6cd");
|
|
107
|
-
hashMap.set("terraform", "
|
|
107
|
+
hashMap.set("terraform", "b6723d78863803e688d2b85cc72bc43657d79ff0cca3bc719e7d96cfd34ceb69");
|
|
108
108
|
hashMap.set("terraform-version", "ec8f786b9731d47f2c2fe0307caf64d7ddd83046fe7ff1f7d8423239f8b0f2aa");
|
|
109
109
|
hashMap.set("terragrunt", "ffcbaa67dd65f064d43f8c121c1006115eab1879c4bd38de263b9b90a009c118");
|
|
110
110
|
hashMap.set("terragrunt-version", "eea6087b33717d22ede2fc68c2f64df8390b75abe82110ed831a180648feb51d");
|
|
@@ -116,7 +116,7 @@ hashMap.set("velaci", "fda00ddb7cc23e9a37e0a8a253151df0a6930b4276d3e4f78cc54b9ac
|
|
|
116
116
|
hashMap.set("vendir", "ee9cc316c73ab0944da494bf36cfeafba8e79a36ec77753b9f341c8e80f1d602");
|
|
117
117
|
hashMap.set("woodpecker", "6110d3bec33aaeb3511d4bbfa896cec3c8e02fb04a6cff50c9ba81061c851045");
|
|
118
118
|
hashMap.set("xcodegen", "dad511d88a9ce1dbdde8b9731f3da7f2bdaa4ca8a083294ee58d56da62ab1683");
|
|
119
|
-
hashMap.set("jsonata", "
|
|
119
|
+
hashMap.set("jsonata", "416bcf61144b276b3112814c6e6d261aa29608f46fbb0516c471d35c16f8f0d7");
|
|
120
120
|
hashMap.set("regex", "dbe6889ea021a05127fed06226d73366fdada2ae577147a5c027996fd325416e");
|
|
121
121
|
//#endregion
|
|
122
122
|
export { hashMap };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fingerprint.generated.js","names":[],"sources":["../../../lib/modules/manager/fingerprint.generated.ts"],"sourcesContent":["export const hashMap = new Map<string, string>();\n\nhashMap.set('ansible','1d3568f42393d697f8f96d461b72077ee7a1044b654e87667a12f861b3083111');\nhashMap.set('ansible-galaxy','8226d47128f2018825d4d6f84794e3183eb79c706045fa7e88491edd5e64106f');\nhashMap.set('ant','2df5943cf0ed19a21b94df13729dbb925655548130caf37e3e22bebaed518e17');\nhashMap.set('argocd','5d35b1992e53130bf83b0e59a0f90ccd3a78919974c69044f306dc5d162f48ce');\nhashMap.set('asdf','b2acfc0a6164e9a279daa724777c423f84572dafb0df09b1b0cf6f205f9eb6d0');\nhashMap.set('azure-pipelines','4f635b0ecd388ee266d992e8281fd40e3db2f5867d86fc1cbce72dc33a66e796');\nhashMap.set('batect','bd9208444eff1a4958061484db66a47b616c31f15a8d49d23b75c4560fcee83e');\nhashMap.set('batect-wrapper','d999355511ea7f4053325a18b8cfc8d2b586c61e6760c35e557d383a673e3939');\nhashMap.set('bazel','4994a8bd86d5bfb169d67c08efd8509b58c368c2bf3dd9bbe42553c0fabc3f1a');\nhashMap.set('bazel-module','40f6a862b4e72fcc7262ee41f8b570ea3fd5600d6d552b94ed3301bb201f5db5');\nhashMap.set('bazelisk','d71489650feefb0dbbe7461f924cb50e41c8eef8fe2e11acdec2d42d0212c8ef');\nhashMap.set('bicep','7246e0bfc06e0e28cbb03ac088c5591f648956b086e106aeb251fe5d628329db');\nhashMap.set('bitbucket-pipelines','59c0503494ab1442b127914503c01b97ac17b6742b19c632292d5aa24de115cd');\nhashMap.set('bitrise','478dfd316221fad7c29e177c70d1018d832fb2626b53308a5d0f1f0380e69f42');\nhashMap.set('buildkite','a93effb1f1c5d65b3277c3b4709924eacde282e8efd028a8e3d8c1ce3ef69407');\nhashMap.set('buildpacks','6bef3cb04d66b5cfbb195adb4829bcbccae6408518706744d291bacf0610421f');\nhashMap.set('bun','f2d5b0a7c0c724d30e79e12688b1fc8ff8e344db0cc6389553e2f6001ddf8345');\nhashMap.set('bun-version','df3ae8e4a5de1fa1b4544f3d7fc8117e80adb1e151c46d1ede54a4dbea6521e4');\nhashMap.set('bundler','4f70ac0377893683eb30013bf4d23a8bd7213a883847c9eaadf1217f5f190ee1');\nhashMap.set('cake','ed6d14c96161f1d3d927adc7e333b96585164e1f25151a87990914d57ae17fe1');\nhashMap.set('cargo','13377c53df158cdfc58330f73682fadc3e88e57f0d22c9245c0ffd62a495edf1');\nhashMap.set('cdnurl','d3edf6cdc38e92eb43ff5a2b4e8df6a6a13154cf83244725c39e28d7e6ea9177');\nhashMap.set('circleci','91cbeb33ea20f9838e2c81a1195eb806f0b38fa282bc3679f62552f20575ca85');\nhashMap.set('cloudbuild','8c0c739f7e4082bbfe8e3fdffebaf43e26f70a1314d95b306e9b93e4f4297886');\nhashMap.set('cocoapods','cf48ab5a573a28bf14d5e6c84eed9ca08b7f0cb5b7fc51d795c21c7254bb9dd1');\nhashMap.set('composer','869aab556d9b2ca2b743a790a7c0d7d104d62bbcbcc2185c44c64543d70413ba');\nhashMap.set('conan','74ca922a0ffdf1a9dd44b83eb2b3a36c56c7d792031e3a4a484f293046be3ecd');\nhashMap.set('copier','06a52206ba5542f99f056c832245196afd4b78bffeca088f710a5df958a9693d');\nhashMap.set('cpanfile','07813fec3f3c2197056500e9266a0553b9774c02f2c74d5ca2e213188c7c12d3');\nhashMap.set('crossplane','5c26b1201a1a51454ffb94d829e223a76a781569bf79cdb1e47087c30233ec40');\nhashMap.set('crow','eb9a5f9f95041855dded67bcce3dd54724f690995ed6268d272e8a666ff28fd0');\nhashMap.set('deno','8a161cacb3563a8249c6bf5956a2c1015d4c525946ae61d4fdcec7311f90b2ea');\nhashMap.set('deps-edn','c87dd5e88587147ad1a78f047b814f3c4aa60d6de30d0c49d849391eeaf1b64c');\nhashMap.set('devbox','a608d1e6db93a8f997d41f8dee7b67533452a956057865978342e2819272e0a9');\nhashMap.set('devcontainer','24320ed1cb6191d04cb8b2707214d82c08c682597aed1d84f250aa00ad1632ec');\nhashMap.set('docker-compose','5441af5b5abf8d347e46002d47f02f85743401bda28232f49fb7b3bbb772a4fb');\nhashMap.set('dockerfile','54122792bf8ea0be98e0a0716e627e3115b40a5f0155ccd7ae0cfc52424a3478');\nhashMap.set('droneci','237c8de87b9bf653fb943b56e84e99c45f6d86ae27d86e599b3f3f99c35ba8ee');\nhashMap.set('fleet','d73d5d35f10df0599a561d9c8d25f3935350407d0e3bd3a1d1545295f278912e');\nhashMap.set('flux','70833dd068ea0a746a9392469e7904021562c7629428d0cd554603bad4eb6ce5');\nhashMap.set('fvm','9b161df0f14bc6e536368952adf373e343630097121a913cea60ee284027fb90');\nhashMap.set('git-submodules','e95bbc9b69a36dee82e255e8983640b7179cb5f17d24b035c6cf01d9635b35bd');\nhashMap.set('github-actions','98ce747393a445efba97f0bcb9266800528520ac30702aaa9866753f11377da3');\nhashMap.set('gitlabci','33c264edf7837fb8fbc4cf0078c8bd2d5a75431039b1db65bf47356df7753125');\nhashMap.set('gitlabci-include','ef696c478c2ac1723b3aca070ba9779be0e702fff0844054251ba0029523d0eb');\nhashMap.set('glasskube','93e7b9000a17efa15a1abaaf320b5af9169b1ecd828fc0c881d98570ef9d9e30');\nhashMap.set('gleam','02389785183c39d2896d7893414c5e1060023f95c1fe7b595bd06cc5c1186d39');\nhashMap.set('gomod','073cf874c14d8f323aa7dc467e757b39e249e4617be1ce10926ee68763f89381');\nhashMap.set('gradle','550f1107f0ac27d18fa76a7d5c0c0b317b5df4156fc12cfd378573ccfe26fca0');\nhashMap.set('gradle-wrapper','799d9bb8d9dead673fb513ba4936395f14da30897d33a9df46b3266e1b835d5d');\nhashMap.set('haskell-cabal','f232d0e883235f74ed71fd9de4a7468e5fcbda9a1af5beb56c24657f7bf2e891');\nhashMap.set('helm-requirements','4d90e5e18a380876ad48e21e1ad88ea62e25d973a1ddaa3763447fc0a9f9915b');\nhashMap.set('helm-values','b5c52c6a27d805557418c585c5d3030c95ee641d53057021f3fe060f81b6e1af');\nhashMap.set('helmfile','ab828a1877cfe029ed5f8dd2a026409cd5e6431705af3aac3f56a3bc4f827508');\nhashMap.set('helmsman','ef9680c612f702c7f07aea9b6e5d811e91214dcfa5755c9f3803e9528090935e');\nhashMap.set('helmv3','4088a90bd8be4ae1bcb85dc4d34d3fbbb75e72bd33d144284e7e1f0e726c8d3b');\nhashMap.set('hermit','61e132cfccbe4e3884801a3728f3391455c214811a33c1f733b0dea7122bbbb6');\nhashMap.set('homeassistant-manifest','05043c6db870cffbb6f8f3e351c025e3de227eaae0b24134b796aec46f84b65f');\nhashMap.set('homebrew','9c64a4f1475b1c2052372e566c9190f32ae8acd1c54313031d55ae8772388367');\nhashMap.set('html','67c5f3c5c58e96f5dd257ba5987d900cf7fef81d667c3640e96c847b37de35a8');\nhashMap.set('jenkins','268ebfc8a1caf3edeb2192c2b1b2fa4bf18a78a3e731ba20a6c104940a5539f3');\nhashMap.set('jsonnet-bundler','4023ef4cac55fe58f8d9744ae86b13532298926e35e22d250334cde55c3386ff');\nhashMap.set('kotlin-script','99ef296792a0ca575ed31d3defb514b05a58083dc01c52ea0890c69d867ba1dd');\nhashMap.set('kubernetes','321e7d77fb3600dd4c00a86eaa1294927e7f92300b74fa2977d813dcaa3bb4de');\nhashMap.set('kustomize','fb5f6fbf45b318ca277d6d9f7fee22680f4b99c7ff9170a50315122918d2e007');\nhashMap.set('leiningen','133fca2c3423f53f2ccc22518153ddbcafbf0f4812376c77e952eb3d24d81f85');\nhashMap.set('maven','f084cdc88320ca1e82af957d0008e7c9ce991d3282cb428f3108a5722239cead');\nhashMap.set('maven-wrapper','779344a4e259e0c28bfadfeb435dd72feb7224d7346d038a1c35f02deb1357bc');\nhashMap.set('meteor','4a93a326b27bedfe52118e27e06f39fecd7c55bd4cd7fccec4cb120cac14cec4');\nhashMap.set('mint','248fe4f1ea5c985921c286785792c97e06fc41f402b2d45df82f6aecd17f710e');\nhashMap.set('mise','8463d355091f5f167e3f4a8adbebfe49310ad9ac45c89d60455ef8e110df4a49');\nhashMap.set('mix','5eb001e2af7cd664d811ad2d9928bf785527ed292de1e567de57f7e2cecc1ecc');\nhashMap.set('nix','d3283c2b948695a16c1089da4e2689faacd50eaa7d734d6fa5d6661aef6db7e7');\nhashMap.set('nodenv','ac652c28481b001f7471f4183eac07b45d98ecbe83efc275830b0a1b2e0459b8');\nhashMap.set('npm','a9dd3ac956df732c0e2947df926e1892633f455596bdd4b55625f93d07dc8fcf');\nhashMap.set('nuget','0cce80e43ab9b21a98a8ecff8a835adf0ccc1c003cf71e7cf9c1e64293884464');\nhashMap.set('nvm','3eb77c7b0acf6d64753de78fad2499b352719853aa6872878c40675d14152322');\nhashMap.set('ocb','032b216684c14b0954e0bb019513a2aca3faaee5748587acb668d377d7c891ca');\nhashMap.set('osgi','32233a1a8a2725699d7448ba438e3d0b78141f7799cd2b588de278d41e26ed10');\nhashMap.set('pep621','f5dc3c8434845dd814bc649c619323dcb69e3ec5da2d361d353bdf6ae3cc5d88');\nhashMap.set('pep723','b96683163de63ed93207ec0538066705b1e58a1cd5b8bd11c63fc28b26bddba1');\nhashMap.set('pip-compile','9711b1c00da18ff785e624c50e4b042519e7ad615c5f018f08459fac8394fec5');\nhashMap.set('pip_requirements','537ef9d7b43b5adcfbfbb86392e0c7a8a0ee91c804118af83cf92e1868949e1a');\nhashMap.set('pip_setup','0175fe550c19d9bd31c978bd83fdc088cb40fcacd5d6751f640164274ae64e61');\nhashMap.set('pipenv','3b8a32a7879ac9798bd119315113e151bd843cae8f25bd1fbd376d574c9a726b');\nhashMap.set('pixi','3732f052617efd5007ddbe31091a2ba026909288bac4cbbe6d2bd6ac64d85393');\nhashMap.set('poetry','6cf6bc5116458761b2d6779caf465d6e26768fbe6e2ffba54b5da981aa8c385f');\nhashMap.set('pre-commit','17a5f183985ebffe98785a541d3609bf25efedc387deb3d50e9f00f02b25f615');\nhashMap.set('proto','412053d4550026b4ace490b46e970915b87ec1abf0b0a0c6c8c58ccf1fc16843');\nhashMap.set('pub','a2ded51959d48e053b811b3b9330b2460fc61d0fc2e74a400a546e4f82d25767');\nhashMap.set('puppet','ba58ab689e44acc8f61c3569ab8b40fde01b8a9d3aad712708e2a419e57d8b45');\nhashMap.set('pyenv','9ede8becc97774f9040b40f4472d3e933534b596e04c360bfe0f3c6f95f25182');\nhashMap.set('quadlet','e1fc88a4e14cd595e89bb3d79b4adf2add3ce5eb80f75276e712c32598cca53d');\nhashMap.set('renovate-config','2a4e4fb671aed5d0c900b8d54c31bfef46ca36d0f4e16b00ff73377b9c09fb69');\nhashMap.set('ruby-version','2db2140d9eee8c555e729a4de0396fa2d78846d3149890ee12fa515bd654be97');\nhashMap.set('runtime-version','b582b168c0cc595e39010feb10f4b97a82683eb269e9598216fbb11cc186e160');\nhashMap.set('rust-toolchain','6ace53db02874d73620d2d872291839820a512a9529c42d174358c692e5db720');\nhashMap.set('sbt','e508c2e2fb8d44e6cbec20f449c8eed096728566e6058187269c637930d388fb');\nhashMap.set('scalafmt','9d36159b56835e96498af026a1fb0543200db0581681ef95ec54988f411e180f');\nhashMap.set('setup-cfg','7dea08c5708625e753bd56918bc214df7fb4d8543a26e936926a21ab43b5f785');\nhashMap.set('smithy','9641b91d065ffb63be0dd888139a0402dba41e550f8b44c592db9daf52109100');\nhashMap.set('sveltos','05b3158e88771ed4629e171592cf4f1bf0ff342f8aeae89be0b340c630cc6d8e');\nhashMap.set('swift','eb5f7c3c4dabf28eed36916269ca9be16ab9ddb83993db03ea66b9195ad7bdc6');\nhashMap.set('tekton','fdc5b9b5edec2a90cda2f858f3ebc532aa8efb1187d1e0b7c89b07796e9cb6cd');\nhashMap.set('terraform','64055fb8b607821d40e407d93f0313fe55ce7c8826e1fdaefa719f13475efbc2');\nhashMap.set('terraform-version','ec8f786b9731d47f2c2fe0307caf64d7ddd83046fe7ff1f7d8423239f8b0f2aa');\nhashMap.set('terragrunt','ffcbaa67dd65f064d43f8c121c1006115eab1879c4bd38de263b9b90a009c118');\nhashMap.set('terragrunt-version','eea6087b33717d22ede2fc68c2f64df8390b75abe82110ed831a180648feb51d');\nhashMap.set('tflint-plugin','31247d37bc80aae17039bfa21bd989c5717730c5ef10cf2a6f09841576d012ec');\nhashMap.set('travis','bb482a0195cd009ec3896a6227bb95617f5c84bedb518c7d971e50c62235d9ca');\nhashMap.set('typst','d080a79fbd961c6e21fcc505d544b7e0ff2126142acb1dcabdf6abbcd9339248');\nhashMap.set('unity3d','f13e25e115e3443f4e16cf31578acffa78fb1a5e23339680a92d8d6de6052920');\nhashMap.set('velaci','fda00ddb7cc23e9a37e0a8a253151df0a6930b4276d3e4f78cc54b9ac09af7de');\nhashMap.set('vendir','ee9cc316c73ab0944da494bf36cfeafba8e79a36ec77753b9f341c8e80f1d602');\nhashMap.set('woodpecker','6110d3bec33aaeb3511d4bbfa896cec3c8e02fb04a6cff50c9ba81061c851045');\nhashMap.set('xcodegen','dad511d88a9ce1dbdde8b9731f3da7f2bdaa4ca8a083294ee58d56da62ab1683');\nhashMap.set('jsonata','efd520a9f674c6dcd4edde61e8d14ddbb29a60bcfd6a92e6179197faebf63e84');\nhashMap.set('regex','dbe6889ea021a05127fed06226d73366fdada2ae577147a5c027996fd325416e');"],"mappings":";AAAA,MAAa,0BAAU,IAAI,IAAoB;AAE/C,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,kBAAiB,kEAAkE;AAC/F,QAAQ,IAAI,OAAM,kEAAkE;AACpF,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,QAAO,kEAAkE;AACrF,QAAQ,IAAI,mBAAkB,kEAAkE;AAChG,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,kBAAiB,kEAAkE;AAC/F,QAAQ,IAAI,SAAQ,kEAAkE;AACtF,QAAQ,IAAI,gBAAe,kEAAkE;AAC7F,QAAQ,IAAI,YAAW,kEAAkE;AACzF,QAAQ,IAAI,SAAQ,kEAAkE;AACtF,QAAQ,IAAI,uBAAsB,kEAAkE;AACpG,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,aAAY,kEAAkE;AAC1F,QAAQ,IAAI,cAAa,kEAAkE;AAC3F,QAAQ,IAAI,OAAM,kEAAkE;AACpF,QAAQ,IAAI,eAAc,kEAAkE;AAC5F,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,QAAO,kEAAkE;AACrF,QAAQ,IAAI,SAAQ,k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ACtF,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,mBAAkB,kEAAkE;AAChG,QAAQ,IAAI,gBAAe,kEAAkE;AAC7F,QAAQ,IAAI,mBAAkB,kEAAkE;AAChG,QAAQ,IAAI,kBAAiB,kEAAkE;AAC/F,QAAQ,IAAI,OAAM,kEAAkE;AACpF,QAAQ,IAAI,YAAW,kEAAkE;AACzF,QAAQ,IAAI,aAAY,kEAAkE;AAC1F,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,SAAQ,kEAAkE;AACtF,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,aAAY,kEAAkE;AAC1F,QAAQ,IAAI,qBAAoB,kEAAkE;AAClG,QAAQ,IAAI,cAAa,kEAAkE;AAC3F,QAAQ,IAAI,sBAAqB,kEAAkE;AACnG,QAAQ,IAAI,iBAAgB,kEAAkE;AAC9F,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,SAAQ,kEAAkE;AACtF,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,cAAa,kEAAkE;AAC3F,QAAQ,IAAI,YAAW,kEAAkE;AACzF,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,SAAQ,kEAAkE"}
|
|
1
|
+
{"version":3,"file":"fingerprint.generated.js","names":[],"sources":["../../../lib/modules/manager/fingerprint.generated.ts"],"sourcesContent":["export const hashMap = new Map<string, string>();\n\nhashMap.set('ansible','1d3568f42393d697f8f96d461b72077ee7a1044b654e87667a12f861b3083111');\nhashMap.set('ansible-galaxy','8226d47128f2018825d4d6f84794e3183eb79c706045fa7e88491edd5e64106f');\nhashMap.set('ant','2df5943cf0ed19a21b94df13729dbb925655548130caf37e3e22bebaed518e17');\nhashMap.set('argocd','5d35b1992e53130bf83b0e59a0f90ccd3a78919974c69044f306dc5d162f48ce');\nhashMap.set('asdf','b2acfc0a6164e9a279daa724777c423f84572dafb0df09b1b0cf6f205f9eb6d0');\nhashMap.set('azure-pipelines','4f635b0ecd388ee266d992e8281fd40e3db2f5867d86fc1cbce72dc33a66e796');\nhashMap.set('batect','bd9208444eff1a4958061484db66a47b616c31f15a8d49d23b75c4560fcee83e');\nhashMap.set('batect-wrapper','d999355511ea7f4053325a18b8cfc8d2b586c61e6760c35e557d383a673e3939');\nhashMap.set('bazel','4994a8bd86d5bfb169d67c08efd8509b58c368c2bf3dd9bbe42553c0fabc3f1a');\nhashMap.set('bazel-module','40f6a862b4e72fcc7262ee41f8b570ea3fd5600d6d552b94ed3301bb201f5db5');\nhashMap.set('bazelisk','d71489650feefb0dbbe7461f924cb50e41c8eef8fe2e11acdec2d42d0212c8ef');\nhashMap.set('bicep','7246e0bfc06e0e28cbb03ac088c5591f648956b086e106aeb251fe5d628329db');\nhashMap.set('bitbucket-pipelines','59c0503494ab1442b127914503c01b97ac17b6742b19c632292d5aa24de115cd');\nhashMap.set('bitrise','478dfd316221fad7c29e177c70d1018d832fb2626b53308a5d0f1f0380e69f42');\nhashMap.set('buildkite','a93effb1f1c5d65b3277c3b4709924eacde282e8efd028a8e3d8c1ce3ef69407');\nhashMap.set('buildpacks','6bef3cb04d66b5cfbb195adb4829bcbccae6408518706744d291bacf0610421f');\nhashMap.set('bun','691aa0bd20c20f7e05be5d231ed14dccdf81b9399d062448794176403aa53d94');\nhashMap.set('bun-version','df3ae8e4a5de1fa1b4544f3d7fc8117e80adb1e151c46d1ede54a4dbea6521e4');\nhashMap.set('bundler','4f70ac0377893683eb30013bf4d23a8bd7213a883847c9eaadf1217f5f190ee1');\nhashMap.set('cake','ed6d14c96161f1d3d927adc7e333b96585164e1f25151a87990914d57ae17fe1');\nhashMap.set('cargo','13377c53df158cdfc58330f73682fadc3e88e57f0d22c9245c0ffd62a495edf1');\nhashMap.set('cdnurl','d3edf6cdc38e92eb43ff5a2b4e8df6a6a13154cf83244725c39e28d7e6ea9177');\nhashMap.set('circleci','91cbeb33ea20f9838e2c81a1195eb806f0b38fa282bc3679f62552f20575ca85');\nhashMap.set('cloudbuild','8c0c739f7e4082bbfe8e3fdffebaf43e26f70a1314d95b306e9b93e4f4297886');\nhashMap.set('cocoapods','cf48ab5a573a28bf14d5e6c84eed9ca08b7f0cb5b7fc51d795c21c7254bb9dd1');\nhashMap.set('composer','869aab556d9b2ca2b743a790a7c0d7d104d62bbcbcc2185c44c64543d70413ba');\nhashMap.set('conan','74ca922a0ffdf1a9dd44b83eb2b3a36c56c7d792031e3a4a484f293046be3ecd');\nhashMap.set('copier','06a52206ba5542f99f056c832245196afd4b78bffeca088f710a5df958a9693d');\nhashMap.set('cpanfile','07813fec3f3c2197056500e9266a0553b9774c02f2c74d5ca2e213188c7c12d3');\nhashMap.set('crossplane','5c26b1201a1a51454ffb94d829e223a76a781569bf79cdb1e47087c30233ec40');\nhashMap.set('crow','eb9a5f9f95041855dded67bcce3dd54724f690995ed6268d272e8a666ff28fd0');\nhashMap.set('deno','a43016a9a469e0472f00855c8db64bb65ef5ffa773e7bbfade02a21400f67690');\nhashMap.set('deps-edn','c87dd5e88587147ad1a78f047b814f3c4aa60d6de30d0c49d849391eeaf1b64c');\nhashMap.set('devbox','a608d1e6db93a8f997d41f8dee7b67533452a956057865978342e2819272e0a9');\nhashMap.set('devcontainer','24320ed1cb6191d04cb8b2707214d82c08c682597aed1d84f250aa00ad1632ec');\nhashMap.set('docker-compose','5441af5b5abf8d347e46002d47f02f85743401bda28232f49fb7b3bbb772a4fb');\nhashMap.set('dockerfile','54122792bf8ea0be98e0a0716e627e3115b40a5f0155ccd7ae0cfc52424a3478');\nhashMap.set('droneci','237c8de87b9bf653fb943b56e84e99c45f6d86ae27d86e599b3f3f99c35ba8ee');\nhashMap.set('fleet','d73d5d35f10df0599a561d9c8d25f3935350407d0e3bd3a1d1545295f278912e');\nhashMap.set('flux','70833dd068ea0a746a9392469e7904021562c7629428d0cd554603bad4eb6ce5');\nhashMap.set('fvm','9b161df0f14bc6e536368952adf373e343630097121a913cea60ee284027fb90');\nhashMap.set('git-submodules','e95bbc9b69a36dee82e255e8983640b7179cb5f17d24b035c6cf01d9635b35bd');\nhashMap.set('github-actions','0a77751d4307d7e923bf2d05bf49084e77a23d7f1e498a1373202dd1ebdcc48a');\nhashMap.set('gitlabci','33c264edf7837fb8fbc4cf0078c8bd2d5a75431039b1db65bf47356df7753125');\nhashMap.set('gitlabci-include','ef696c478c2ac1723b3aca070ba9779be0e702fff0844054251ba0029523d0eb');\nhashMap.set('glasskube','93e7b9000a17efa15a1abaaf320b5af9169b1ecd828fc0c881d98570ef9d9e30');\nhashMap.set('gleam','02389785183c39d2896d7893414c5e1060023f95c1fe7b595bd06cc5c1186d39');\nhashMap.set('gomod','073cf874c14d8f323aa7dc467e757b39e249e4617be1ce10926ee68763f89381');\nhashMap.set('gradle','550f1107f0ac27d18fa76a7d5c0c0b317b5df4156fc12cfd378573ccfe26fca0');\nhashMap.set('gradle-wrapper','799d9bb8d9dead673fb513ba4936395f14da30897d33a9df46b3266e1b835d5d');\nhashMap.set('haskell-cabal','f232d0e883235f74ed71fd9de4a7468e5fcbda9a1af5beb56c24657f7bf2e891');\nhashMap.set('helm-requirements','4d90e5e18a380876ad48e21e1ad88ea62e25d973a1ddaa3763447fc0a9f9915b');\nhashMap.set('helm-values','b5c52c6a27d805557418c585c5d3030c95ee641d53057021f3fe060f81b6e1af');\nhashMap.set('helmfile','ab828a1877cfe029ed5f8dd2a026409cd5e6431705af3aac3f56a3bc4f827508');\nhashMap.set('helmsman','ef9680c612f702c7f07aea9b6e5d811e91214dcfa5755c9f3803e9528090935e');\nhashMap.set('helmv3','4088a90bd8be4ae1bcb85dc4d34d3fbbb75e72bd33d144284e7e1f0e726c8d3b');\nhashMap.set('hermit','61e132cfccbe4e3884801a3728f3391455c214811a33c1f733b0dea7122bbbb6');\nhashMap.set('homeassistant-manifest','05043c6db870cffbb6f8f3e351c025e3de227eaae0b24134b796aec46f84b65f');\nhashMap.set('homebrew','9c64a4f1475b1c2052372e566c9190f32ae8acd1c54313031d55ae8772388367');\nhashMap.set('html','67c5f3c5c58e96f5dd257ba5987d900cf7fef81d667c3640e96c847b37de35a8');\nhashMap.set('jenkins','268ebfc8a1caf3edeb2192c2b1b2fa4bf18a78a3e731ba20a6c104940a5539f3');\nhashMap.set('jsonnet-bundler','4023ef4cac55fe58f8d9744ae86b13532298926e35e22d250334cde55c3386ff');\nhashMap.set('kotlin-script','99ef296792a0ca575ed31d3defb514b05a58083dc01c52ea0890c69d867ba1dd');\nhashMap.set('kubernetes','321e7d77fb3600dd4c00a86eaa1294927e7f92300b74fa2977d813dcaa3bb4de');\nhashMap.set('kustomize','fb5f6fbf45b318ca277d6d9f7fee22680f4b99c7ff9170a50315122918d2e007');\nhashMap.set('leiningen','133fca2c3423f53f2ccc22518153ddbcafbf0f4812376c77e952eb3d24d81f85');\nhashMap.set('maven','f084cdc88320ca1e82af957d0008e7c9ce991d3282cb428f3108a5722239cead');\nhashMap.set('maven-wrapper','779344a4e259e0c28bfadfeb435dd72feb7224d7346d038a1c35f02deb1357bc');\nhashMap.set('meteor','4a93a326b27bedfe52118e27e06f39fecd7c55bd4cd7fccec4cb120cac14cec4');\nhashMap.set('mint','248fe4f1ea5c985921c286785792c97e06fc41f402b2d45df82f6aecd17f710e');\nhashMap.set('mise','8463d355091f5f167e3f4a8adbebfe49310ad9ac45c89d60455ef8e110df4a49');\nhashMap.set('mix','5eb001e2af7cd664d811ad2d9928bf785527ed292de1e567de57f7e2cecc1ecc');\nhashMap.set('nix','d3283c2b948695a16c1089da4e2689faacd50eaa7d734d6fa5d6661aef6db7e7');\nhashMap.set('nodenv','ac652c28481b001f7471f4183eac07b45d98ecbe83efc275830b0a1b2e0459b8');\nhashMap.set('npm','95ddcec26d4db9ee54028f00fdcac118c458cd1513623737dd1b3f79d05a11a4');\nhashMap.set('nuget','d4f3c5cbc0f6e6e8baf80b8ad8e184d186ff6686486b1c97995a0c87151abbe3');\nhashMap.set('nvm','3eb77c7b0acf6d64753de78fad2499b352719853aa6872878c40675d14152322');\nhashMap.set('ocb','032b216684c14b0954e0bb019513a2aca3faaee5748587acb668d377d7c891ca');\nhashMap.set('osgi','32233a1a8a2725699d7448ba438e3d0b78141f7799cd2b588de278d41e26ed10');\nhashMap.set('pep621','f5dc3c8434845dd814bc649c619323dcb69e3ec5da2d361d353bdf6ae3cc5d88');\nhashMap.set('pep723','b96683163de63ed93207ec0538066705b1e58a1cd5b8bd11c63fc28b26bddba1');\nhashMap.set('pip-compile','9711b1c00da18ff785e624c50e4b042519e7ad615c5f018f08459fac8394fec5');\nhashMap.set('pip_requirements','537ef9d7b43b5adcfbfbb86392e0c7a8a0ee91c804118af83cf92e1868949e1a');\nhashMap.set('pip_setup','0175fe550c19d9bd31c978bd83fdc088cb40fcacd5d6751f640164274ae64e61');\nhashMap.set('pipenv','a7d45859427263c17f1109a08c8b48a1f24812290f9853013ec1774f2484a769');\nhashMap.set('pixi','3732f052617efd5007ddbe31091a2ba026909288bac4cbbe6d2bd6ac64d85393');\nhashMap.set('poetry','6cf6bc5116458761b2d6779caf465d6e26768fbe6e2ffba54b5da981aa8c385f');\nhashMap.set('pre-commit','17a5f183985ebffe98785a541d3609bf25efedc387deb3d50e9f00f02b25f615');\nhashMap.set('proto','412053d4550026b4ace490b46e970915b87ec1abf0b0a0c6c8c58ccf1fc16843');\nhashMap.set('pub','a2ded51959d48e053b811b3b9330b2460fc61d0fc2e74a400a546e4f82d25767');\nhashMap.set('puppet','ba58ab689e44acc8f61c3569ab8b40fde01b8a9d3aad712708e2a419e57d8b45');\nhashMap.set('pyenv','9ede8becc97774f9040b40f4472d3e933534b596e04c360bfe0f3c6f95f25182');\nhashMap.set('quadlet','e1fc88a4e14cd595e89bb3d79b4adf2add3ce5eb80f75276e712c32598cca53d');\nhashMap.set('renovate-config','2a4e4fb671aed5d0c900b8d54c31bfef46ca36d0f4e16b00ff73377b9c09fb69');\nhashMap.set('ruby-version','2db2140d9eee8c555e729a4de0396fa2d78846d3149890ee12fa515bd654be97');\nhashMap.set('runtime-version','b582b168c0cc595e39010feb10f4b97a82683eb269e9598216fbb11cc186e160');\nhashMap.set('rust-toolchain','6ace53db02874d73620d2d872291839820a512a9529c42d174358c692e5db720');\nhashMap.set('sbt','e508c2e2fb8d44e6cbec20f449c8eed096728566e6058187269c637930d388fb');\nhashMap.set('scalafmt','9d36159b56835e96498af026a1fb0543200db0581681ef95ec54988f411e180f');\nhashMap.set('setup-cfg','7dea08c5708625e753bd56918bc214df7fb4d8543a26e936926a21ab43b5f785');\nhashMap.set('smithy','9641b91d065ffb63be0dd888139a0402dba41e550f8b44c592db9daf52109100');\nhashMap.set('sveltos','05b3158e88771ed4629e171592cf4f1bf0ff342f8aeae89be0b340c630cc6d8e');\nhashMap.set('swift','eb5f7c3c4dabf28eed36916269ca9be16ab9ddb83993db03ea66b9195ad7bdc6');\nhashMap.set('tekton','fdc5b9b5edec2a90cda2f858f3ebc532aa8efb1187d1e0b7c89b07796e9cb6cd');\nhashMap.set('terraform','b6723d78863803e688d2b85cc72bc43657d79ff0cca3bc719e7d96cfd34ceb69');\nhashMap.set('terraform-version','ec8f786b9731d47f2c2fe0307caf64d7ddd83046fe7ff1f7d8423239f8b0f2aa');\nhashMap.set('terragrunt','ffcbaa67dd65f064d43f8c121c1006115eab1879c4bd38de263b9b90a009c118');\nhashMap.set('terragrunt-version','eea6087b33717d22ede2fc68c2f64df8390b75abe82110ed831a180648feb51d');\nhashMap.set('tflint-plugin','31247d37bc80aae17039bfa21bd989c5717730c5ef10cf2a6f09841576d012ec');\nhashMap.set('travis','bb482a0195cd009ec3896a6227bb95617f5c84bedb518c7d971e50c62235d9ca');\nhashMap.set('typst','d080a79fbd961c6e21fcc505d544b7e0ff2126142acb1dcabdf6abbcd9339248');\nhashMap.set('unity3d','f13e25e115e3443f4e16cf31578acffa78fb1a5e23339680a92d8d6de6052920');\nhashMap.set('velaci','fda00ddb7cc23e9a37e0a8a253151df0a6930b4276d3e4f78cc54b9ac09af7de');\nhashMap.set('vendir','ee9cc316c73ab0944da494bf36cfeafba8e79a36ec77753b9f341c8e80f1d602');\nhashMap.set('woodpecker','6110d3bec33aaeb3511d4bbfa896cec3c8e02fb04a6cff50c9ba81061c851045');\nhashMap.set('xcodegen','dad511d88a9ce1dbdde8b9731f3da7f2bdaa4ca8a083294ee58d56da62ab1683');\nhashMap.set('jsonata','416bcf61144b276b3112814c6e6d261aa29608f46fbb0516c471d35c16f8f0d7');\nhashMap.set('regex','dbe6889ea021a05127fed06226d73366fdada2ae577147a5c027996fd325416e');"],"mappings":";AAAA,MAAa,0BAAU,IAAI,IAAoB;AAE/C,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,kBAAiB,kEAAkE;AAC/F,QAAQ,IAAI,OAAM,kEAAkE;AACpF,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,QAAO,kEAAkE;AACrF,QAAQ,IAAI,mBAAkB,kEAAkE;AAChG,QAAQ,IAAI,UAAS,kEAAkE;AACvF,QAAQ,IAAI,kBAAiB,kEAAkE;AAC/F,QAAQ,IAAI,SAAQ,kEAAkE;AACtF,QAAQ,IAAI,gBAAe,kEAAkE;AAC7F,QAAQ,IAAI,YAAW,kEAAkE;AACzF,QAAQ,IAAI,SAAQ,kEAAkE;AACtF,QAAQ,IAAI,uBAAsB,kEAAkE;AACpG,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,aAAY,kEAAkE;AAC1F,QAAQ,IAAI,cAAa,kEAAkE;AAC3F,QAAQ,IAAI,OAAM,kEAAkE;AACpF,QAAQ,IAAI,eAAc,kEAAkE;AAC5F,QAAQ,IAAI,WAAU,kEAAkE;AACxF,QAAQ,IAAI,QAAO,kEAAkE;AACrF,QAAQ,IAAI,SAAQ,kEAAkE;AACtF,QAAQ,IAAI,UAAS,kEAAkE;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*)?|(?:ratchet:[\w-]+\/[.\w-]+(?:\/[.\w-]+)*))?@?(?<version>([\w-]*[-/])?v?\d+(?:\.\d+(?:\.\d+)?)?(?:-[a-zA-Z0-9.]+)?)/);
|
|
95
95
|
const versionLikeRe = regEx(/^v?\d+/);
|
|
96
96
|
const bareTokenRe = regEx(/^\s*(?<token>\S+)\s*$/);
|
|
97
97
|
function parseComment(commentBody) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","names":[],"sources":["../../../../lib/modules/manager/github-actions/parse.ts"],"sourcesContent":["import is from '@sindresorhus/is';\nimport { regEx } from '../../../util/regex.ts';\n\nfunction splitFirstFrom(\n str: string,\n sep: string,\n start: number,\n): [string, string] | null {\n const idx = str.indexOf(sep, start);\n if (idx === -1) {\n return null;\n }\n return [str.slice(0, idx), str.slice(idx + sep.length)];\n}\n\nfunction splitFirst(str: string, sep: string): [string, string] | null {\n return splitFirstFrom(str, sep, 0);\n}\n\ninterface QuotedValue {\n value: string;\n quote: string;\n}\n\nexport function parseQuote(input: string): QuotedValue {\n const trimmed = input.trim();\n const first = trimmed[0];\n const last = trimmed.at(-1);\n\n if (\n trimmed.length >= 2 &&\n first === last &&\n (first === '\"' || first === \"'\")\n ) {\n return { value: trimmed.slice(1, -1), quote: first };\n }\n\n return { value: trimmed, quote: '' };\n}\n\n/**\n * Docker container:\n * - `docker://image:tag`\n * - `docker://image@digest`\n * - `docker://image:tag@digest`\n */\nexport interface DockerReference {\n kind: 'docker';\n image: string;\n tag?: string;\n digest?: string;\n originalRef: string;\n}\n\n/**\n * Local file or directory:\n * - `./path/to/action`\n * - `./.github/workflows/main.yml`\n */\nexport interface LocalReference {\n kind: 'local';\n path: string;\n}\n\n/**\n * Repository:\n * - `owner/repo[/path]@ref`\n * - `https://host/owner/repo[/path]@ref`\n */\nexport interface RepositoryReference {\n kind: 'repository';\n\n hostname: string;\n isExplicitHostname: boolean;\n\n owner: string;\n repo: string;\n path?: string;\n\n ref: string;\n}\n\nexport type ActionReference =\n | DockerReference\n | LocalReference\n | RepositoryReference;\n\nexport interface ParsedUsesLine {\n /** The whitespace before \"uses:\" */\n indentation: string;\n\n /** The `uses:` (and optional `-`) part */\n usesPrefix: string;\n\n /** The raw value part, potentially quoted (e.g. `actions/checkout@v2`) */\n replaceString: string;\n\n /** Whitespace between value and `#` */\n commentPrecedingWhitespace: string;\n\n /** The full comment including `#` */\n commentString: string;\n\n actionRef: ActionReference | null;\n commentData: CommentData;\n\n /** The quote char used (' or \" or empty) */\n quote: string;\n}\n\nconst shaRe = regEx(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/);\nconst shaShortRe = regEx(/^[a-f0-9]{6,7}$/);\n\nexport function isSha(str: string): boolean {\n return shaRe.test(str);\n}\n\nexport function isShortSha(str: string): boolean {\n return shaShortRe.test(str);\n}\n\nconst DOCKER_PREFIX = 'docker://';\n\nfunction parseDockerReference(input: string): DockerReference | null {\n const originalRef = input.slice(DOCKER_PREFIX.length);\n if (!originalRef) {\n return null;\n }\n\n const digestParts = splitFirst(originalRef, '@');\n if (digestParts) {\n const [image, digest] = digestParts;\n return { kind: 'docker', image, digest, originalRef };\n }\n\n // Find tag: look for first colon after last slash (to avoid matching port in registry)\n const lastSlashIndex = originalRef.lastIndexOf('/');\n const searchStart = lastSlashIndex === -1 ? 0 : lastSlashIndex + 1;\n const tagParts = splitFirstFrom(originalRef, ':', searchStart);\n\n if (tagParts) {\n const [image, tag] = tagParts;\n return { kind: 'docker', image, tag, originalRef };\n }\n\n return { kind: 'docker', image: originalRef, originalRef };\n}\n\nconst repositoryActionRegex = regEx(\n /^(?:https:\\/\\/(?<hostname>[^/]+)\\/)?(?<owner>[^/]+)\\/(?<repo>[^/]+)(?:\\/(?<path>.+?))?@(?<ref>.+)$/,\n);\n\nfunction parseRepositoryReference(input: string): RepositoryReference | null {\n const match = repositoryActionRegex.exec(input);\n if (!match?.groups) {\n return null;\n }\n\n const { owner, repo, path, ref } = match.groups;\n\n let { hostname } = match.groups;\n let isExplicitHostname = true;\n if (is.undefined(hostname)) {\n hostname = 'github.com';\n isExplicitHostname = false;\n }\n\n return {\n kind: 'repository',\n hostname,\n isExplicitHostname,\n owner,\n repo,\n path,\n ref,\n };\n}\n\nexport function parseActionReference(uses: string): ActionReference | null {\n if (!uses) {\n return null;\n }\n\n if (uses.startsWith(DOCKER_PREFIX)) {\n return parseDockerReference(uses);\n }\n\n if (uses.startsWith('./') || uses.startsWith('../')) {\n return { kind: 'local', path: uses };\n }\n\n return parseRepositoryReference(uses);\n}\n\nexport interface CommentData {\n pinnedVersion?: string;\n ref?: string;\n ratchetExclude?: boolean;\n matchedString?: string;\n index?: number;\n}\n\nconst pinTokenRe = regEx(\n /^\\s*(?:(?:renovate\\s*:\\s*)?(?:pin\\s+|tag\\s*=\\s*)?|(?:ratchet:[\\w-]+\\/[.\\w-]+))?@?(?<version>([\\w-]*[-/])?v?\\d+(?:\\.\\d+(?:\\.\\d+)?)?(?:-[a-zA-Z0-9.]+)?)/,\n);\n\nexport const versionLikeRe = regEx(/^v?\\d+/);\n\nconst bareTokenRe = regEx(/^\\s*(?<token>\\S+)\\s*$/);\n\nexport function parseComment(commentBody: string): CommentData {\n const trimmed = commentBody.trim();\n if (trimmed === 'ratchet:exclude') {\n return { ratchetExclude: true };\n }\n\n // We use commentBody (with leading spaces) to get the correct index relative to the comment start\n const match = pinTokenRe.exec(commentBody);\n if (match?.groups?.version) {\n return {\n pinnedVersion: match.groups.version,\n matchedString: match[0],\n index: match.index,\n };\n }\n\n const bareMatch = bareTokenRe.exec(commentBody);\n if (bareMatch?.groups?.token) {\n return {\n ref: bareMatch.groups.token,\n matchedString: bareMatch[0],\n index: bareMatch.index,\n };\n }\n\n return {};\n}\n\nconst usesLineRegex = regEx(\n /^(?<prefix>\\s+(?:-\\s+)?uses\\s*:\\s*)(?<remainder>.+)$/,\n);\n\n/**\n * Parses a GitHub Actions `uses:` line into its components.\n *\n * Expected line format:\n * ```\n * <indentation>[- ]uses: [quote]<action-reference>[quote][ # <comment>]\n * ```\n *\n * Examples:\n * - ` uses: actions/checkout@v4`\n * - ` - uses: \"owner/repo@abc123\" # v1.0.0`\n * - ` uses: docker://alpine:3.18`\n *\n * @returns Parsed components or `null` if the line doesn't match `uses:` pattern\n */\nexport function parseUsesLine(line: string): ParsedUsesLine | null {\n const match = usesLineRegex.exec(line);\n if (!match?.groups) {\n return null;\n }\n\n const { prefix, remainder } = match.groups;\n\n if (remainder.startsWith('#')) {\n return null;\n }\n\n const indentation = prefix.slice(0, prefix.indexOf('uses'));\n\n // We look for ' #' to determine where the comment starts.\n // This is a safe heuristic for valid \"uses\" values which cannot contain spaces.\n const commentIndex = remainder.indexOf(' #');\n\n // No comment case\n if (commentIndex === -1) {\n const { value, quote } = parseQuote(remainder);\n return {\n indentation,\n usesPrefix: prefix,\n replaceString: remainder.trim(),\n commentPrecedingWhitespace: '',\n commentString: '',\n actionRef: parseActionReference(value),\n commentData: {},\n quote,\n };\n }\n\n // Has comment: split value and comment\n const rawValuePart = remainder.slice(0, commentIndex);\n const commentPart = remainder.slice(commentIndex + 1); // starts at #\n\n // Calculate whitespace between value and #\n const partBeforeHash = remainder.slice(0, commentIndex + 1);\n const commentPrecedingWhitespace = partBeforeHash.slice(\n partBeforeHash.trimEnd().length,\n );\n\n const { value, quote } = parseQuote(rawValuePart);\n // commentPart always starts with '#' (see commentIndex search above)\n const cleanCommentBody = commentPart.slice(1);\n\n return {\n indentation,\n usesPrefix: prefix,\n replaceString: rawValuePart.trim(),\n commentPrecedingWhitespace,\n commentString: commentPart,\n actionRef: parseActionReference(value),\n commentData: parseComment(cleanCommentBody),\n quote,\n };\n}\n"],"mappings":";;;AAGA,SAAS,eACP,KACA,KACA,OACyB;CACzB,MAAM,MAAM,IAAI,QAAQ,KAAK,KAAK;CAClC,IAAI,QAAQ,IACV,OAAO;CAET,OAAO,CAAC,IAAI,MAAM,GAAG,GAAG,GAAG,IAAI,MAAM,MAAM,IAAI,MAAM,CAAC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O,MAAM,GAAG,OAAO,QAAQ,MAAM,CAAC;CAI1D,MAAM,eAAe,UAAU,QAAQ,IAAI;CAG3C,IAAI,iBAAiB,IAAI;EACvB,MAAM,EAAE,OAAO,UAAU,WAAW,SAAS;EAC7C,OAAO;GACL;GACA,YAAY;GACZ,eAAe,UAAU,KAAK;GAC9B,4BAA4B;GAC5B,eAAe;GACf,WAAW,qBAAqB,KAAK;GACrC,aAAa,CAAC;GACd;EACF;CACF;CAGA,MAAM,eAAe,UAAU,MAAM,GAAG,YAAY;CACpD,MAAM,cAAc,UAAU,MAAM,eAAe,CAAC;CAGpD,MAAM,iBAAiB,UAAU,MAAM,GAAG,eAAe,CAAC;CAC1D,MAAM,6BAA6B,eAAe,MAChD,eAAe,QAAQ,CAAC,CAAC,MAC3B;CAEA,MAAM,EAAE,OAAO,UAAU,WAAW,YAAY;CAEhD,MAAM,mBAAmB,YAAY,MAAM,CAAC;CAE5C,OAAO;EACL;EACA,YAAY;EACZ,eAAe,aAAa,KAAK;EACjC;EACA,eAAe;EACf,WAAW,qBAAqB,KAAK;EACrC,aAAa,aAAa,gBAAgB;EAC1C;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"parse.js","names":[],"sources":["../../../../lib/modules/manager/github-actions/parse.ts"],"sourcesContent":["import is from '@sindresorhus/is';\nimport { regEx } from '../../../util/regex.ts';\n\nfunction splitFirstFrom(\n str: string,\n sep: string,\n start: number,\n): [string, string] | null {\n const idx = str.indexOf(sep, start);\n if (idx === -1) {\n return null;\n }\n return [str.slice(0, idx), str.slice(idx + sep.length)];\n}\n\nfunction splitFirst(str: string, sep: string): [string, string] | null {\n return splitFirstFrom(str, sep, 0);\n}\n\ninterface QuotedValue {\n value: string;\n quote: string;\n}\n\nexport function parseQuote(input: string): QuotedValue {\n const trimmed = input.trim();\n const first = trimmed[0];\n const last = trimmed.at(-1);\n\n if (\n trimmed.length >= 2 &&\n first === last &&\n (first === '\"' || first === \"'\")\n ) {\n return { value: trimmed.slice(1, -1), quote: first };\n }\n\n return { value: trimmed, quote: '' };\n}\n\n/**\n * Docker container:\n * - `docker://image:tag`\n * - `docker://image@digest`\n * - `docker://image:tag@digest`\n */\nexport interface DockerReference {\n kind: 'docker';\n image: string;\n tag?: string;\n digest?: string;\n originalRef: string;\n}\n\n/**\n * Local file or directory:\n * - `./path/to/action`\n * - `./.github/workflows/main.yml`\n */\nexport interface LocalReference {\n kind: 'local';\n path: string;\n}\n\n/**\n * Repository:\n * - `owner/repo[/path]@ref`\n * - `https://host/owner/repo[/path]@ref`\n */\nexport interface RepositoryReference {\n kind: 'repository';\n\n hostname: string;\n isExplicitHostname: boolean;\n\n owner: string;\n repo: string;\n path?: string;\n\n ref: string;\n}\n\nexport type ActionReference =\n | DockerReference\n | LocalReference\n | RepositoryReference;\n\nexport interface ParsedUsesLine {\n /** The whitespace before \"uses:\" */\n indentation: string;\n\n /** The `uses:` (and optional `-`) part */\n usesPrefix: string;\n\n /** The raw value part, potentially quoted (e.g. `actions/checkout@v2`) */\n replaceString: string;\n\n /** Whitespace between value and `#` */\n commentPrecedingWhitespace: string;\n\n /** The full comment including `#` */\n commentString: string;\n\n actionRef: ActionReference | null;\n commentData: CommentData;\n\n /** The quote char used (' or \" or empty) */\n quote: string;\n}\n\nconst shaRe = regEx(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/);\nconst shaShortRe = regEx(/^[a-f0-9]{6,7}$/);\n\nexport function isSha(str: string): boolean {\n return shaRe.test(str);\n}\n\nexport function isShortSha(str: string): boolean {\n return shaShortRe.test(str);\n}\n\nconst DOCKER_PREFIX = 'docker://';\n\nfunction parseDockerReference(input: string): DockerReference | null {\n const originalRef = input.slice(DOCKER_PREFIX.length);\n if (!originalRef) {\n return null;\n }\n\n const digestParts = splitFirst(originalRef, '@');\n if (digestParts) {\n const [image, digest] = digestParts;\n return { kind: 'docker', image, digest, originalRef };\n }\n\n // Find tag: look for first colon after last slash (to avoid matching port in registry)\n const lastSlashIndex = originalRef.lastIndexOf('/');\n const searchStart = lastSlashIndex === -1 ? 0 : lastSlashIndex + 1;\n const tagParts = splitFirstFrom(originalRef, ':', searchStart);\n\n if (tagParts) {\n const [image, tag] = tagParts;\n return { kind: 'docker', image, tag, originalRef };\n }\n\n return { kind: 'docker', image: originalRef, originalRef };\n}\n\nconst repositoryActionRegex = regEx(\n /^(?:https:\\/\\/(?<hostname>[^/]+)\\/)?(?<owner>[^/]+)\\/(?<repo>[^/]+)(?:\\/(?<path>.+?))?@(?<ref>.+)$/,\n);\n\nfunction parseRepositoryReference(input: string): RepositoryReference | null {\n const match = repositoryActionRegex.exec(input);\n if (!match?.groups) {\n return null;\n }\n\n const { owner, repo, path, ref } = match.groups;\n\n let { hostname } = match.groups;\n let isExplicitHostname = true;\n if (is.undefined(hostname)) {\n hostname = 'github.com';\n isExplicitHostname = false;\n }\n\n return {\n kind: 'repository',\n hostname,\n isExplicitHostname,\n owner,\n repo,\n path,\n ref,\n };\n}\n\nexport function parseActionReference(uses: string): ActionReference | null {\n if (!uses) {\n return null;\n }\n\n if (uses.startsWith(DOCKER_PREFIX)) {\n return parseDockerReference(uses);\n }\n\n if (uses.startsWith('./') || uses.startsWith('../')) {\n return { kind: 'local', path: uses };\n }\n\n return parseRepositoryReference(uses);\n}\n\nexport interface CommentData {\n pinnedVersion?: string;\n ref?: string;\n ratchetExclude?: boolean;\n matchedString?: string;\n index?: number;\n}\n\nconst pinTokenRe = regEx(\n /^\\s*(?:(?:renovate\\s*:\\s*)?(?:pin\\s+|tag\\s*=\\s*)?|(?:ratchet:[\\w-]+\\/[.\\w-]+(?:\\/[.\\w-]+)*))?@?(?<version>([\\w-]*[-/])?v?\\d+(?:\\.\\d+(?:\\.\\d+)?)?(?:-[a-zA-Z0-9.]+)?)/,\n);\n\nexport const versionLikeRe = regEx(/^v?\\d+/);\n\nconst bareTokenRe = regEx(/^\\s*(?<token>\\S+)\\s*$/);\n\nexport function parseComment(commentBody: string): CommentData {\n const trimmed = commentBody.trim();\n if (trimmed === 'ratchet:exclude') {\n return { ratchetExclude: true };\n }\n\n // We use commentBody (with leading spaces) to get the correct index relative to the comment start\n const match = pinTokenRe.exec(commentBody);\n if (match?.groups?.version) {\n return {\n pinnedVersion: match.groups.version,\n matchedString: match[0],\n index: match.index,\n };\n }\n\n const bareMatch = bareTokenRe.exec(commentBody);\n if (bareMatch?.groups?.token) {\n return {\n ref: bareMatch.groups.token,\n matchedString: bareMatch[0],\n index: bareMatch.index,\n };\n }\n\n return {};\n}\n\nconst usesLineRegex = regEx(\n /^(?<prefix>\\s+(?:-\\s+)?uses\\s*:\\s*)(?<remainder>.+)$/,\n);\n\n/**\n * Parses a GitHub Actions `uses:` line into its components.\n *\n * Expected line format:\n * ```\n * <indentation>[- ]uses: [quote]<action-reference>[quote][ # <comment>]\n * ```\n *\n * Examples:\n * - ` uses: actions/checkout@v4`\n * - ` - uses: \"owner/repo@abc123\" # v1.0.0`\n * - ` uses: docker://alpine:3.18`\n *\n * @returns Parsed components or `null` if the line doesn't match `uses:` pattern\n */\nexport function parseUsesLine(line: string): ParsedUsesLine | null {\n const match = usesLineRegex.exec(line);\n if (!match?.groups) {\n return null;\n }\n\n const { prefix, remainder } = match.groups;\n\n if (remainder.startsWith('#')) {\n return null;\n }\n\n const indentation = prefix.slice(0, prefix.indexOf('uses'));\n\n // We look for ' #' to determine where the comment starts.\n // This is a safe heuristic for valid \"uses\" values which cannot contain spaces.\n const commentIndex = remainder.indexOf(' #');\n\n // No comment case\n if (commentIndex === -1) {\n const { value, quote } = parseQuote(remainder);\n return {\n indentation,\n usesPrefix: prefix,\n replaceString: remainder.trim(),\n commentPrecedingWhitespace: '',\n commentString: '',\n actionRef: parseActionReference(value),\n commentData: {},\n quote,\n };\n }\n\n // Has comment: split value and comment\n const rawValuePart = remainder.slice(0, commentIndex);\n const commentPart = remainder.slice(commentIndex + 1); // starts at #\n\n // Calculate whitespace between value and #\n const partBeforeHash = remainder.slice(0, commentIndex + 1);\n const commentPrecedingWhitespace = partBeforeHash.slice(\n partBeforeHash.trimEnd().length,\n );\n\n const { value, quote } = parseQuote(rawValuePart);\n // commentPart always starts with '#' (see commentIndex search above)\n const cleanCommentBody = commentPart.slice(1);\n\n return {\n indentation,\n usesPrefix: prefix,\n replaceString: rawValuePart.trim(),\n commentPrecedingWhitespace,\n commentString: commentPart,\n actionRef: parseActionReference(value),\n commentData: parseComment(cleanCommentBody),\n quote,\n };\n}\n"],"mappings":";;;AAGA,SAAS,eACP,KACA,KACA,OACyB;CACzB,MAAM,MAAM,IAAI,QAAQ,KAAK,KAAK;CAClC,IAAI,QAAQ,IACV,OAAO;CAET,OAAO,CAAC,IAAI,MAAM,GAAG,GAAG,GAAG,IAAI,MAAM,MAAM,IAAI,MAAM,CAAC;AACxD;AAEA,SAAS,WAAW,KAAa,KAAsC;CACrE,OAAO,eAAe,KAAK,KAAK,CAAC;AACnC;AAOA,SAAgB,WAAW,OAA4B;CACrD,MAAM,UAAU,MAAM,KAAK;CAC3B,MAAM,QAAQ,QAAQ;CACtB,MAAM,OAAO,QAAQ,GAAG,EAAE;CAE1B,IACE,QAAQ,UAAU,KAClB,UAAU,SACT,UAAU,QAAO,UAAU,MAE5B,OAAO;EAAE,OAAO,QAAQ,MAAM,GAAG,EAAE;EAAG,OAAO;CAAM;CAGrD,OAAO;EAAE,OAAO;EAAS,OAAO;CAAG;AACrC;AAwEA,MAAM,QAAQ,MAAM,iCAAiC;AACrD,MAAM,aAAa,MAAM,iBAAiB;AAE1C,SAAgB,MAAM,KAAsB;CAC1C,OAAO,MAAM,KAAK,GAAG;AACvB;AAEA,SAAgB,WAAW,KAAsB;CAC/C,OAAO,WAAW,KAAK,GAAG;AAC5B;AAEA,MAAM,gBAAgB;AAEtB,SAAS,qBAAqB,OAAuC;CACnE,MAAM,cAAc,MAAM,MAAM,CAAoB;CACpD,IAAI,CAAC,aACH,OAAO;CAGT,MAAM,cAAc,WAAW,aAAa,GAAG;CAC/C,IAAI,aAAa;EACf,MAAM,CAAC,OAAO,UAA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
|
70
70
|
logger.debug("Performing lockfileUpdate (pnpm)");
|
|
71
71
|
commands.push(`pnpm update --no-save ${lockUpdates.map((update) => `${update.packageName}@${update.newVersion}`).filter(uniqueStrings).map(quote).join(" ")} ${args}`);
|
|
72
72
|
}
|
|
73
|
-
if (config.postUpdateOptions?.includes("pnpmDedupe")) commands.push(`pnpm dedupe ${args}`);
|
|
73
|
+
if (config.postUpdateOptions?.includes("pnpmDedupe")) commands.push(`pnpm dedupe ${args.replace(" --recursive", "")}`);
|
|
74
74
|
if (upgrades.find((upgrade) => upgrade.isLockFileMaintenance)) {
|
|
75
75
|
logger.debug(`Removing ${lockFileName} first due to lock file maintenance upgrade`);
|
|
76
76
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pnpm.js","names":[],"sources":["../../../../../lib/modules/manager/npm/post-update/pnpm.ts"],"sourcesContent":["import { isNumber, isNumericString } from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport upath from 'upath';\nimport { GlobalConfig } from '../../../../config/global.ts';\nimport { TEMPORARY_ERROR } from '../../../../constants/error-messages.ts';\nimport { logger } from '../../../../logger/index.ts';\nimport { exec, getToolSettingsOptions } from '../../../../util/exec/index.ts';\nimport type {\n ExecOptions,\n ExtraEnv,\n ToolConstraint,\n} from '../../../../util/exec/types.ts';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getSiblingFileName,\n localPathExists,\n readLocalFile,\n} from '../../../../util/fs/index.ts';\nimport { uniqueStrings } from '../../../../util/string.ts';\nimport { parseSingleYaml } from '../../../../util/yaml.ts';\nimport type { PostUpdateConfig, Upgrade } from '../../types.ts';\nimport { PNPM_CACHE_DIR, PNPM_STORE_DIR } from '../constants.ts';\nimport type { PnpmWorkspaceFile } from '../extract/types.ts';\nimport { getNodeToolConstraint } from './node-version.ts';\nimport type { GenerateLockFileResult, PnpmLockFile } from './types.ts';\nimport {\n getNodeOptions,\n getPackageManagerVersion,\n lazyLoadPackageJson,\n} from './utils.ts';\n\nfunction getPnpmConstraintFromUpgrades(upgrades: Upgrade[]): string | null {\n for (const upgrade of upgrades) {\n if (upgrade.depName === 'pnpm' && upgrade.newVersion) {\n return upgrade.newVersion;\n }\n }\n return null;\n}\n\nexport async function generateLockFile(\n lockFileDir: string,\n env: NodeJS.ProcessEnv,\n config: PostUpdateConfig,\n upgrades: Upgrade[] = [],\n): Promise<GenerateLockFileResult> {\n const lockFileName = upath.join(lockFileDir, 'pnpm-lock.yaml');\n logger.debug(`Spawning pnpm install to create ${lockFileName}`);\n let lockFile: string | null = null;\n const commands: string[] = [];\n try {\n const lazyPgkJson = lazyLoadPackageJson(lockFileDir);\n const pnpmToolConstraint: ToolConstraint = {\n toolName: 'pnpm',\n constraint:\n getPnpmConstraintFromUpgrades(upgrades) ?? // if pnpm is being upgraded, it comes first\n config.constraints?.pnpm ?? // from user config or extraction\n getPackageManagerVersion('pnpm', await lazyPgkJson.getValue()) ?? // look in package.json > packageManager or engines\n (await getConstraintFromLockFile(lockFileName)), // use lockfileVersion to find pnpm version range\n };\n\n const pnpmConfigCacheDir = await ensureCacheDir(PNPM_CACHE_DIR);\n const pnpmConfigStoreDir = await ensureCacheDir(PNPM_STORE_DIR);\n const extraEnv: ExtraEnv = {\n // those arwe no longer working and it's unclear if they ever worked\n NPM_CONFIG_CACHE: env.NPM_CONFIG_CACHE,\n npm_config_store: env.npm_config_store,\n // these are used by pnpm v5 to v10. Maybe earlier versions too\n npm_config_cache_dir: pnpmConfigCacheDir,\n npm_config_store_dir: pnpmConfigStoreDir,\n // pnpm stops reading npm_config_* env vars since v11\n pnpm_config_cache_dir: pnpmConfigCacheDir,\n pnpm_config_store_dir: pnpmConfigStoreDir,\n };\n\n const { nodeMaxMemory } = getToolSettingsOptions(config.toolSettings);\n if (nodeMaxMemory) {\n extraEnv.NODE_OPTIONS = getNodeOptions(nodeMaxMemory);\n }\n\n const execOptions: ExecOptions = {\n cwdFile: lockFileName,\n extraEnv,\n docker: {},\n toolConstraints: [\n await getNodeToolConstraint(config, upgrades, lockFileDir, lazyPgkJson),\n pnpmToolConstraint,\n ],\n };\n /* v8 ignore next 4 -- needs test */\n if (GlobalConfig.get('exposeAllEnv')) {\n extraEnv.NPM_AUTH = env.NPM_AUTH;\n extraEnv.NPM_EMAIL = env.NPM_EMAIL;\n }\n\n const pnpmWorkspaceFilePath = getSiblingFileName(\n lockFileName,\n 'pnpm-workspace.yaml',\n );\n\n let args = '--lockfile-only';\n\n // If it's not a workspaces project/monorepo, but single project with unrelated other npm project in source tree (for example, a git submodule),\n // `--recursive` will install un-wanted project.\n // we should avoid this.\n if (await localPathExists(pnpmWorkspaceFilePath)) {\n const pnpmWorkspace = parseSingleYaml<PnpmWorkspaceFile>(\n (await readLocalFile(pnpmWorkspaceFilePath, 'utf8'))!,\n );\n if (pnpmWorkspace?.packages?.length) {\n logger.debug(\n `Found pnpm workspace with ${pnpmWorkspace.packages.length} package definitions`,\n );\n // we are in a monorepo, 'pnpm update' needs the '--recursive' flag contrary to 'pnpm install'\n args += ' --recursive';\n }\n }\n if (!GlobalConfig.get('allowScripts')) {\n // If the admin disallows scripts, then neither scripts nor the pnpmfile should be run\n args += ' --ignore-scripts';\n args += ' --ignore-pnpmfile';\n } else if (config.ignoreScripts) {\n // If the admin allows scripts then always allow the pnpmfile\n args += ' --ignore-scripts';\n }\n\n logger.trace({ args }, 'pnpm command options');\n\n const lockUpdates = upgrades.filter((upgrade) => upgrade.isLockfileUpdate);\n\n if (lockUpdates.length !== upgrades.length) {\n // This command updates the lock file based on package.json\n commands.push(`pnpm install ${args}`);\n }\n\n // rangeStrategy = update-lockfile\n if (lockUpdates.length) {\n logger.debug('Performing lockfileUpdate (pnpm)');\n commands.push(\n `pnpm update --no-save ${lockUpdates\n // TODO: types (#22198)\n .map((update) => `${update.packageName!}@${update.newVersion!}`)\n .filter(uniqueStrings)\n .map(quote)\n .join(' ')} ${args}`,\n );\n }\n\n // postUpdateOptions\n if (config.postUpdateOptions?.includes('pnpmDedupe')) {\n commands.push(`pnpm dedupe ${args}`);\n }\n\n if (upgrades.find((upgrade) => upgrade.isLockFileMaintenance)) {\n logger.debug(\n `Removing ${lockFileName} first due to lock file maintenance upgrade`,\n );\n try {\n await deleteLocalFile(lockFileName);\n } catch (err) /* v8 ignore next -- TODO: add test #40625 */ {\n logger.debug(\n { err, lockFileName },\n 'Error removing `pnpm-lock.yaml` for lock file maintenance',\n );\n }\n }\n\n await exec(commands, execOptions);\n lockFile = await readLocalFile(lockFileName, 'utf8');\n } catch (err) {\n // v8 ignore if -- TODO: add test #40625\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug(\n {\n commands,\n err,\n stdout: err.stdout,\n stderr: err.stderr,\n type: 'pnpm',\n },\n 'lock file error',\n );\n return { error: true, stderr: err.stderr, stdout: err.stdout };\n }\n return { lockFile };\n}\n\nexport async function getConstraintFromLockFile(\n lockFileName: string,\n): Promise<string | null> {\n let constraint: string | null = null;\n try {\n const lockfileContent = await readLocalFile(lockFileName, 'utf8');\n if (!lockfileContent) {\n logger.trace(`Empty pnpm lock file: ${lockFileName}`);\n return null;\n }\n // TODO: use schema (#9610)\n const pnpmLock = parseSingleYaml<PnpmLockFile>(lockfileContent);\n if (\n !isNumber(pnpmLock?.lockfileVersion) &&\n !isNumericString(pnpmLock?.lockfileVersion)\n ) {\n logger.trace(`Invalid pnpm lockfile version: ${lockFileName}`);\n return null;\n }\n // find matching lockfileVersion and use its constraints\n // if no match found use lockfileVersion 5\n // lockfileVersion 5 is the minimum version required to generate the pnpm-lock.yaml file\n const { lowerConstraint, upperConstraint } = lockToPnpmVersionMapping.find(\n (m) => m.lockfileVersion === pnpmLock.lockfileVersion,\n ) ?? {\n lockfileVersion: 5.0,\n lowerConstraint: '>=3',\n upperConstraint: '<3.5.0',\n };\n constraint = lowerConstraint;\n if (upperConstraint) {\n constraint += ` ${upperConstraint}`;\n }\n } catch (err) {\n logger.warn({ err }, 'Error getting pnpm constraints from lock file');\n }\n return constraint;\n}\n\n/**\n * pnpm lockfiles have corresponding version numbers called \"lockfileVersion\"\n * each lockfileVersion can only be generated by a certain pnpm version range\n * eg. lockfileVersion: 5.4 can only be generated by pnpm version >=7 && <8\n * official list can be found here : https://github.com/pnpm/spec/tree/master/lockfile\n * we use the mapping present below to find the compatible pnpm version range for a given lockfileVersion\n *\n * the various terms used in the mapping are explained below:\n * lowerConstraint : lowest pnpm version that can generate the lockfileVersion\n * upperConstraint : highest pnpm version that can generate the lockfileVersion\n * lowerBound : highest pnpm version that is less than the lowerConstraint\n * upperBound : lowest pnpm version that is greater than the upperConstraint\n *\n * To handle future lockfileVersions, we need to:\n * 1. add a upperBound and upperConstraint to the current latest lockfileVersion\n * 2. add an object for the new lockfileVersion with lowerBound and lowerConstraint\n *\n * lockfileVersion from v6 on are strings\n */\nconst lockToPnpmVersionMapping: LockToPnpmVersionMapping[] = [\n { lockfileVersion: '9.0', lowerConstraint: '>=9' },\n {\n lockfileVersion: '6.0',\n lowerConstraint: '>=7.24.2',\n upperConstraint: '<9',\n },\n {\n lockfileVersion: 5.4,\n lowerConstraint: '>=7',\n upperConstraint: '<8',\n },\n {\n lockfileVersion: 5.3,\n lowerConstraint: '>=6',\n upperConstraint: '<7',\n },\n {\n lockfileVersion: 5.2,\n lowerConstraint: '>=5.10.0',\n upperConstraint: '<6',\n },\n {\n lockfileVersion: 5.1,\n lowerConstraint: '>=3.5.0',\n upperConstraint: '<5.9.3',\n },\n];\n\ninterface LockToPnpmVersionMapping {\n lockfileVersion: string | number;\n lowerConstraint: string;\n upperConstraint?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;AAgCA,SAAS,8BAA8B,UAAoC;CACzE,KAAK,MAAM,WAAW,UACpB,IAAI,QAAQ,YAAY,UAAU,QAAQ,YACxC,OAAO,QAAQ;CAGnB,OAAO;AACT;AAEA,eAAsB,iBACpB,aACA,KACA,QACA,WAAsB,CAAC,GACU;CACjC,MAAM,eAAe,MAAM,KAAK,aAAa,gBAAgB;CAC7D,OAAO,M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EACT;EAIA,MAAM,EAAE,iBAAiB,oBAAoB,yBAAyB,MACnE,MAAM,EAAE,oBAAoB,SAAS,eACxC,KAAK;GACH,iBAAiB;GACjB,iBAAiB;GACjB,iBAAiB;EACnB;EACA,aAAa;EACb,IAAI,iBACF,cAAc,IAAI;CAEtB,SAAS,KAAK;EACZ,OAAO,KAAK,EAAE,IAAI,GAAG,+CAA+C;CACtE;CACA,OAAO;AACT;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,2BAAuD;CAC3D;EAAE,iBAAiB;EAAO,iBAAiB;CAAM;CACjD;EACE,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;CACnB;CACA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;CACnB;CACA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;CACnB;CACA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;CACnB;CACA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;CACnB;AACF"}
|
|
1
|
+
{"version":3,"file":"pnpm.js","names":[],"sources":["../../../../../lib/modules/manager/npm/post-update/pnpm.ts"],"sourcesContent":["import { isNumber, isNumericString } from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport upath from 'upath';\nimport { GlobalConfig } from '../../../../config/global.ts';\nimport { TEMPORARY_ERROR } from '../../../../constants/error-messages.ts';\nimport { logger } from '../../../../logger/index.ts';\nimport { exec, getToolSettingsOptions } from '../../../../util/exec/index.ts';\nimport type {\n ExecOptions,\n ExtraEnv,\n ToolConstraint,\n} from '../../../../util/exec/types.ts';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getSiblingFileName,\n localPathExists,\n readLocalFile,\n} from '../../../../util/fs/index.ts';\nimport { uniqueStrings } from '../../../../util/string.ts';\nimport { parseSingleYaml } from '../../../../util/yaml.ts';\nimport type { PostUpdateConfig, Upgrade } from '../../types.ts';\nimport { PNPM_CACHE_DIR, PNPM_STORE_DIR } from '../constants.ts';\nimport type { PnpmWorkspaceFile } from '../extract/types.ts';\nimport { getNodeToolConstraint } from './node-version.ts';\nimport type { GenerateLockFileResult, PnpmLockFile } from './types.ts';\nimport {\n getNodeOptions,\n getPackageManagerVersion,\n lazyLoadPackageJson,\n} from './utils.ts';\n\nfunction getPnpmConstraintFromUpgrades(upgrades: Upgrade[]): string | null {\n for (const upgrade of upgrades) {\n if (upgrade.depName === 'pnpm' && upgrade.newVersion) {\n return upgrade.newVersion;\n }\n }\n return null;\n}\n\nexport async function generateLockFile(\n lockFileDir: string,\n env: NodeJS.ProcessEnv,\n config: PostUpdateConfig,\n upgrades: Upgrade[] = [],\n): Promise<GenerateLockFileResult> {\n const lockFileName = upath.join(lockFileDir, 'pnpm-lock.yaml');\n logger.debug(`Spawning pnpm install to create ${lockFileName}`);\n let lockFile: string | null = null;\n const commands: string[] = [];\n try {\n const lazyPgkJson = lazyLoadPackageJson(lockFileDir);\n const pnpmToolConstraint: ToolConstraint = {\n toolName: 'pnpm',\n constraint:\n getPnpmConstraintFromUpgrades(upgrades) ?? // if pnpm is being upgraded, it comes first\n config.constraints?.pnpm ?? // from user config or extraction\n getPackageManagerVersion('pnpm', await lazyPgkJson.getValue()) ?? // look in package.json > packageManager or engines\n (await getConstraintFromLockFile(lockFileName)), // use lockfileVersion to find pnpm version range\n };\n\n const pnpmConfigCacheDir = await ensureCacheDir(PNPM_CACHE_DIR);\n const pnpmConfigStoreDir = await ensureCacheDir(PNPM_STORE_DIR);\n const extraEnv: ExtraEnv = {\n // those arwe no longer working and it's unclear if they ever worked\n NPM_CONFIG_CACHE: env.NPM_CONFIG_CACHE,\n npm_config_store: env.npm_config_store,\n // these are used by pnpm v5 to v10. Maybe earlier versions too\n npm_config_cache_dir: pnpmConfigCacheDir,\n npm_config_store_dir: pnpmConfigStoreDir,\n // pnpm stops reading npm_config_* env vars since v11\n pnpm_config_cache_dir: pnpmConfigCacheDir,\n pnpm_config_store_dir: pnpmConfigStoreDir,\n };\n\n const { nodeMaxMemory } = getToolSettingsOptions(config.toolSettings);\n if (nodeMaxMemory) {\n extraEnv.NODE_OPTIONS = getNodeOptions(nodeMaxMemory);\n }\n\n const execOptions: ExecOptions = {\n cwdFile: lockFileName,\n extraEnv,\n docker: {},\n toolConstraints: [\n await getNodeToolConstraint(config, upgrades, lockFileDir, lazyPgkJson),\n pnpmToolConstraint,\n ],\n };\n /* v8 ignore next 4 -- needs test */\n if (GlobalConfig.get('exposeAllEnv')) {\n extraEnv.NPM_AUTH = env.NPM_AUTH;\n extraEnv.NPM_EMAIL = env.NPM_EMAIL;\n }\n\n const pnpmWorkspaceFilePath = getSiblingFileName(\n lockFileName,\n 'pnpm-workspace.yaml',\n );\n\n let args = '--lockfile-only';\n\n // If it's not a workspaces project/monorepo, but single project with unrelated other npm project in source tree (for example, a git submodule),\n // `--recursive` will install un-wanted project.\n // we should avoid this.\n if (await localPathExists(pnpmWorkspaceFilePath)) {\n const pnpmWorkspace = parseSingleYaml<PnpmWorkspaceFile>(\n (await readLocalFile(pnpmWorkspaceFilePath, 'utf8'))!,\n );\n if (pnpmWorkspace?.packages?.length) {\n logger.debug(\n `Found pnpm workspace with ${pnpmWorkspace.packages.length} package definitions`,\n );\n // we are in a monorepo, 'pnpm update' needs the '--recursive' flag contrary to 'pnpm install'\n args += ' --recursive';\n }\n }\n if (!GlobalConfig.get('allowScripts')) {\n // If the admin disallows scripts, then neither scripts nor the pnpmfile should be run\n args += ' --ignore-scripts';\n args += ' --ignore-pnpmfile';\n } else if (config.ignoreScripts) {\n // If the admin allows scripts then always allow the pnpmfile\n args += ' --ignore-scripts';\n }\n\n logger.trace({ args }, 'pnpm command options');\n\n const lockUpdates = upgrades.filter((upgrade) => upgrade.isLockfileUpdate);\n\n if (lockUpdates.length !== upgrades.length) {\n // This command updates the lock file based on package.json\n commands.push(`pnpm install ${args}`);\n }\n\n // rangeStrategy = update-lockfile\n if (lockUpdates.length) {\n logger.debug('Performing lockfileUpdate (pnpm)');\n commands.push(\n `pnpm update --no-save ${lockUpdates\n // TODO: types (#22198)\n .map((update) => `${update.packageName!}@${update.newVersion!}`)\n .filter(uniqueStrings)\n .map(quote)\n .join(' ')} ${args}`,\n );\n }\n\n // postUpdateOptions\n if (config.postUpdateOptions?.includes('pnpmDedupe')) {\n commands.push(`pnpm dedupe ${args.replace(' --recursive', '')}`);\n }\n\n if (upgrades.find((upgrade) => upgrade.isLockFileMaintenance)) {\n logger.debug(\n `Removing ${lockFileName} first due to lock file maintenance upgrade`,\n );\n try {\n await deleteLocalFile(lockFileName);\n } catch (err) /* v8 ignore next -- TODO: add test #40625 */ {\n logger.debug(\n { err, lockFileName },\n 'Error removing `pnpm-lock.yaml` for lock file maintenance',\n );\n }\n }\n\n await exec(commands, execOptions);\n lockFile = await readLocalFile(lockFileName, 'utf8');\n } catch (err) {\n // v8 ignore if -- TODO: add test #40625\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug(\n {\n commands,\n err,\n stdout: err.stdout,\n stderr: err.stderr,\n type: 'pnpm',\n },\n 'lock file error',\n );\n return { error: true, stderr: err.stderr, stdout: err.stdout };\n }\n return { lockFile };\n}\n\nexport async function getConstraintFromLockFile(\n lockFileName: string,\n): Promise<string | null> {\n let constraint: string | null = null;\n try {\n const lockfileContent = await readLocalFile(lockFileName, 'utf8');\n if (!lockfileContent) {\n logger.trace(`Empty pnpm lock file: ${lockFileName}`);\n return null;\n }\n // TODO: use schema (#9610)\n const pnpmLock = parseSingleYaml<PnpmLockFile>(lockfileContent);\n if (\n !isNumber(pnpmLock?.lockfileVersion) &&\n !isNumericString(pnpmLock?.lockfileVersion)\n ) {\n logger.trace(`Invalid pnpm lockfile version: ${lockFileName}`);\n return null;\n }\n // find matching lockfileVersion and use its constraints\n // if no match found use lockfileVersion 5\n // lockfileVersion 5 is the minimum version required to generate the pnpm-lock.yaml file\n const { lowerConstraint, upperConstraint } = lockToPnpmVersionMapping.find(\n (m) => m.lockfileVersion === pnpmLock.lockfileVersion,\n ) ?? {\n lockfileVersion: 5.0,\n lowerConstraint: '>=3',\n upperConstraint: '<3.5.0',\n };\n constraint = lowerConstraint;\n if (upperConstraint) {\n constraint += ` ${upperConstraint}`;\n }\n } catch (err) {\n logger.warn({ err }, 'Error getting pnpm constraints from lock file');\n }\n return constraint;\n}\n\n/**\n * pnpm lockfiles have corresponding version numbers called \"lockfileVersion\"\n * each lockfileVersion can only be generated by a certain pnpm version range\n * eg. lockfileVersion: 5.4 can only be generated by pnpm version >=7 && <8\n * official list can be found here : https://github.com/pnpm/spec/tree/master/lockfile\n * we use the mapping present below to find the compatible pnpm version range for a given lockfileVersion\n *\n * the various terms used in the mapping are explained below:\n * lowerConstraint : lowest pnpm version that can generate the lockfileVersion\n * upperConstraint : highest pnpm version that can generate the lockfileVersion\n * lowerBound : highest pnpm version that is less than the lowerConstraint\n * upperBound : lowest pnpm version that is greater than the upperConstraint\n *\n * To handle future lockfileVersions, we need to:\n * 1. add a upperBound and upperConstraint to the current latest lockfileVersion\n * 2. add an object for the new lockfileVersion with lowerBound and lowerConstraint\n *\n * lockfileVersion from v6 on are strings\n */\nconst lockToPnpmVersionMapping: LockToPnpmVersionMapping[] = [\n { lockfileVersion: '9.0', lowerConstraint: '>=9' },\n {\n lockfileVersion: '6.0',\n lowerConstraint: '>=7.24.2',\n upperConstraint: '<9',\n },\n {\n lockfileVersion: 5.4,\n lowerConstraint: '>=7',\n upperConstraint: '<8',\n },\n {\n lockfileVersion: 5.3,\n lowerConstraint: '>=6',\n upperConstraint: '<7',\n },\n {\n lockfileVersion: 5.2,\n lowerConstraint: '>=5.10.0',\n upperConstraint: '<6',\n },\n {\n lockfileVersion: 5.1,\n lowerConstraint: '>=3.5.0',\n upperConstraint: '<5.9.3',\n },\n];\n\ninterface LockToPnpmVersionMapping {\n lockfileVersion: string | number;\n lowerConstraint: string;\n upperConstraint?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;AAgCA,SAAS,8BAA8B,UAAoC;CACzE,KAAK,MAAM,WAAW,UACpB,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BAAiB;GACpB,OAAO,MAAM,yBAAyB,cAAc;GACpD,OAAO;EACT;EAEA,MAAM,WAAW,gBAA8B,eAAe;EAC9D,IACE,CAAC,SAAS,UAAU,eAAe,KACnC,CAAC,gBAAgB,UAAU,eAAe,GAC1C;GACA,OAAO,MAAM,kCAAkC,cAAc;GAC7D,OAAO;EACT;EAIA,MAAM,EAAE,iBAAiB,oBAAoB,yBAAyB,MACnE,MAAM,EAAE,oBAAoB,SAAS,eACxC,KAAK;GACH,iBAAiB;GACjB,iBAAiB;GACjB,iBAAiB;EACnB;EACA,aAAa;EACb,IAAI,iBACF,cAAc,IAAI;CAEtB,SAAS,KAAK;EACZ,OAAO,KAAK,EAAE,IAAI,GAAG,+CAA+C;CACtE;CACA,OAAO;AACT;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,2BAAuD;CAC3D;EAAE,iBAAiB;EAAO,iBAAiB;CAAM;CACjD;EACE,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;CACnB;CACA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;CACnB;CACA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;CACnB;CACA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;CACnB;CACA;EACE,iBAAiB;EACjB,iBAAiB;EACjB,iBAAiB;CACnB;AACF"}
|
|
@@ -1,85 +1,88 @@
|
|
|
1
1
|
import { logger } from "../../../../logger/index.js";
|
|
2
2
|
import { coerceArray, deduplicateArray, isNotNullOrUndefined } from "../../../../util/array.js";
|
|
3
|
-
import {
|
|
3
|
+
import { hashStream } from "../../../../util/hash.js";
|
|
4
|
+
import { createCacheWriteStream, ensureCacheDir, pipeline, rmCache } from "../../../../util/fs/index.js";
|
|
4
5
|
import { withCache } from "../../../../util/cache/package/with-cache.js";
|
|
5
6
|
import { Http } from "../../../../util/http/index.js";
|
|
6
7
|
import { map } from "../../../../util/promises.js";
|
|
7
8
|
import { TerraformProviderDatasource } from "../../../datasource/terraform-provider/index.js";
|
|
8
9
|
import crypto from "node:crypto";
|
|
10
|
+
import { Transform } from "node:stream";
|
|
9
11
|
import upath from "upath";
|
|
10
|
-
import
|
|
12
|
+
import { crc32 } from "node:zlib";
|
|
13
|
+
import { once } from "node:events";
|
|
14
|
+
import { openPromise, validateFileName } from "yauzl";
|
|
11
15
|
//#region lib/modules/manager/terraform/lockfile/hash.ts
|
|
16
|
+
var Crc32Stream = class extends Transform {
|
|
17
|
+
checksum = 0;
|
|
18
|
+
_transform(chunk, _encoding, callback) {
|
|
19
|
+
this.checksum = crc32(chunk, this.checksum);
|
|
20
|
+
callback(null, chunk);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
12
23
|
var TerraformProviderHash = class TerraformProviderHash {
|
|
13
24
|
static http = new Http(TerraformProviderDatasource.id);
|
|
14
25
|
static terraformDatasource = new TerraformProviderDatasource();
|
|
15
26
|
static hashCacheTTL = 10080;
|
|
16
|
-
static async hashElementList(basePath, fileSystemEntries) {
|
|
17
|
-
const rootHash = crypto.createHash("sha256");
|
|
18
|
-
for (const entryPath of fileSystemEntries) {
|
|
19
|
-
const absolutePath = upath.resolve(basePath, entryPath);
|
|
20
|
-
if (!await cachePathIsFile(absolutePath)) continue;
|
|
21
|
-
const hash = crypto.createHash("sha256");
|
|
22
|
-
const fileBuffer = await readCacheFile(absolutePath);
|
|
23
|
-
hash.update(fileBuffer);
|
|
24
|
-
const line = `${hash.digest("hex")} ${upath.normalize(entryPath)}\n`;
|
|
25
|
-
rootHash.update(line);
|
|
26
|
-
}
|
|
27
|
-
return rootHash.digest("base64");
|
|
28
|
-
}
|
|
29
27
|
/**
|
|
30
|
-
*
|
|
31
|
-
* The package provides two function HashDir and HashZip where the first is for hashing the contents of a directory
|
|
32
|
-
* and the second for doing the same but implicitly extracting the contents first.
|
|
33
|
-
*
|
|
34
|
-
* The problem starts with that there is a bug which leads to the fact that HashDir and HashZip do not return the same
|
|
35
|
-
* hash if there are folders inside the content which should be hashed.
|
|
36
|
-
*
|
|
37
|
-
* In a folder structure such as
|
|
38
|
-
* .
|
|
39
|
-
* ├── Readme.md
|
|
40
|
-
* └── readme-assets/
|
|
41
|
-
* └── image.jpg
|
|
42
|
-
*
|
|
43
|
-
* HashDir will create a list of following entries which in turn will hash again
|
|
44
|
-
* aaaaaaaaaaa Readme.md\n
|
|
45
|
-
* ccccccccccc readme-assets/image.jpg\n
|
|
28
|
+
* Computes the `h1:` checksum used in Terraform dependency lock files.
|
|
46
29
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* ccccccccccc readme-assets/image.jpg\n
|
|
30
|
+
* Terraform verifies extracted providers with Go's `HashDir`, which ignores
|
|
31
|
+
* ZIP directory entries. Ignore them here so the archive produces the same
|
|
32
|
+
* checksum as the extracted provider.
|
|
51
33
|
*
|
|
52
|
-
*
|
|
53
|
-
* The issue is tracked here: https://github.com/golang/go/issues/53448
|
|
54
|
-
*
|
|
55
|
-
* This implementation follows the intended implementation and filters out folder entries.
|
|
56
|
-
* Terraform seems NOT to use HashZip for provider validation, but rather extracts it and then do the hash calculation
|
|
57
|
-
* even as both are set up in their code base.
|
|
58
|
-
* https://github.com/hashicorp/terraform/blob/3fdfbd69448b14a4982b3c62a5d36835956fcbaa/internal/getproviders/hash.go#L283-L305
|
|
59
|
-
*
|
|
60
|
-
* @param zipFilePath path to the zip file
|
|
61
|
-
* @param extractPath path to where to temporarily extract the data
|
|
34
|
+
* See https://github.com/golang/go/issues/53448.
|
|
62
35
|
*/
|
|
63
|
-
static async hashOfZipContent(zipFilePath
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
36
|
+
static async hashOfZipContent(zipFilePath) {
|
|
37
|
+
const zipFile = await openPromise(zipFilePath, {
|
|
38
|
+
autoClose: false,
|
|
39
|
+
decodeStrings: false
|
|
40
|
+
});
|
|
41
|
+
const entryHashes = [];
|
|
42
|
+
const entryPaths = /* @__PURE__ */ new Set();
|
|
43
|
+
try {
|
|
44
|
+
for await (const entry of zipFile.eachEntry()) {
|
|
45
|
+
const fileName = entry.fileNameRaw.toString("latin1").replaceAll("\\", "/");
|
|
46
|
+
if (fileName.endsWith("/")) continue;
|
|
47
|
+
if (fileName.includes("\n")) throw new Error("ZIP entry name contains a newline");
|
|
48
|
+
const fileNameError = validateFileName(fileName);
|
|
49
|
+
if (fileNameError) throw new Error(fileNameError);
|
|
50
|
+
const normalizedPath = upath.normalize(fileName);
|
|
51
|
+
if (entryPaths.has(normalizedPath)) throw new Error(`Duplicate ZIP entry path: ${normalizedPath}`);
|
|
52
|
+
entryPaths.add(normalizedPath);
|
|
53
|
+
const path = Buffer.from(normalizedPath, "latin1");
|
|
54
|
+
const entryStream = await zipFile.openReadStreamPromise(entry);
|
|
55
|
+
const crc32Stream = new Crc32Stream();
|
|
56
|
+
const hash = await hashStream(entryStream.compose(crc32Stream), "sha256");
|
|
57
|
+
if (crc32Stream.checksum !== entry.crc32) throw new Error(`CRC-32 mismatch for ZIP entry ${entry.fileNameRaw.toString("utf8")}`);
|
|
58
|
+
entryHashes.push({
|
|
59
|
+
path,
|
|
60
|
+
hash
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
} finally {
|
|
64
|
+
const closePromise = once(zipFile, "close");
|
|
65
|
+
zipFile.close();
|
|
66
|
+
await closePromise;
|
|
67
|
+
}
|
|
68
|
+
entryHashes.sort((left, right) => Buffer.compare(left.path, right.path));
|
|
69
|
+
const rootHash = crypto.createHash("sha256");
|
|
70
|
+
for (const entry of entryHashes) {
|
|
71
|
+
rootHash.update(`${entry.hash} `);
|
|
72
|
+
rootHash.update(entry.path);
|
|
73
|
+
rootHash.update("\n");
|
|
74
|
+
}
|
|
75
|
+
return rootHash.digest("base64");
|
|
72
76
|
}
|
|
73
77
|
static async _calculateSingleHash(build, cacheDir) {
|
|
74
|
-
const downloadFileName = upath.join(cacheDir,
|
|
75
|
-
const extractPath = upath.join(cacheDir, "extract", build.filename);
|
|
78
|
+
const downloadFileName = upath.join(cacheDir, crypto.randomUUID());
|
|
76
79
|
logger.trace(`Downloading archive and generating hash for ${build.name}-${build.version}...`);
|
|
77
80
|
const startTime = Date.now();
|
|
78
81
|
const readStream = TerraformProviderHash.http.stream(build.url);
|
|
79
82
|
const writeStream = createCacheWriteStream(downloadFileName);
|
|
80
83
|
try {
|
|
81
84
|
await pipeline(readStream, writeStream);
|
|
82
|
-
const hash = await this.hashOfZipContent(downloadFileName
|
|
85
|
+
const hash = await this.hashOfZipContent(downloadFileName);
|
|
83
86
|
logger.debug(`Hash generation for ${build.url} took ${Date.now() - startTime}ms for ${build.name}-${build.version}`);
|
|
84
87
|
return hash;
|
|
85
88
|
} finally {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.js","names":["fs.cachePathIsFile","fs.readCacheFile","fs.rmCache","fs.listCacheDir","fs.createCacheWriteStream","fs.pipeline","p.map"],"sources":["../../../../../lib/modules/manager/terraform/lockfile/hash.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport AdmZip from 'adm-zip';\nimport upath from 'upath';\nimport { logger } from '../../../../logger/index.ts';\nimport {\n coerceArray,\n deduplicateArray,\n isNotNullOrUndefined,\n} from '../../../../util/array.ts';\nimport { withCache } from '../../../../util/cache/package/with-cache.ts';\nimport * as fs from '../../../../util/fs/index.ts';\nimport { ensureCacheDir } from '../../../../util/fs/index.ts';\nimport { Http } from '../../../../util/http/index.ts';\nimport * as p from '../../../../util/promises.ts';\nimport { TerraformProviderDatasource } from '../../../datasource/terraform-provider/index.ts';\nimport type { TerraformBuild } from '../../../datasource/terraform-provider/schema.ts';\n\nexport class TerraformProviderHash {\n static http = new Http(TerraformProviderDatasource.id);\n\n static terraformDatasource = new TerraformProviderDatasource();\n\n static hashCacheTTL = 10080; // in minutes == 1 week\n\n private static async hashElementList(\n basePath: string,\n fileSystemEntries: string[],\n ): Promise<string> {\n const rootHash = crypto.createHash('sha256');\n\n for (const entryPath of fileSystemEntries) {\n const absolutePath = upath.resolve(basePath, entryPath);\n if (!(await fs.cachePathIsFile(absolutePath))) {\n continue;\n }\n\n // build for every file a line looking like \"aaaaaaaaaaaaaaa file.txt\\n\"\n\n // get hash of specific file\n const hash = crypto.createHash('sha256');\n const fileBuffer = await fs.readCacheFile(absolutePath);\n hash.update(fileBuffer);\n\n const line = `${hash.digest('hex')} ${upath.normalize(entryPath)}\\n`;\n rootHash.update(line);\n }\n\n return rootHash.digest('base64');\n }\n\n /**\n * This is a reimplementation of the Go H1 hash algorithm found at https://github.com/golang/mod/blob/master/sumdb/dirhash/hash.go\n * The package provides two function HashDir and HashZip where the first is for hashing the contents of a directory\n * and the second for doing the same but implicitly extracting the contents first.\n *\n * The problem starts with that there is a bug which leads to the fact that HashDir and HashZip do not return the same\n * hash if there are folders inside the content which should be hashed.\n *\n * In a folder structure such as\n * .\n * ├── Readme.md\n * └── readme-assets/\n * └── image.jpg\n *\n * HashDir will create a list of following entries which in turn will hash again\n * aaaaaaaaaaa Readme.md\\n\n * ccccccccccc readme-assets/image.jpg\\n\n *\n * HashZip in contrast will not filter out the directory itself but rather includes it in the hash list\n * aaaaaaaaaaa Readme.md\\n\n * bbbbbbbbbbb readme-assets/\\n\n * ccccccccccc readme-assets/image.jpg\\n\n *\n * As the resulting string is used to generate the final hash it will differ based on which function has been used.\n * The issue is tracked here: https://github.com/golang/go/issues/53448\n *\n * This implementation follows the intended implementation and filters out folder entries.\n * Terraform seems NOT to use HashZip for provider validation, but rather extracts it and then do the hash calculation\n * even as both are set up in their code base.\n * https://github.com/hashicorp/terraform/blob/3fdfbd69448b14a4982b3c62a5d36835956fcbaa/internal/getproviders/hash.go#L283-L305\n *\n * @param zipFilePath path to the zip file\n * @param extractPath path to where to temporarily extract the data\n */\n static async hashOfZipContent(\n zipFilePath: string,\n extractPath: string,\n ): Promise<string> {\n const zip = new AdmZip(zipFilePath);\n zip.extractAllTo(extractPath);\n const hash = await this.hashOfDir(extractPath);\n // delete extracted files\n await fs.rmCache(extractPath);\n\n return hash;\n }\n\n static async hashOfDir(dirPath: string): Promise<string> {\n const elements = await fs.listCacheDir(dirPath, { recursive: true });\n\n const sortedFileSystemObjects = elements.sort();\n return await TerraformProviderHash.hashElementList(\n dirPath,\n sortedFileSystemObjects,\n );\n }\n\n private static async _calculateSingleHash(\n build: TerraformBuild,\n cacheDir: string,\n ): Promise<string> {\n const downloadFileName = upath.join(cacheDir, build.filename);\n const extractPath = upath.join(cacheDir, 'extract', build.filename);\n logger.trace(\n `Downloading archive and generating hash for ${build.name}-${build.version}...`,\n );\n const startTime = Date.now();\n const readStream = TerraformProviderHash.http.stream(build.url);\n const writeStream = fs.createCacheWriteStream(downloadFileName);\n\n try {\n await fs.pipeline(readStream, writeStream);\n\n const hash = await this.hashOfZipContent(downloadFileName, extractPath);\n logger.debug(\n `Hash generation for ${build.url} took ${Date.now() - startTime}ms for ${build.name}-${build.version}`,\n );\n return hash;\n } finally {\n // delete zip file\n await fs.rmCache(downloadFileName);\n }\n }\n\n static calculateSingleHash(\n build: TerraformBuild,\n cacheDir: string,\n ): Promise<string> {\n return withCache(\n {\n namespace: `terraform-provider-hash`,\n key: `calculateSingleHash:${build.url}`,\n ttlMinutes: TerraformProviderHash.hashCacheTTL,\n },\n () => TerraformProviderHash._calculateSingleHash(build, cacheDir),\n );\n }\n\n static async calculateHashScheme1Hashes(\n builds: TerraformBuild[],\n ): Promise<string[]> {\n logger.debug(`Calculating hashes for ${builds.length} builds`);\n const cacheDir = await ensureCacheDir('terraform');\n\n // for each build download ZIP, extract content and generate hash for all containing files\n return p.map(builds, (build) => this.calculateSingleHash(build, cacheDir), {\n concurrency: 4,\n });\n }\n\n static async createHashes(\n registryURL: string,\n repository: string,\n version: string,\n ): Promise<string[] | null> {\n logger.debug(\n `Creating hashes for ${repository}@${version} (${registryURL})`,\n );\n const builds = await TerraformProviderHash.terraformDatasource.getBuilds(\n registryURL,\n repository,\n version,\n );\n if (!builds) {\n return null;\n }\n\n // check if the publisher uses one shasum file for all builds or separate ones\n // we deduplicate to reduce the number of API calls\n const shaUrls = deduplicateArray(\n builds.map((build) => build.shasums_url).filter(isNotNullOrUndefined),\n );\n\n logger.debug(\n `Getting zip hashes for ${shaUrls.length} shasum URL(s) for ${repository}@${version}`,\n );\n\n const zhHashes: string[] = [];\n for (const shaUrl of shaUrls) {\n const hashes =\n await TerraformProviderHash.terraformDatasource.getZipHashes(shaUrl);\n\n zhHashes.push(...coerceArray(hashes));\n }\n\n logger.debug(\n `Got ${zhHashes.length} zip hashes for ${repository}@${version}`,\n );\n\n const h1Hashes =\n await TerraformProviderHash.calculateHashScheme1Hashes(builds);\n\n const hashes = [];\n hashes.push(...h1Hashes.map((hash) => `h1:${hash}`));\n hashes.push(...zhHashes.map((hash) => `zh:${hash}`));\n\n // hashes are a logical set which Terraform deduplicates and sorts\n return deduplicateArray(hashes).sort();\n }\n}\n"],"mappings":";;;;;;;;;;;AAiBA,IAAa,wBAAb,MAAa,sBAAsB;CACjC,OAAO,OAAO,IAAI,KAAK,4BAA4B,EAAE;CAErD,OAAO,sBAAsB,IAAI,4BAA4B;CAE7D,OAAO,eAAe;CAEtB,aAAqB,gBACnB,UACA,mBACiB;EACjB,MAAM,WAAW,OAAO,WAAW,QAAQ;EAE3C,KAAK,MAAM,aAAa,mBAAmB;GACzC,MAAM,eAAe,MAAM,QAAQ,UAAU,SAAS;GACtD,IAAI,CAAE,MAAMA,gBAAmB,YAAY,GACzC;GAMF,MAAM,OAAO,OAAO,WAAW,QAAQ;GACvC,MAAM,aAAa,MAAMC,cAAiB,YAAY;GACtD,KAAK,OAAO,UAAU;GAEtB,MAAM,OAAO,GAAG,KAAK,OAAO,KAAK,EAAE,IAAI,MAAM,UAAU,SAAS,EAAE;GAClE,SAAS,OAAO,IAAI;EACtB;EAEA,OAAO,SAAS,OAAO,QAAQ;CACjC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAo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AG,EACzE,aAAa,EACf,CAAC;CACH;CAEA,aAAa,aACX,aACA,YACA,SAC0B;EAC1B,OAAO,MACL,uBAAuB,WAAW,GAAG,QAAQ,IAAI,YAAY,EAC/D;EACA,MAAM,SAAS,MAAM,sBAAsB,oBAAoB,UAC7D,aACA,YACA,OACF;EACA,IAAI,CAAC,QACH,OAAO;EAKT,MAAM,UAAU,iBACd,OAAO,KAAK,UAAU,MAAM,WAAW,CAAC,CAAC,OAAO,oBAAoB,CACtE;EAEA,OAAO,MACL,0BAA0B,QAAQ,OAAO,qBAAqB,WAAW,GAAG,SAC9E;EAEA,MAAM,WAAqB,CAAC;EAC5B,KAAK,MAAM,UAAU,SAAS;GAC5B,MAAM,SACJ,MAAM,sBAAsB,oBAAoB,aAAa,MAAM;GAErE,SAAS,KAAK,GAAG,YAAY,MAAM,CAAC;EACtC;EAEA,OAAO,MACL,OAAO,SAAS,OAAO,kBAAkB,WAAW,GAAG,SACzD;EAEA,MAAM,WACJ,MAAM,sBAAsB,2BAA2B,MAAM;EAE/D,MAAM,SAAS,CAAC;EAChB,OAAO,KAAK,GAAG,SAAS,KAAK,SAAS,MAAM,MAAM,CAAC;EACnD,OAAO,KAAK,GAAG,SAAS,KAAK,SAAS,MAAM,MAAM,CAAC;EAGnD,OAAO,iBAAiB,MAAM,CAAC,CAAC,KAAK;CACvC;AACF"}
|
|
1
|
+
{"version":3,"file":"hash.js","names":["fs.createCacheWriteStream","fs.pipeline","fs.rmCache","fs.ensureCacheDir","p.map"],"sources":["../../../../../lib/modules/manager/terraform/lockfile/hash.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport { once } from 'node:events';\nimport { Transform, type TransformCallback } from 'node:stream';\nimport { crc32 } from 'node:zlib';\nimport upath from 'upath';\nimport { openPromise, validateFileName } from 'yauzl';\nimport { logger } from '../../../../logger/index.ts';\nimport {\n coerceArray,\n deduplicateArray,\n isNotNullOrUndefined,\n} from '../../../../util/array.ts';\nimport { withCache } from '../../../../util/cache/package/with-cache.ts';\nimport * as fs from '../../../../util/fs/index.ts';\nimport { hashStream } from '../../../../util/hash.ts';\nimport { Http } from '../../../../util/http/index.ts';\nimport * as p from '../../../../util/promises.ts';\nimport { TerraformProviderDatasource } from '../../../datasource/terraform-provider/index.ts';\nimport type { TerraformBuild } from '../../../datasource/terraform-provider/schema.ts';\n\nclass Crc32Stream extends Transform {\n checksum = 0;\n\n override _transform(\n chunk: Buffer,\n _encoding: BufferEncoding,\n callback: TransformCallback,\n ): void {\n this.checksum = crc32(chunk, this.checksum);\n callback(null, chunk);\n }\n}\n\nexport class TerraformProviderHash {\n static http = new Http(TerraformProviderDatasource.id);\n\n static terraformDatasource = new TerraformProviderDatasource();\n\n static hashCacheTTL = 10080; // in minutes == 1 week\n\n /**\n * Computes the `h1:` checksum used in Terraform dependency lock files.\n *\n * Terraform verifies extracted providers with Go's `HashDir`, which ignores\n * ZIP directory entries. Ignore them here so the archive produces the same\n * checksum as the extracted provider.\n *\n * See https://github.com/golang/go/issues/53448.\n */\n static async hashOfZipContent(zipFilePath: string): Promise<string> {\n const zipFile = await openPromise(zipFilePath, {\n autoClose: false,\n decodeStrings: false,\n });\n const entryHashes: { path: Buffer; hash: string }[] = [];\n const entryPaths = new Set<string>();\n\n try {\n for await (const entry of zipFile.eachEntry()) {\n // Go's ZIP reader preserves the central-directory name bytes instead of decoding CP437 or Unicode path fields.\n const fileName = entry.fileNameRaw\n .toString('latin1')\n .replaceAll('\\\\', '/');\n\n // Terraform verifies extracted packages with Go HashDir semantics, which omit directory records.\n if (fileName.endsWith('/')) {\n continue;\n }\n if (fileName.includes('\\n')) {\n throw new Error('ZIP entry name contains a newline');\n }\n const fileNameError = validateFileName(fileName);\n if (fileNameError) {\n throw new Error(fileNameError);\n }\n const normalizedPath = upath.normalize(fileName);\n if (entryPaths.has(normalizedPath)) {\n throw new Error(`Duplicate ZIP entry path: ${normalizedPath}`);\n }\n entryPaths.add(normalizedPath);\n const path = Buffer.from(normalizedPath, 'latin1');\n\n const entryStream = await zipFile.openReadStreamPromise(entry);\n const crc32Stream = new Crc32Stream();\n const hash = await hashStream(\n entryStream.compose(crc32Stream),\n 'sha256',\n );\n if (crc32Stream.checksum !== entry.crc32) {\n throw new Error(\n `CRC-32 mismatch for ZIP entry ${entry.fileNameRaw.toString('utf8')}`,\n );\n }\n entryHashes.push({ path, hash });\n }\n } finally {\n const closePromise = once(zipFile, 'close');\n zipFile.close();\n await closePromise;\n }\n\n entryHashes.sort((left, right) => Buffer.compare(left.path, right.path));\n\n const rootHash = crypto.createHash('sha256');\n for (const entry of entryHashes) {\n rootHash.update(`${entry.hash} `);\n rootHash.update(entry.path);\n rootHash.update('\\n');\n }\n\n return rootHash.digest('base64');\n }\n\n private static async _calculateSingleHash(\n build: TerraformBuild,\n cacheDir: string,\n ): Promise<string> {\n const downloadFileName = upath.join(cacheDir, crypto.randomUUID());\n logger.trace(\n `Downloading archive and generating hash for ${build.name}-${build.version}...`,\n );\n const startTime = Date.now();\n const readStream = TerraformProviderHash.http.stream(build.url);\n const writeStream = fs.createCacheWriteStream(downloadFileName);\n\n try {\n await fs.pipeline(readStream, writeStream);\n\n const hash = await this.hashOfZipContent(downloadFileName);\n logger.debug(\n `Hash generation for ${build.url} took ${Date.now() - startTime}ms for ${build.name}-${build.version}`,\n );\n return hash;\n } finally {\n await fs.rmCache(downloadFileName);\n }\n }\n\n static calculateSingleHash(\n build: TerraformBuild,\n cacheDir: string,\n ): Promise<string> {\n return withCache(\n {\n namespace: `terraform-provider-hash`,\n key: `calculateSingleHash:${build.url}`,\n ttlMinutes: TerraformProviderHash.hashCacheTTL,\n },\n () => TerraformProviderHash._calculateSingleHash(build, cacheDir),\n );\n }\n\n static async calculateHashScheme1Hashes(\n builds: TerraformBuild[],\n ): Promise<string[]> {\n logger.debug(`Calculating hashes for ${builds.length} builds`);\n const cacheDir = await fs.ensureCacheDir('terraform');\n\n return p.map(builds, (build) => this.calculateSingleHash(build, cacheDir), {\n concurrency: 4,\n });\n }\n\n static async createHashes(\n registryURL: string,\n repository: string,\n version: string,\n ): Promise<string[] | null> {\n logger.debug(\n `Creating hashes for ${repository}@${version} (${registryURL})`,\n );\n const builds = await TerraformProviderHash.terraformDatasource.getBuilds(\n registryURL,\n repository,\n version,\n );\n if (!builds) {\n return null;\n }\n\n // check if the publisher uses one shasum file for all builds or separate ones\n // we deduplicate to reduce the number of API calls\n const shaUrls = deduplicateArray(\n builds.map((build) => build.shasums_url).filter(isNotNullOrUndefined),\n );\n\n logger.debug(\n `Getting zip hashes for ${shaUrls.length} shasum URL(s) for ${repository}@${version}`,\n );\n\n const zhHashes: string[] = [];\n for (const shaUrl of shaUrls) {\n const hashes =\n await TerraformProviderHash.terraformDatasource.getZipHashes(shaUrl);\n\n zhHashes.push(...coerceArray(hashes));\n }\n\n logger.debug(\n `Got ${zhHashes.length} zip hashes for ${repository}@${version}`,\n );\n\n const h1Hashes =\n await TerraformProviderHash.calculateHashScheme1Hashes(builds);\n\n const hashes = [];\n hashes.push(...h1Hashes.map((hash) => `h1:${hash}`));\n hashes.push(...zhHashes.map((hash) => `zh:${hash}`));\n\n // hashes are a logical set which Terraform deduplicates and sorts\n return deduplicateArray(hashes).sort();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,IAAM,cAAN,cAA0B,UAAU;CAClC,WAAW;CAEX,WACE,OACA,WACA,UACM;EACN,KAAK,WAAW,MAAM,OAAO,KAAK,QAAQ;EAC1C,SAAS,MAAM,KAAK;CACtB;AACF;AAEA,IAAa,wBAAb,MAAa,sBAAsB;CACjC,OAAO,OAAO,IAAI,KAAK,4BAA4B,EAAE;CAErD,OAAO,sBAAsB,IAAI,4BAA4B;CAE7D,OAAO,eAAe;;;;;;;;;;CAWtB,aAAa,iBAAiB,aAAsC;EAClE,MAAM,UAAU,MAAM,YAAY,aAAa;GAC7C,WAAW;GACX,eAAe;EACjB,CAAC;EACD,MAAM,cAAgD,CAAC;EACvD,MAAM,6BAAa,IAAI,IAAY;EAEnC,IAAI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ErE,SAAS,KAAK,GAAG,YAAY,MAAM,CAAC;EACtC;EAEA,OAAO,MACL,OAAO,SAAS,OAAO,kBAAkB,WAAW,GAAG,SACzD;EAEA,MAAM,WACJ,MAAM,sBAAsB,2BAA2B,MAAM;EAE/D,MAAM,SAAS,CAAC;EAChB,OAAO,KAAK,GAAG,SAAS,KAAK,SAAS,MAAM,MAAM,CAAC;EACnD,OAAO,KAAK,GAAG,SAAS,KAAK,SAAS,MAAM,MAAM,CAAC;EAGnD,OAAO,iBAAiB,MAAM,CAAC,CAAC,KAAK;CACvC;AACF"}
|
|
@@ -3,6 +3,7 @@ import { find } from "../../../util/host-rules.js";
|
|
|
3
3
|
import { isProbablyJwt } from "../../../util/http/jwt.js";
|
|
4
4
|
import * as azure from "azure-devops-node-api";
|
|
5
5
|
import { getBasicHandler, getBearerHandler, getPersonalAccessTokenHandler } from "azure-devops-node-api";
|
|
6
|
+
import { DeploymentFlags } from "azure-devops-node-api/interfaces/common/VSSInterfaces.js";
|
|
6
7
|
//#region lib/modules/platform/azure/azure-got-wrapper.ts
|
|
7
8
|
const hostType = "azure";
|
|
8
9
|
let endpoint;
|
|
@@ -39,10 +40,26 @@ function policyApi() {
|
|
|
39
40
|
function workItemTrackingApi() {
|
|
40
41
|
return azureObj().getWorkItemTrackingApi();
|
|
41
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Whether the endpoint is Azure DevOps Services (cloud) rather than Azure
|
|
45
|
+
* DevOps Server (on-premises). Read from the location service's
|
|
46
|
+
* `_apis/connectionData`, which reports the deployment type authoritatively.
|
|
47
|
+
* Defaults to `false` (on-premises) when the type cannot be determined, so
|
|
48
|
+
* callers stay on the behaviour that both products support.
|
|
49
|
+
*/
|
|
50
|
+
async function isHosted() {
|
|
51
|
+
try {
|
|
52
|
+
const { deploymentType } = await azureObj().connect();
|
|
53
|
+
return deploymentType === DeploymentFlags.Hosted;
|
|
54
|
+
} catch (err) {
|
|
55
|
+
logger.debug({ err }, "Azure: could not determine deployment type, assuming on-premises");
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
42
59
|
function setEndpoint(e) {
|
|
43
60
|
endpoint = e;
|
|
44
61
|
}
|
|
45
62
|
//#endregion
|
|
46
|
-
export { azureObj, coreApi, gitApi, policyApi, setEndpoint, workItemTrackingApi };
|
|
63
|
+
export { azureObj, coreApi, gitApi, isHosted, policyApi, setEndpoint, workItemTrackingApi };
|
|
47
64
|
|
|
48
65
|
//# sourceMappingURL=azure-got-wrapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"azure-got-wrapper.js","names":["hostRules.find"],"sources":["../../../../lib/modules/platform/azure/azure-got-wrapper.ts"],"sourcesContent":["import * as azure from 'azure-devops-node-api';\nimport {\n getBasicHandler,\n getBearerHandler,\n getPersonalAccessTokenHandler,\n} from 'azure-devops-node-api';\nimport type { ICoreApi } from 'azure-devops-node-api/CoreApi.js';\nimport type { IGitApi } from 'azure-devops-node-api/GitApi.js';\nimport type { IRequestHandler } from 'azure-devops-node-api/interfaces/common/VsoBaseInterfaces.js';\nimport type { IPolicyApi } from 'azure-devops-node-api/PolicyApi.js';\nimport type { IWorkItemTrackingApi } from 'azure-devops-node-api/WorkItemTrackingApi.js';\nimport { logger } from '../../../logger/index.ts';\nimport type { HostRule } from '../../../types/index.ts';\nimport * as hostRules from '../../../util/host-rules.ts';\nimport { isProbablyJwt } from '../../../util/http/jwt.ts';\n\nconst hostType = 'azure';\nlet endpoint: string;\n\nfunction getAuthenticationHandler(config: HostRule): IRequestHandler {\n if (!config.token && config.username && config.password) {\n return getBasicHandler(config.username, config.password, true);\n }\n if (config.token && isProbablyJwt(config.token)) {\n logger.debug('Using Bearer authentication (JWT detected)');\n return getBearerHandler(config.token, true);\n }\n logger.debug('Using PAT authentication');\n // TODO: token can be undefined here (#22198)\n return getPersonalAccessTokenHandler(config.token!, true);\n}\n\nexport function azureObj(): azure.WebApi {\n const config = hostRules.find({ hostType, url: endpoint });\n if (!config.token && !(config.username && config.password)) {\n throw new Error(`No config found for azure`);\n }\n const authHandler = getAuthenticationHandler(config);\n return new azure.WebApi(endpoint, authHandler, {\n allowRetries: true,\n maxRetries: 2,\n });\n}\n\nexport function gitApi(): Promise<IGitApi> {\n return azureObj().getGitApi();\n}\n\nexport function coreApi(): Promise<ICoreApi> {\n return azureObj().getCoreApi();\n}\n\nexport function policyApi(): Promise<IPolicyApi> {\n return azureObj().getPolicyApi();\n}\n\nexport function workItemTrackingApi(): Promise<IWorkItemTrackingApi> {\n return azureObj().getWorkItemTrackingApi();\n}\n\nexport function setEndpoint(e: string): void {\n endpoint = e;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"azure-got-wrapper.js","names":["hostRules.find"],"sources":["../../../../lib/modules/platform/azure/azure-got-wrapper.ts"],"sourcesContent":["import * as azure from 'azure-devops-node-api';\nimport {\n getBasicHandler,\n getBearerHandler,\n getPersonalAccessTokenHandler,\n} from 'azure-devops-node-api';\nimport type { ICoreApi } from 'azure-devops-node-api/CoreApi.js';\nimport type { IGitApi } from 'azure-devops-node-api/GitApi.js';\nimport { DeploymentFlags } from 'azure-devops-node-api/interfaces/common/VSSInterfaces.js';\nimport type { IRequestHandler } from 'azure-devops-node-api/interfaces/common/VsoBaseInterfaces.js';\nimport type { IPolicyApi } from 'azure-devops-node-api/PolicyApi.js';\nimport type { IWorkItemTrackingApi } from 'azure-devops-node-api/WorkItemTrackingApi.js';\nimport { logger } from '../../../logger/index.ts';\nimport type { HostRule } from '../../../types/index.ts';\nimport * as hostRules from '../../../util/host-rules.ts';\nimport { isProbablyJwt } from '../../../util/http/jwt.ts';\n\nconst hostType = 'azure';\nlet endpoint: string;\n\nfunction getAuthenticationHandler(config: HostRule): IRequestHandler {\n if (!config.token && config.username && config.password) {\n return getBasicHandler(config.username, config.password, true);\n }\n if (config.token && isProbablyJwt(config.token)) {\n logger.debug('Using Bearer authentication (JWT detected)');\n return getBearerHandler(config.token, true);\n }\n logger.debug('Using PAT authentication');\n // TODO: token can be undefined here (#22198)\n return getPersonalAccessTokenHandler(config.token!, true);\n}\n\nexport function azureObj(): azure.WebApi {\n const config = hostRules.find({ hostType, url: endpoint });\n if (!config.token && !(config.username && config.password)) {\n throw new Error(`No config found for azure`);\n }\n const authHandler = getAuthenticationHandler(config);\n return new azure.WebApi(endpoint, authHandler, {\n allowRetries: true,\n maxRetries: 2,\n });\n}\n\nexport function gitApi(): Promise<IGitApi> {\n return azureObj().getGitApi();\n}\n\nexport function coreApi(): Promise<ICoreApi> {\n return azureObj().getCoreApi();\n}\n\nexport function policyApi(): Promise<IPolicyApi> {\n return azureObj().getPolicyApi();\n}\n\nexport function workItemTrackingApi(): Promise<IWorkItemTrackingApi> {\n return azureObj().getWorkItemTrackingApi();\n}\n\n/**\n * Whether the endpoint is Azure DevOps Services (cloud) rather than Azure\n * DevOps Server (on-premises). Read from the location service's\n * `_apis/connectionData`, which reports the deployment type authoritatively.\n * Defaults to `false` (on-premises) when the type cannot be determined, so\n * callers stay on the behaviour that both products support.\n */\nexport async function isHosted(): Promise<boolean> {\n try {\n const { deploymentType } = await azureObj().connect();\n return deploymentType === DeploymentFlags.Hosted;\n } catch (err) {\n logger.debug(\n { err },\n 'Azure: could not determine deployment type, assuming on-premises',\n );\n return false;\n }\n}\n\nexport function setEndpoint(e: string): void {\n endpoint = e;\n}\n"],"mappings":";;;;;;;AAiBA,MAAM,WAAW;AACjB,IAAI;AAEJ,SAAS,yBAAyB,QAAmC;CACnE,IAAI,CAAC,OAAO,SAAS,OAAO,YAAY,OAAO,UAC7C,OAAO,gBAAgB,OAAO,UAAU,OAAO,UAAU,IAAI;CAE/D,IAAI,OAAO,SAAS,cAAc,OAAO,KAAK,GAAG;EAC/C,OAAO,MAAM,4CAA4C;EACzD,OAAO,iBAAiB,OAAO,OAAO,IAAI;CAC5C;CACA,OAAO,MAAM,0BAA0B;CAEvC,OAAO,8BAA8B,OAAO,OAAQ,IAAI;AAC1D;AAEA,SAAgB,WAAy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