From d612fdf4931cabcd22193073bd87f11877b84dfc Mon Sep 17 00:00:00 2001 From: Larry Gregory Date: Tue, 2 Sep 2025 18:30:37 -0400 Subject: [PATCH 1/2] Remove expiry-js (#233774) (cherry picked from commit 5e7648741747f0c2b8d5b44f3641989aef7a8ee7) # Conflicts: # yarn.lock --- package.json | 1 - renovate.json | 21 +-------------- src/cli_plugin/install/settings.js | 40 +++++++++++++++++++++-------- yarn.lock | 41 ++++++++++++++++++++++++------ 4 files changed, 64 insertions(+), 39 deletions(-) diff --git a/package.json b/package.json index 4b56079b09cfe..b0afc389b7210 100644 --- a/package.json +++ b/package.json @@ -1126,7 +1126,6 @@ "email-addresses": "^5.0.0", "eventsource-parser": "^3.0.0", "execa": "^5.1.1", - "expiry-js": "0.1.7", "exponential-backoff": "^3.1.1", "extract-zip": "^2.0.1", "fast-deep-equal": "^3.1.3", diff --git a/renovate.json b/renovate.json index 8fef8c562be59..0da5a5c0dcc1d 100644 --- a/renovate.json +++ b/renovate.json @@ -2833,25 +2833,6 @@ "minimumReleaseAge": "7 days", "enabled": true }, - { - "groupName": "expiry-js", - "matchDepNames": [ - "expiry-js" - ], - "reviewers": [ - "team:kibana-operations" - ], - "matchBaseBranches": [ - "main" - ], - "labels": [ - "Team:Operations", - "backport:all-open", - "release_note:skip" - ], - "minimumReleaseAge": "7 days", - "enabled": true - }, { "groupName": "globby", "matchDepNames": [ @@ -4697,4 +4678,4 @@ "datasourceTemplate": "docker" } ] -} +} \ No newline at end of file diff --git a/src/cli_plugin/install/settings.js b/src/cli_plugin/install/settings.js index 161f442669b65..782f737077d83 100644 --- a/src/cli_plugin/install/settings.js +++ b/src/cli_plugin/install/settings.js @@ -8,7 +8,6 @@ */ import { resolve } from 'path'; -import expiry from 'expiry-js'; import { fromRoot } from '@kbn/repo-info'; function generateUrls({ version, plugin }) { @@ -19,16 +18,37 @@ function generateUrls({ version, plugin }) { } export function parseMilliseconds(val) { - let result; - - try { - const timeVal = expiry(val); - result = timeVal.asMilliseconds(); - } catch (ex) { - result = 0; + if (typeof val === 'number') return val; + if (typeof val !== 'string') return 0; + const regex = /^(\d+)(ms|milliseconds?|s|seconds?|m|minutes?|h|hours?|d|days?)?$/; + const match = val.trim().match(regex); + if (!match) return 0; + const num = parseInt(match[1], 10); + const unit = match[2] || 'ms'; + switch (unit) { + case 'ms': + case 'millisecond': + case 'milliseconds': + return num; + case 's': + case 'second': + case 'seconds': + return num * 1000; + case 'm': + case 'minute': + case 'minutes': + return num * 60 * 1000; + case 'h': + case 'hour': + case 'hours': + return num * 60 * 60 * 1000; + case 'd': + case 'day': + case 'days': + return num * 24 * 60 * 60 * 1000; + default: + return num; } - - return result; } export function parse(command, options, kbnPackage) { diff --git a/yarn.lock b/yarn.lock index 92fc4341c83c3..0ab8f0c341679 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19759,11 +19759,6 @@ expect@^29.0.0, expect@^29.7.0: jest-message-util "^29.7.0" jest-util "^29.7.0" -expiry-js@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/expiry-js/-/expiry-js-0.1.7.tgz#76be8c05e572bf936df40c1766448d0b3b2f555f" - integrity sha1-dr6MBeVyv5Nt9AwXZkSNCzsvVV8= - exponential-backoff@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6" @@ -31737,6 +31732,15 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -31847,7 +31851,7 @@ stringify-object@^3.2.1: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -31861,6 +31865,13 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" +strip-ansi@^6.0.0, strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + strip-ansi@^7.0.1, strip-ansi@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -34845,7 +34856,7 @@ workerpool@^6.5.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -34871,6 +34882,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" @@ -34983,7 +35003,7 @@ xpath@^0.0.33: resolved "https://registry.yarnpkg.com/xpath/-/xpath-0.0.33.tgz#5136b6094227c5df92002e7c3a13516a5074eb07" integrity sha512-NNXnzrkDrAzalLhIUc01jO2mOzXGXh1JwPgkihcLLzw98c0WgYDmmjSh1Kl3wzaxSVWMuA+fe0WTWOBDWCBmNA== -"xstate5@npm:xstate@^5.19.2", xstate@^5.19.2: +"xstate5@npm:xstate@^5.19.2": version "5.19.2" resolved "https://registry.yarnpkg.com/xstate/-/xstate-5.19.2.tgz#db3f1ee614bbb6a49ad3f0c96ddbf98562d456ba" integrity sha512-B8fL2aP0ogn5aviAXFzI5oZseAMqN00fg/TeDa3ZtatyDcViYLIfuQl4y8qmHCiKZgGEzmnTyNtNQL9oeJE2gw== @@ -34993,6 +35013,11 @@ xstate@^4.38.3: resolved "https://registry.yarnpkg.com/xstate/-/xstate-4.38.3.tgz#4e15e7ad3aa0ca1eea2010548a5379966d8f1075" integrity sha512-SH7nAaaPQx57dx6qvfcIgqKRXIh4L0A1iYEqim4s1u7c9VoCgzZc+63FY90AKU4ZzOC2cfJzTnpO4zK7fCUzzw== +xstate@^5.19.2: + version "5.19.2" + resolved "https://registry.yarnpkg.com/xstate/-/xstate-5.19.2.tgz#db3f1ee614bbb6a49ad3f0c96ddbf98562d456ba" + integrity sha512-B8fL2aP0ogn5aviAXFzI5oZseAMqN00fg/TeDa3ZtatyDcViYLIfuQl4y8qmHCiKZgGEzmnTyNtNQL9oeJE2gw== + "xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@^4.0.2, xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" From 8a92f4d7b254009fd00e734432fbd4141742a12a Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:59:30 +0000 Subject: [PATCH 2/2] [CI] Auto-commit changed files from 'node scripts/notice' --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 0ab8f0c341679..7c1606714c308 100644 --- a/yarn.lock +++ b/yarn.lock @@ -31714,7 +31714,7 @@ string-replace-loader@^3.1.0: loader-utils "^2.0.0" schema-utils "^3.0.0" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.2.2: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==