From edc2568098e81526effd1a5c9ffcfabc52e8003a Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Wed, 22 May 2024 10:15:07 +0300 Subject: [PATCH 01/39] fix: use tse id param --- internal/app/api/v1/testsuites.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/app/api/v1/testsuites.go b/internal/app/api/v1/testsuites.go index 58c739b0720..8397c717cfb 100644 --- a/internal/app/api/v1/testsuites.go +++ b/internal/app/api/v1/testsuites.go @@ -852,7 +852,13 @@ func (s TestkubeAPI) ListTestSuiteTestsHandler() fiber.Handler { func getExecutionsFilterFromRequest(c *fiber.Ctx) testresult.Filter { filter := testresult.NewExecutionsFilter() - name := c.Query("id", "") + // id for /test-suites/ID/executions + name := c.Params("id", "") + if name == "" { + // query param for /executions?id + name = c.Query("id", "") + } + if name != "" { filter = filter.WithName(name) } From 236f1fd8bd215e7307d662a4fc05637a96ebb0ef Mon Sep 17 00:00:00 2001 From: Jacek Wysocki Date: Thu, 23 May 2024 08:39:38 +0200 Subject: [PATCH 02/39] fix: added human readable log format (#5479) --- pkg/log/log.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/log/log.go b/pkg/log/log.go index f37bff5b54d..0806edb835d 100644 --- a/pkg/log/log.go +++ b/pkg/log/log.go @@ -4,6 +4,7 @@ import ( "log" "go.uber.org/zap" + "go.uber.org/zap/zapcore" "github.com/kubeshop/testkube/pkg/envs" ) @@ -19,6 +20,7 @@ func New() *zap.SugaredLogger { zapCfg := zap.NewProductionConfig() zapCfg.Level = atomicLevel + zapCfg.EncoderConfig.EncodeTime = zapcore.RFC3339TimeEncoder z, err := zapCfg.Build() if err != nil { From 28c2e39433ca9b229bb86b8131be30f024d4043f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 10:32:20 +0200 Subject: [PATCH 03/39] build(deps-dev): bump @babel/traverse in /test/cli-tests (#4788) Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.20.0 to 7.23.6. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.6/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- test/cli-tests/package-lock.json | 409 ++++++++++++++++++++----------- 1 file changed, 271 insertions(+), 138 deletions(-) diff --git a/test/cli-tests/package-lock.json b/test/cli-tests/package-lock.json index e7403059747..36066383f50 100644 --- a/test/cli-tests/package-lock.json +++ b/test/cli-tests/package-lock.json @@ -32,17 +32,89 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/compat-data": { "version": "7.20.0", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.0.tgz", @@ -92,13 +164,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.0.tgz", - "integrity": "sha512-GUPcXxWibClgmYJuIwC2Bc2Lg+8b9VjaJ+HlNdACEVt+Wlr1eoU1OPZjZRm7Hzl0gaTsUZNQfeihvZJhG7oc3w==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dev": true, "dependencies": { - "@babel/types": "^7.20.0", + "@babel/types": "^7.23.6", "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" }, "engines": { @@ -247,9 +320,9 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, "engines": { "node": ">=6.9.0" @@ -268,25 +341,25 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", - "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/template": "^7.18.10", - "@babel/types": "^7.19.0" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -415,30 +488,30 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", - "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -483,13 +556,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -555,12 +628,6 @@ "node": ">=4" } }, - "node_modules/@babel/highlight/node_modules/js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, "node_modules/@babel/highlight/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -574,9 +641,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.0.tgz", - "integrity": "sha512-G9VgAhEaICnz8iiJeGJQyVl6J2nTjbW0xeisva0PK6XcKsga7BIaqm4ZF8Rg1Wbaqmy6znspNqhPaPkyukujzg==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1738,34 +1805,34 @@ } }, "node_modules/@babel/template": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", - "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.10", - "@babel/types": "^7.18.10" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.0.tgz", - "integrity": "sha512-5+cAXQNARgjRUK0JWu2UBwja4JLSO/rBMPJzpsKb+oBF5xlUuCfljQepS4XypBQoiigL0VQjTZy6WiONtUdScQ==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.0", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.0", - "@babel/types": "^7.20.0", - "debug": "^4.1.0", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz", + "integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.6", + "@babel/types": "^7.23.6", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { @@ -1773,13 +1840,13 @@ } }, "node_modules/@babel/types": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.0.tgz", - "integrity": "sha512-Jlgt3H0TajCW164wkTOTzHkZb075tMQMULzrLUoUeKmO7eFL96GgDxf7/Axhc5CAuKE3KFyVW1p6ysKsi2oXAg==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", + "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -2786,6 +2853,12 @@ "node": ">=0.10.0" } }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -3796,12 +3869,71 @@ } }, "@babel/code-frame": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", - "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "dev": true, "requires": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "@babel/compat-data": { @@ -3842,13 +3974,14 @@ } }, "@babel/generator": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.20.0.tgz", - "integrity": "sha512-GUPcXxWibClgmYJuIwC2Bc2Lg+8b9VjaJ+HlNdACEVt+Wlr1eoU1OPZjZRm7Hzl0gaTsUZNQfeihvZJhG7oc3w==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.6.tgz", + "integrity": "sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==", "dev": true, "requires": { - "@babel/types": "^7.20.0", + "@babel/types": "^7.23.6", "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" }, "dependencies": { @@ -3958,9 +4091,9 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.18.9", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz", - "integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true }, "@babel/helper-explode-assignable-expression": { @@ -3973,22 +4106,22 @@ } }, "@babel/helper-function-name": { - "version": "7.19.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz", - "integrity": "sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "requires": { - "@babel/template": "^7.18.10", - "@babel/types": "^7.19.0" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" } }, "@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-member-expression-to-functions": { @@ -4084,24 +4217,24 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-string-parser": { - "version": "7.19.4", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz", - "integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "dev": true }, "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, "@babel/helper-validator-option": { @@ -4134,13 +4267,13 @@ } }, "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.18.6", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "dependencies": { @@ -4191,12 +4324,6 @@ "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -4209,9 +4336,9 @@ } }, "@babel/parser": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.0.tgz", - "integrity": "sha512-G9VgAhEaICnz8iiJeGJQyVl6J2nTjbW0xeisva0PK6XcKsga7BIaqm4ZF8Rg1Wbaqmy6znspNqhPaPkyukujzg==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", "dev": true }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { @@ -4990,42 +5117,42 @@ } }, "@babel/template": { - "version": "7.18.10", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz", - "integrity": "sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.10", - "@babel/types": "^7.18.10" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" } }, "@babel/traverse": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.20.0.tgz", - "integrity": "sha512-5+cAXQNARgjRUK0JWu2UBwja4JLSO/rBMPJzpsKb+oBF5xlUuCfljQepS4XypBQoiigL0VQjTZy6WiONtUdScQ==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.0", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.0", - "@babel/types": "^7.20.0", - "debug": "^4.1.0", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.6.tgz", + "integrity": "sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.23.5", + "@babel/generator": "^7.23.6", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.6", + "@babel/types": "^7.23.6", + "debug": "^4.3.1", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.20.0.tgz", - "integrity": "sha512-Jlgt3H0TajCW164wkTOTzHkZb075tMQMULzrLUoUeKmO7eFL96GgDxf7/Axhc5CAuKE3KFyVW1p6ysKsi2oXAg==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.6.tgz", + "integrity": "sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg==", "dev": true, "requires": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "dependencies": { @@ -5772,6 +5899,12 @@ "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", "dev": true }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", From 3f6757516a2f8b14e5e49dd5f35d8fb7529adb1f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 10:32:40 +0200 Subject: [PATCH 04/39] chore(deps): bump golang.org/x/net (#5321) Bumps [golang.org/x/net](https://github.com/golang/net) from 0.7.0 to 0.23.0. - [Commits](https://github.com/golang/net/compare/v0.7.0...v0.23.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jacek Wysocki --- contrib/executor/ginkgo/examples/testkube-api/go.mod | 6 +++--- contrib/executor/ginkgo/examples/testkube-api/go.sum | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contrib/executor/ginkgo/examples/testkube-api/go.mod b/contrib/executor/ginkgo/examples/testkube-api/go.mod index e35c5eb6f94..d1ca0bd8d69 100644 --- a/contrib/executor/ginkgo/examples/testkube-api/go.mod +++ b/contrib/executor/ginkgo/examples/testkube-api/go.mod @@ -12,8 +12,8 @@ require ( github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0 // indirect github.com/google/go-cmp v0.5.8 // indirect go.mongodb.org/mongo-driver v1.10.1 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/text v0.14.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/contrib/executor/ginkgo/examples/testkube-api/go.sum b/contrib/executor/ginkgo/examples/testkube-api/go.sum index 895cd8525a6..66bf9e9bfda 100644 --- a/contrib/executor/ginkgo/examples/testkube-api/go.sum +++ b/contrib/executor/ginkgo/examples/testkube-api/go.sum @@ -36,19 +36,19 @@ go.mongodb.org/mongo-driver v1.10.1 h1:NujsPveKwHaWuKUer/ceo9DzEe7HIj1SlJ6uvXZG0 go.mongodb.org/mongo-driver v1.10.1/go.mod h1:z4XpeoU6w+9Vht+jAFyLgVrD+jGSQQe0+CBWFHNiHt8= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= From fac46090b9853fca1ca61b6ef3e44daeb8d82739 Mon Sep 17 00:00:00 2001 From: Lilla Vass Date: Thu, 23 May 2024 11:28:09 +0200 Subject: [PATCH 05/39] feat: [TKC-1948] disable webhooks (#5472) * feat: disable webhooks * fix: code review comment --- api/v1/testkube.yaml | 7 ++ .../commands/webhooks/common.go | 20 +++++ .../commands/webhooks/create.go | 13 +++ .../commands/webhooks/update.go | 8 ++ docs/docs/articles/webhooks.mdx | 79 +++++++++++++++++++ docs/docs/cli/testkube_create_webhook.md | 2 + docs/docs/cli/testkube_update_webhook.md | 2 + go.mod | 2 +- go.sum | 2 + pkg/api/v1/testkube/model_webhook.go | 2 + .../testkube/model_webhook_create_request.go | 2 + pkg/api/v1/testkube/model_webhook_extended.go | 3 +- .../testkube/model_webhook_update_request.go | 2 + pkg/event/kind/webhook/listener.go | 14 +++- pkg/event/kind/webhook/listener_test.go | 26 ++++-- pkg/event/kind/webhook/loader.go | 2 +- pkg/mapper/webhooks/mapper.go | 7 ++ 17 files changed, 184 insertions(+), 9 deletions(-) diff --git a/api/v1/testkube.yaml b/api/v1/testkube.yaml index ce53502308a..2e85f9fcebc 100644 --- a/api/v1/testkube.yaml +++ b/api/v1/testkube.yaml @@ -6849,6 +6849,13 @@ components: example: env: "prod" app: "backend" + disabled: + type: boolean + description: whether webhook is disabled + default: false + example: + - true + - false Event: description: Event data diff --git a/cmd/kubectl-testkube/commands/webhooks/common.go b/cmd/kubectl-testkube/commands/webhooks/common.go index c818cc62035..b4eb92d4497 100644 --- a/cmd/kubectl-testkube/commands/webhooks/common.go +++ b/cmd/kubectl-testkube/commands/webhooks/common.go @@ -56,6 +56,13 @@ func NewCreateWebhookOptionsFromFlags(cmd *cobra.Command) (options apiv1.CreateW PayloadTemplateReference: payloadTemplateReference, } + if cmd.Flag("enable").Changed { + options.Disabled = false + } + if cmd.Flag("disable").Changed { + options.Disabled = true + } + return options, nil } @@ -137,5 +144,18 @@ func NewUpdateWebhookOptionsFromFlags(cmd *cobra.Command) (options apiv1.UpdateW options.Headers = &headers } + if cmd.Flag("enable").Changed { + options.Disabled = new(bool) + *options.Disabled = false + } + if cmd.Flag("disable").Changed { + options.Disabled = new(bool) + *options.Disabled = true + } + return options, nil } + +func isBothEnabledAndDisabledSet(cmd *cobra.Command) bool { + return cmd.Flag("enable").Changed && cmd.Flag("disable").Changed +} diff --git a/cmd/kubectl-testkube/commands/webhooks/create.go b/cmd/kubectl-testkube/commands/webhooks/create.go index 046cd2c75a1..81a130d2675 100644 --- a/cmd/kubectl-testkube/commands/webhooks/create.go +++ b/cmd/kubectl-testkube/commands/webhooks/create.go @@ -38,6 +38,10 @@ func NewCreateWebhookCmd() *cobra.Command { ui.Failf("pass valid name (in '--name' flag)") } + if isBothEnabledAndDisabledSet(cmd) { + ui.Failf("both --enable and --disable flags are set, please use only one") + } + namespace := cmd.Flag("namespace").Value.String() var client apiv1.Client if !crdOnly { @@ -45,6 +49,13 @@ func NewCreateWebhookCmd() *cobra.Command { ui.ExitOnError("getting client", err) webhook, _ := client.GetWebhook(name) + if cmd.Flag("enable").Changed { + webhook.Disabled = false + } + if cmd.Flag("disable").Changed { + webhook.Disabled = true + } + if name == webhook.Name { if cmd.Flag("update").Changed { if !update { @@ -99,6 +110,8 @@ func NewCreateWebhookCmd() *cobra.Command { cmd.Flags().StringToStringVarP(&headers, "header", "", nil, "webhook header value pair (golang template supported): --header Content-Type=application/xml") cmd.Flags().StringVar(&payloadTemplateReference, "payload-template-reference", "", "reference to payload template to use for the webhook") cmd.Flags().BoolVar(&update, "update", false, "update, if webhook already exists") + cmd.Flags().Bool("disable", false, "disable webhook") + cmd.Flags().Bool("enable", false, "enable webhook") return cmd } diff --git a/cmd/kubectl-testkube/commands/webhooks/update.go b/cmd/kubectl-testkube/commands/webhooks/update.go index 8f0c524d026..4fda059cc1a 100644 --- a/cmd/kubectl-testkube/commands/webhooks/update.go +++ b/cmd/kubectl-testkube/commands/webhooks/update.go @@ -17,6 +17,8 @@ func UpdateWebhookCmd() *cobra.Command { payloadTemplate string headers map[string]string payloadTemplateReference string + enable bool + disable bool ) cmd := &cobra.Command{ @@ -29,6 +31,10 @@ func UpdateWebhookCmd() *cobra.Command { ui.Failf("pass valid name (in '--name' flag)") } + if isBothEnabledAndDisabledSet(cmd) { + ui.Failf("both --enable and --disable flags are set, please use only one") + } + client, namespace, err := common.GetClient(cmd) ui.ExitOnError("getting client", err) @@ -56,6 +62,8 @@ func UpdateWebhookCmd() *cobra.Command { cmd.Flags().StringVarP(&payloadTemplate, "payload-template", "", "", "if webhook needs to send a custom notification, then a path to template file should be provided") cmd.Flags().StringToStringVarP(&headers, "header", "", nil, "webhook header value pair (golang template supported): --header Content-Type=application/xml") cmd.Flags().StringVar(&payloadTemplateReference, "payload-template-reference", "", "reference to payload template to use for the webhook") + cmd.Flags().BoolVar(&disable, "disable", false, "disable webhook") + cmd.Flags().BoolVar(&enable, "enable", false, "enable webhook") return cmd } diff --git a/docs/docs/articles/webhooks.mdx b/docs/docs/articles/webhooks.mdx index 01edda609ef..0d6dd915640 100644 --- a/docs/docs/articles/webhooks.mdx +++ b/docs/docs/articles/webhooks.mdx @@ -450,3 +450,82 @@ If you are just getting started and want to test your webhook configuration, you 2. [Webhook.Site](https://webhook.site/): Webhook.Site provides an easy way to capture HTTP payloads, review the headers and body for the incoming requests, and automatically respond with a `200 OK` status code. By using these services, you can quickly set up an HTTP endpoint to receive webhook payloads during your testing/development process. + +## Disabling Webhooks + +Disabling webhooks can be helpful to make sure your team does not get spammed with notifications during development. Testkube lets you disable them via the CLI, the API or modifying the CRD directly. By default, webhooks are enabled on creation. + + + + +The easiest way to operate on webhooks in Testkube is to use the official CLI. + +#### Set on Creation + +To disable: + +```bash +testkube create webhook --disable --name "${WEBHOOK_NAME}" ... +``` + +To enable it explicitly: + +```bash +testkube create webhook --enable --name "${WEBHOOK_NAME}" ... +``` + +#### Set on Update + +To disable: + +```bash +testkube update webhook --disable --name "${WEBHOOK_NAME}" +``` + +To enable: + +```bash +testkube update webhook --enable --name "${WEBHOOK_NAME}" +``` + + + + + +When automating your operations on webhooks, you can also use the API. For more details, please consult the "Core OSS OpenAPI Definion" page, respectively the "OpenAPI Specification" for Testkube Pro and Enterprise, under the Reference tab on the left. The field specifying this on the webhooks is called `disabled` and is expecting a value of type `boolean`. + +Keep in mind, that enabling the webhook again from the API will require specifying `"disabled":false`, simply deleting the field from the object is interpreted as not setting any value on it. + + + + + +Using the webhook from the example in creation, you can add the field `disabled` set to `"true"` to the specification: + +```yaml title="webhook.yaml" +apiVersion: executor.testkube.io/v1 +kind: Webhook +metadata: + name: example-webhook + namespace: testkube +spec: + uri: + events: + - start-test + - end-test-success + - end-test-failed + selector: "" + disabled: "true" +``` + +Apply with: + +```sh +kubectl apply -f webhook.yaml +``` + +To enable a webhook again, you can either set the field `disabled` to `"false"` explicitly, or delete it altogether from the specification. + + + + diff --git a/docs/docs/cli/testkube_create_webhook.md b/docs/docs/cli/testkube_create_webhook.md index db0eaf84f91..94c6b85e24d 100644 --- a/docs/docs/cli/testkube_create_webhook.md +++ b/docs/docs/cli/testkube_create_webhook.md @@ -13,6 +13,8 @@ testkube create webhook [flags] ### Options ``` + --disable disable webhook + --enable enable webhook -e, --events stringArray event types handled by webhook e.g. start-test|end-test --header stringToString webhook header value pair (golang template supported): --header Content-Type=application/xml (default []) -h, --help help for webhook diff --git a/docs/docs/cli/testkube_update_webhook.md b/docs/docs/cli/testkube_update_webhook.md index 4886f90c89a..f21fe9d5894 100644 --- a/docs/docs/cli/testkube_update_webhook.md +++ b/docs/docs/cli/testkube_update_webhook.md @@ -13,6 +13,8 @@ testkube update webhook [flags] ### Options ``` + --disable disable webhook + --enable enable webhook -e, --events stringArray event types handled by webhook e.g. start-test|end-test --header stringToString webhook header value pair (golang template supported): --header Content-Type=application/xml (default []) -h, --help help for webhook diff --git a/go.mod b/go.mod index 47e73be45cc..c75f458578c 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/kelseyhightower/envconfig v1.4.0 github.com/kubepug/kubepug v1.7.1 - github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240520124846-07a4da84c97e + github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240521110543-f5f8bc7df098 github.com/minio/minio-go/v7 v7.0.47 github.com/montanaflynn/stats v0.6.6 github.com/moogar0880/problems v0.1.1 diff --git a/go.sum b/go.sum index e9c479b74b2..9ea4e1bae76 100644 --- a/go.sum +++ b/go.sum @@ -368,6 +368,8 @@ github.com/kubepug/kubepug v1.7.1 h1:LKhfSxS8Y5mXs50v+3Lpyec+cogErDLcV7CMUuiaisw github.com/kubepug/kubepug v1.7.1/go.mod h1:lv+HxD0oTFL7ZWjj0u6HKhMbbTIId3eG7aWIW0gyF8g= github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240520124846-07a4da84c97e h1:q6lJqg6BfZlvogXRhC4iuPlQsZ1gk9Ng8JkYALFL6kA= github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240520124846-07a4da84c97e/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk= +github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240521110543-f5f8bc7df098 h1:Dwu0AWX+pPgKYjlDXHf+7TRP3FiPzEcciBIqbUIg3dI= +github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240521110543-f5f8bc7df098/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8LFgLN4= diff --git a/pkg/api/v1/testkube/model_webhook.go b/pkg/api/v1/testkube/model_webhook.go index 92685ccc19e..1302ed9b2f0 100644 --- a/pkg/api/v1/testkube/model_webhook.go +++ b/pkg/api/v1/testkube/model_webhook.go @@ -27,4 +27,6 @@ type Webhook struct { Headers map[string]string `json:"headers,omitempty"` // webhook labels Labels map[string]string `json:"labels,omitempty"` + // whether webhook is disabled + Disabled bool `json:"disabled,omitempty"` } diff --git a/pkg/api/v1/testkube/model_webhook_create_request.go b/pkg/api/v1/testkube/model_webhook_create_request.go index ed8387ced36..d98e35a0710 100644 --- a/pkg/api/v1/testkube/model_webhook_create_request.go +++ b/pkg/api/v1/testkube/model_webhook_create_request.go @@ -27,4 +27,6 @@ type WebhookCreateRequest struct { Headers map[string]string `json:"headers,omitempty"` // webhook labels Labels map[string]string `json:"labels,omitempty"` + // whether webhook is disabled + Disabled bool `json:"disabled,omitempty"` } diff --git a/pkg/api/v1/testkube/model_webhook_extended.go b/pkg/api/v1/testkube/model_webhook_extended.go index d95f78e436a..c937aca7f5e 100644 --- a/pkg/api/v1/testkube/model_webhook_extended.go +++ b/pkg/api/v1/testkube/model_webhook_extended.go @@ -14,7 +14,7 @@ import "fmt" type Webhooks []Webhook func (list Webhooks) Table() (header []string, output [][]string) { - header = []string{"Name", "URI", "Events", "Selector", "Labels"} + header = []string{"Name", "URI", "Events", "Selector", "Labels", "Disabled"} for _, e := range list { output = append(output, []string{ @@ -23,6 +23,7 @@ func (list Webhooks) Table() (header []string, output [][]string) { fmt.Sprintf("%v", e.Events), e.Selector, MapToString(e.Labels), + fmt.Sprint(e.Disabled), }) } diff --git a/pkg/api/v1/testkube/model_webhook_update_request.go b/pkg/api/v1/testkube/model_webhook_update_request.go index 22e2ec886a7..8ec6795be9e 100644 --- a/pkg/api/v1/testkube/model_webhook_update_request.go +++ b/pkg/api/v1/testkube/model_webhook_update_request.go @@ -27,4 +27,6 @@ type WebhookUpdateRequest struct { Headers *map[string]string `json:"headers,omitempty"` // webhook labels Labels *map[string]string `json:"labels,omitempty"` + // whether webhook is disabled + Disabled *bool `json:"disabled,omitempty"` } diff --git a/pkg/event/kind/webhook/listener.go b/pkg/event/kind/webhook/listener.go index 55d3b9a4c7d..571605419f0 100644 --- a/pkg/event/kind/webhook/listener.go +++ b/pkg/event/kind/webhook/listener.go @@ -22,7 +22,7 @@ import ( var _ common.Listener = (*WebhookListener)(nil) func NewWebhookListener(name, uri, selector string, events []testkube.EventType, - payloadObjectField, payloadTemplate string, headers map[string]string) *WebhookListener { + payloadObjectField, payloadTemplate string, headers map[string]string, disabled bool) *WebhookListener { return &WebhookListener{ name: name, Uri: uri, @@ -33,6 +33,7 @@ func NewWebhookListener(name, uri, selector string, events []testkube.EventType, payloadObjectField: payloadObjectField, payloadTemplate: payloadTemplate, headers: headers, + disabled: disabled, } } @@ -46,6 +47,7 @@ type WebhookListener struct { payloadObjectField string payloadTemplate string headers map[string]string + disabled bool } func (l *WebhookListener) Name() string { @@ -68,6 +70,7 @@ func (l *WebhookListener) Metadata() map[string]string { "payloadObjectField": l.payloadObjectField, "payloadTemplate": l.payloadTemplate, "headers": fmt.Sprintf("%v", l.headers), + "disabled": fmt.Sprint(l.disabled), } } @@ -83,7 +86,16 @@ func (l *WebhookListener) Headers() map[string]string { return l.headers } +func (l *WebhookListener) Disabled() bool { + return l.disabled +} + func (l *WebhookListener) Notify(event testkube.Event) (result testkube.EventResult) { + if l.disabled { + l.Log.With(event.Log()...).Debug("webhook listener is disabled") + return testkube.NewSuccessEventResult(event.Id, "webhook listener is disabled") + } + body := bytes.NewBuffer([]byte{}) log := l.Log.With(event.Log()...) diff --git a/pkg/event/kind/webhook/listener_test.go b/pkg/event/kind/webhook/listener_test.go index 974fa6aa4d2..5fb7a786fbd 100644 --- a/pkg/event/kind/webhook/listener_test.go +++ b/pkg/event/kind/webhook/listener_test.go @@ -33,7 +33,7 @@ func TestWebhookListener_Notify(t *testing.T) { svr := httptest.NewServer(testHandler) defer svr.Close() - l := NewWebhookListener("l1", svr.URL, "", testEventTypes, "", "", nil) + l := NewWebhookListener("l1", svr.URL, "", testEventTypes, "", "", nil, false) // when r := l.Notify(testkube.Event{ @@ -55,7 +55,7 @@ func TestWebhookListener_Notify(t *testing.T) { svr := httptest.NewServer(testHandler) defer svr.Close() - l := NewWebhookListener("l1", svr.URL, "", testEventTypes, "", "", nil) + l := NewWebhookListener("l1", svr.URL, "", testEventTypes, "", "", nil, false) // when r := l.Notify(testkube.Event{ @@ -72,7 +72,7 @@ func TestWebhookListener_Notify(t *testing.T) { t.Parallel() // given - s := NewWebhookListener("l1", "http://baduri.badbadbad", "", testEventTypes, "", "", nil) + s := NewWebhookListener("l1", "http://baduri.badbadbad", "", testEventTypes, "", "", nil, false) // when r := s.Notify(testkube.Event{ @@ -105,7 +105,7 @@ func TestWebhookListener_Notify(t *testing.T) { svr := httptest.NewServer(testHandler) defer svr.Close() - l := NewWebhookListener("l1", svr.URL, "", testEventTypes, "field", "", nil) + l := NewWebhookListener("l1", svr.URL, "", testEventTypes, "field", "", nil, false) // when r := l.Notify(testkube.Event{ @@ -131,7 +131,7 @@ func TestWebhookListener_Notify(t *testing.T) { svr := httptest.NewServer(testHandler) defer svr.Close() - l := NewWebhookListener("l1", svr.URL, "", testEventTypes, "", "{\"id\": \"{{ .Id }}\"}", map[string]string{"Content-Type": "application/json"}) + l := NewWebhookListener("l1", svr.URL, "", testEventTypes, "", "{\"id\": \"{{ .Id }}\"}", map[string]string{"Content-Type": "application/json"}, false) // when r := l.Notify(testkube.Event{ @@ -143,6 +143,22 @@ func TestWebhookListener_Notify(t *testing.T) { assert.Equal(t, "", r.Error()) }) + + t.Run("send event disabled webhook", func(t *testing.T) { + t.Parallel() + // given + + s := NewWebhookListener("l1", "http://baduri.badbadbad", "", testEventTypes, "", "", nil, true) + + // when + r := s.Notify(testkube.Event{ + Type_: testkube.EventStartTest, + TestExecution: exampleExecution(), + }) + + // then + assert.Equal(t, "", r.Error()) + }) } func exampleExecution() *testkube.Execution { diff --git a/pkg/event/kind/webhook/loader.go b/pkg/event/kind/webhook/loader.go index 9b9ebf7d701..9410eb140ae 100644 --- a/pkg/event/kind/webhook/loader.go +++ b/pkg/event/kind/webhook/loader.go @@ -66,7 +66,7 @@ func (r WebhooksLoader) Load() (listeners common.Listeners, err error) { types := webhooks.MapEventArrayToCRDEvents(webhook.Spec.Events) name := fmt.Sprintf("%s.%s", webhook.ObjectMeta.Namespace, webhook.ObjectMeta.Name) - listeners = append(listeners, NewWebhookListener(name, webhook.Spec.Uri, webhook.Spec.Selector, types, webhook.Spec.PayloadObjectField, payloadTemplate, webhook.Spec.Headers)) + listeners = append(listeners, NewWebhookListener(name, webhook.Spec.Uri, webhook.Spec.Selector, types, webhook.Spec.PayloadObjectField, payloadTemplate, webhook.Spec.Headers, webhook.Spec.Disabled)) } return listeners, nil diff --git a/pkg/mapper/webhooks/mapper.go b/pkg/mapper/webhooks/mapper.go index 35d96c38d38..36da188012d 100644 --- a/pkg/mapper/webhooks/mapper.go +++ b/pkg/mapper/webhooks/mapper.go @@ -20,6 +20,7 @@ func MapCRDToAPI(item executorv1.Webhook) testkube.Webhook { PayloadTemplate: item.Spec.PayloadTemplate, PayloadTemplateReference: item.Spec.PayloadTemplateReference, Headers: item.Spec.Headers, + Disabled: item.Spec.Disabled, } } @@ -55,6 +56,7 @@ func MapAPIToCRD(request testkube.WebhookCreateRequest) executorv1.Webhook { PayloadTemplate: request.PayloadTemplate, PayloadTemplateReference: request.PayloadTemplateReference, Headers: request.Headers, + Disabled: request.Disabled, }, } } @@ -121,6 +123,10 @@ func MapUpdateToSpec(request testkube.WebhookUpdateRequest, webhook *executorv1. webhook.Spec.Headers = *request.Headers } + if request.Disabled != nil { + webhook.Spec.Disabled = *request.Disabled + } + return webhook } @@ -169,6 +175,7 @@ func MapSpecToUpdate(webhook *executorv1.Webhook) (request testkube.WebhookUpdat request.Labels = &webhook.Labels request.Headers = &webhook.Spec.Headers + request.Disabled = &webhook.Spec.Disabled return request } From f4940f7337824d1a96ab01b28cbab4725c9c0d71 Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Thu, 23 May 2024 15:46:21 +0200 Subject: [PATCH 06/39] fix(testworkflows): don't resolve environment variables if they are dynamic (i.e. from secrets) (#5485) --- pkg/tcl/testworkflowstcl/testworkflowprocessor/container.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tcl/testworkflowstcl/testworkflowprocessor/container.go b/pkg/tcl/testworkflowstcl/testworkflowprocessor/container.go index 6988e45e8ef..d020e88e3f8 100644 --- a/pkg/tcl/testworkflowstcl/testworkflowprocessor/container.go +++ b/pkg/tcl/testworkflowstcl/testworkflowprocessor/container.go @@ -467,7 +467,7 @@ func (c *container) Resolve(m ...expressionstcl.Machine) error { env := c.Env() name = name[4:] for i := range env { - if env[i].Name == name { + if env[i].Name == name && env[i].ValueFrom == nil { value, err := expressionstcl.EvalTemplate(env[i].Value) if err == nil { return value, true From b903d354b8433229c85e467eee1fbab1dfd15bfe Mon Sep 17 00:00:00 2001 From: Jacek Wysocki Date: Fri, 24 May 2024 09:47:41 +0200 Subject: [PATCH 07/39] feat: added simple job and events debug to the test run command (#5488) --- cmd/kubectl-testkube/commands/tests/run.go | 34 ++++++++- cmd/kubectl-testkube/debugger/debugger.go | 45 +++++++++++ cmd/kubectl-testkube/debugger/events.go | 87 ++++++++++++++++++++++ cmd/kubectl-testkube/debugger/job.go | 68 +++++++++++++++++ 4 files changed, 233 insertions(+), 1 deletion(-) create mode 100644 cmd/kubectl-testkube/debugger/debugger.go create mode 100644 cmd/kubectl-testkube/debugger/events.go create mode 100644 cmd/kubectl-testkube/debugger/job.go diff --git a/cmd/kubectl-testkube/commands/tests/run.go b/cmd/kubectl-testkube/commands/tests/run.go index bed1a4221ae..59ec3413fb7 100644 --- a/cmd/kubectl-testkube/commands/tests/run.go +++ b/cmd/kubectl-testkube/commands/tests/run.go @@ -13,6 +13,7 @@ import ( "github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/common" "github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/common/render" + "github.com/kubeshop/testkube/cmd/kubectl-testkube/debugger" apiv1 "github.com/kubeshop/testkube/pkg/api/v1/client" "github.com/kubeshop/testkube/pkg/api/v1/testkube" "github.com/kubeshop/testkube/pkg/ui" @@ -80,6 +81,8 @@ func NewRunTestCmd() *cobra.Command { slavePodTemplate string slavePodTemplateReference string executionNamespace string + attachDebugger bool + debugFile string ) cmd := &cobra.Command{ @@ -88,6 +91,9 @@ func NewRunTestCmd() *cobra.Command { Short: "Starts new test", Long: `Starts new test based on Test Custom Resource name, returns results to console`, Run: func(cmd *cobra.Command, args []string) { + if attachDebugger { + watchEnabled = true + } envs, err := cmd.Flags().GetStringToString("env") ui.WarnOnError("getting envs", err) @@ -95,7 +101,7 @@ func NewRunTestCmd() *cobra.Command { ui.ExitOnError("getting client", err) info, err := client.GetServerInfo() - ui.ExitOnError("getting server info", err) + ui.WarnOnError("getting server info", err) variables, err := common.CreateVariables(cmd, info.DisableSecretCreation) ui.WarnOnError("getting variables", err) @@ -284,11 +290,30 @@ func NewRunTestCmd() *cobra.Command { ui.Warn("Testkube will use the following file mappings:", copyFileList...) } + var eventsDebugger *debugger.EventsDebugger + if attachDebugger { + writer := os.Stderr + if debugFile != "" { + writer, err = os.Create(debugFile) + ui.WarnOnError("creating debug file", err) + } + + i := debugger.NewInsights().WithWriter(writer) + i.AddDebugger(debugger.NewJobDebugger(testName, namespace)) + eventsDebugger = debugger.NewEventsDebugger(testName, namespace) + i.AddDebugger(eventsDebugger) + i.Run() + } + for i := 0; i < iterations; i++ { execution, err := client.ExecuteTest(testName, name, options) ui.ExitOnError("starting test execution "+namespacedName, err) executions = append(executions, execution) + if attachDebugger { + eventsDebugger.AddExecutionId(execution.Id) + } } + case len(selectors) != 0: selector := strings.Join(selectors, ",") executions, err = client.ExecuteTests(selector, concurrencyLevel, options) @@ -350,6 +375,11 @@ func NewRunTestCmd() *cobra.Command { } ui.ExitOnError("executions contain failed on errors", execErrors...) + if attachDebugger { + // Wait to catch logs from attached debugger after job completed + time.Sleep(3 * time.Second) + ui.Success("Debugger stopped") + } }, } @@ -416,6 +446,8 @@ func NewRunTestCmd() *cobra.Command { cmd.Flags().StringVar(&slavePodTemplate, "slave-pod-template", "", "slave pod template file path for extensions to slave pod template") cmd.Flags().StringVar(&slavePodTemplateReference, "slave-pod-template-reference", "", "reference to slave pod template to use for the test") cmd.Flags().StringVar(&executionNamespace, "execution-namespace", "", "namespace for test execution (Pro edition only)") + cmd.Flags().StringVar(&debugFile, "debugger-file", "", "store debug info into file, stdout by default") + cmd.Flags().BoolVar(&attachDebugger, "attach-debugger", false, "attach simple debugger for job, need KUBECONFIG for the agent to be active") return cmd } diff --git a/cmd/kubectl-testkube/debugger/debugger.go b/cmd/kubectl-testkube/debugger/debugger.go new file mode 100644 index 00000000000..0b110682813 --- /dev/null +++ b/cmd/kubectl-testkube/debugger/debugger.go @@ -0,0 +1,45 @@ +package debugger + +import ( + "io" + "os" +) + +type Debugger interface { + Run() error + SetWriter(w io.Writer) +} + +func NewInsights() *Insights { + return &Insights{ + Debuggers: []Debugger{}, + Writer: os.Stderr, + } +} + +type Insights struct { + Debuggers []Debugger + Writer io.Writer +} + +func (i *Insights) WithWriter(w io.Writer) *Insights { + i.Writer = w + return i +} + +func (i *Insights) AddDebugger(d Debugger) *Insights { + // set common writer for all debuggers + d.SetWriter(i.Writer) + i.Debuggers = append(i.Debuggers, d) + return i +} + +func (i *Insights) Run() *Insights { + for _, d := range i.Debuggers { + go func(d Debugger) { + d.Run() + }(d) + } + + return i +} diff --git a/cmd/kubectl-testkube/debugger/events.go b/cmd/kubectl-testkube/debugger/events.go new file mode 100644 index 00000000000..82fce5070c6 --- /dev/null +++ b/cmd/kubectl-testkube/debugger/events.go @@ -0,0 +1,87 @@ +package debugger + +import ( + "io" + "os" + "os/exec" + "sync" + "time" + + "github.com/kubeshop/testkube/pkg/ui" +) + +func NewEventsDebugger(name, namespace string) *EventsDebugger { + return &EventsDebugger{ + lock: sync.Mutex{}, + Name: name, + Namespace: namespace, + Writer: os.Stdout, + Interval: time.Second, + ExecutionIds: []string{}, + } +} + +// EventsDebugger is a debugger for jobs +type EventsDebugger struct { + lock sync.Mutex + Name string + Namespace string + Writer io.Writer + Interval time.Duration + ExecutionIds []string +} + +func (d *EventsDebugger) Run() error { + for { + err := d.getEvents() + if err != nil { + return err + } + time.Sleep(d.Interval) + } +} + +func (d *EventsDebugger) SetWriter(w io.Writer) { + d.Writer = w +} + +// dummy evnents debug +func (d *EventsDebugger) getEvents() error { + ui := ui.NewUI(false, d.Writer) + kubectl, err := exec.LookPath("kubectl") + if err != nil { + return err + } + args := []string{"get", "events", "-A"} + d.lock.Lock() + executionIds := d.ExecutionIds + d.lock.Unlock() + + for _, id := range executionIds { + ui.H1("Events for execution: " + id + " time: " + time.Now().String()) + events := exec.Command(kubectl, args...) + grep := exec.Command("grep", id) + + // Get ps's stdout and attach it to grep's stdin. + pipe, _ := events.StdoutPipe() + + grep.Stdin = pipe + + events.Start() + res, _ := grep.Output() + pipe.Close() + _, err = d.Writer.Write(res) + if err != nil { + return err + } + + } + + return nil +} + +func (d *EventsDebugger) AddExecutionId(id string) { + d.lock.Lock() + defer d.lock.Unlock() + d.ExecutionIds = append(d.ExecutionIds, id) +} diff --git a/cmd/kubectl-testkube/debugger/job.go b/cmd/kubectl-testkube/debugger/job.go new file mode 100644 index 00000000000..980526458ab --- /dev/null +++ b/cmd/kubectl-testkube/debugger/job.go @@ -0,0 +1,68 @@ +package debugger + +import ( + "io" + "os" + "os/exec" + "time" + + "github.com/kubeshop/testkube/pkg/process" + "github.com/kubeshop/testkube/pkg/ui" +) + +func NewJobDebugger(name, namespace string) *JobDebugger { + return &JobDebugger{ + Name: name, + Namespace: namespace, + Writer: os.Stdout, + Interval: time.Second, + } +} + +// JobDebugger is a debugger for jobs +type JobDebugger struct { + Name string + Namespace string + Writer io.Writer + Interval time.Duration +} + +func (d JobDebugger) Run() error { + for { + err := d.describePod() + if err != nil { + return err + } + time.Sleep(d.Interval) + } +} + +func (d *JobDebugger) SetWriter(w io.Writer) { + d.Writer = w +} + +// dummy describePod +func (d JobDebugger) describePod() error { + ui := ui.NewUI(false, d.Writer) + kubectl, err := exec.LookPath("kubectl") + if err != nil { + return err + } + + args := []string{ + "describe", "pod", "-l", "test-name=" + d.Name, "-n", d.Namespace, + } + + ui.H1("Pod description time: " + time.Now().String()) + + ui.ShellCommand(kubectl, args...) + ui.NL() + + b, err := process.Execute(kubectl, args...) + if err != nil { + return err + } + + _, err = d.Writer.Write(b) + return err +} From 6821d40f1032c6676cb5703da5ffa3b4c386939c Mon Sep 17 00:00:00 2001 From: Jacek Wysocki Date: Fri, 24 May 2024 09:59:09 +0200 Subject: [PATCH 08/39] fix: added no-login option for OnPrem to bypass login ask (#5484) --- cmd/kubectl-testkube/commands/context/set.go | 2 +- cmd/kubectl-testkube/commands/pro/init.go | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/kubectl-testkube/commands/context/set.go b/cmd/kubectl-testkube/commands/context/set.go index 452924d0d4d..35a02508a92 100644 --- a/cmd/kubectl-testkube/commands/context/set.go +++ b/cmd/kubectl-testkube/commands/context/set.go @@ -43,7 +43,7 @@ func NewSetContextCmd() *cobra.Command { switch cfg.ContextType { case config.ContextTypeCloud: if opts.Master.OrgId == "" && opts.Master.EnvId == "" && apiKey == "" && opts.Master.RootDomain == "" { - ui.Errf("Please provide at least one of the following flags: --org, --env, --api-key, --root-domain") + ui.Errf("Please provide at least one of the following flags: --org-id, --env-id, --api-key, --root-domain") } cfg = common.PopulateCloudConfig(cfg, apiKey, &opts) diff --git a/cmd/kubectl-testkube/commands/pro/init.go b/cmd/kubectl-testkube/commands/pro/init.go index f13112e6c78..f6f0866d473 100644 --- a/cmd/kubectl-testkube/commands/pro/init.go +++ b/cmd/kubectl-testkube/commands/pro/init.go @@ -13,6 +13,7 @@ import ( func NewInitCmd() *cobra.Command { var export bool + var noLogin bool // ignore ask for login options := common.HelmOptions{ NoMinio: true, NoMongo: true, @@ -71,6 +72,14 @@ func NewInitCmd() *cobra.Command { ui.NL() + if noLogin { + ui.Alert("Saving Testkube CLI Pro context, you need to authorize CLI through `testkube set context` later") + common.PopulateCloudConfig(cfg, "", &options) + ui.Info(" Happy Testing! 🚀") + ui.NL() + return + } + ui.H2("Saving Testkube CLI Pro context") var token, refreshToken string if !common.IsUserLoggedIn(cfg, options) { @@ -91,6 +100,7 @@ func NewInitCmd() *cobra.Command { common.PopulateHelmFlags(cmd, &options) common.PopulateMasterFlags(cmd, &options) + cmd.Flags().BoolVarP(&noLogin, "no-login", "", false, "Ignore login prompt, set existing token later by `testkube set context`") cmd.Flags().BoolVarP(&export, "export", "", false, "Export the values.yaml") cmd.Flags().BoolVar(&options.MultiNamespace, "multi-namespace", false, "multi namespace mode") cmd.Flags().BoolVar(&options.NoOperator, "no-operator", false, "should operator be installed (for more instances in multi namespace mode it should be set to true)") From 38efb7a031d9ad50c0145608143f15d319d7389b Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Fri, 24 May 2024 10:00:19 +0200 Subject: [PATCH 09/39] fix(testworkflows): replace `services[k].logs` to be expression insted of boolean (#5489) --- api/v1/testkube.yaml | 2 + cmd/tcl/testworkflow-toolkit/commands/kill.go | 41 +++++++++++++++---- go.mod | 2 +- go.sum | 6 +-- ..._test_workflow_independent_service_spec.go | 1 + .../model_test_workflow_service_spec.go | 1 + .../mapperstcl/testworkflows/kube_openapi.go | 2 + .../mapperstcl/testworkflows/openapi_kube.go | 2 + .../testworkflowprocessor/operations.go | 4 +- .../executor-tests/crd-workflow/smoke.yaml | 4 +- 10 files changed, 48 insertions(+), 17 deletions(-) diff --git a/api/v1/testkube.yaml b/api/v1/testkube.yaml index 2e85f9fcebc..315f725b9b1 100644 --- a/api/v1/testkube.yaml +++ b/api/v1/testkube.yaml @@ -7970,6 +7970,8 @@ components: $ref: "#/components/schemas/TestWorkflowContent" pod: $ref: "#/components/schemas/TestWorkflowPodConfig" + logs: + $ref: "#/components/schemas/BoxedString" restartPolicy: type: string readinessProbe: diff --git a/cmd/tcl/testworkflow-toolkit/commands/kill.go b/cmd/tcl/testworkflow-toolkit/commands/kill.go index eae094c4c1e..fa8e9230617 100644 --- a/cmd/tcl/testworkflow-toolkit/commands/kill.go +++ b/cmd/tcl/testworkflow-toolkit/commands/kill.go @@ -11,8 +11,7 @@ package commands import ( "context" "fmt" - "os" - "slices" + "strings" "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -22,6 +21,7 @@ import ( "github.com/kubeshop/testkube/cmd/tcl/testworkflow-toolkit/common" "github.com/kubeshop/testkube/cmd/tcl/testworkflow-toolkit/env" "github.com/kubeshop/testkube/cmd/tcl/testworkflow-toolkit/spawn" + "github.com/kubeshop/testkube/pkg/tcl/expressionstcl" "github.com/kubeshop/testkube/pkg/tcl/testworkflowstcl/testworkflowcontroller" "github.com/kubeshop/testkube/pkg/tcl/testworkflowstcl/testworkflowprocessor/constants" "github.com/kubeshop/testkube/pkg/ui" @@ -37,12 +37,22 @@ func NewKillCmd() *cobra.Command { Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { + machine := expressionstcl.CombinedMachines(data.AliasMachine, data.GetBaseTestWorkflowMachine()) groupRef := args[0] clientSet := env.Kubernetes() - // Fast-track - if len(logs) == 0 { - os.Exit(0) + conditions := make(map[string]expressionstcl.Expression) + for _, l := range logs { + name, condition, found := strings.Cut(l, "=") + if !found { + condition = "true" + } + expr, err := expressionstcl.CompileAndResolve(condition, machine) + if err != nil { + fmt.Printf("warning: service '%s': could not compile condition '%s': %s", name, condition, err.Error()) + } else { + conditions[name] = expr + } } // Fetch the services when needed @@ -55,8 +65,23 @@ func NewKillCmd() *cobra.Command { services := make(map[string]int64) ids := make([]string, 0) for _, job := range jobs.Items { - service, _ := spawn.GetServiceByResourceId(job.Name) - if slices.Contains(logs, service) { + service, index := spawn.GetServiceByResourceId(job.Name) + if _, ok := conditions[service]; !ok { + continue + } + serviceMachine := expressionstcl.NewMachine(). + Register("index", index). + RegisterAccessorExt(func(name string) (interface{}, bool, error) { + if name == "count" { + expr, err := expressionstcl.CompileAndResolve(fmt.Sprintf("len(services.%s)", service)) + return expr, true, err + } + return nil, false, nil + }) + log, err := expressionstcl.EvalExpression(conditions[service].String(), serviceMachine, machine) + if err != nil { + fmt.Printf("warning: service '%s': could not resolve condition '%s': %s", service, log.String(), err.Error()) + } else if v, _ := log.BoolValue(); v { services[service]++ ids = append(ids, job.Name) } @@ -92,7 +117,7 @@ func NewKillCmd() *cobra.Command { }, } - cmd.Flags().StringArrayVarP(&logs, "logs", "l", nil, "fetch the logs for specific services") + cmd.Flags().StringArrayVarP(&logs, "logs", "l", nil, "fetch the logs for specific services - pair =") return cmd } diff --git a/go.mod b/go.mod index c75f458578c..15812f79680 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/kelseyhightower/envconfig v1.4.0 github.com/kubepug/kubepug v1.7.1 - github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240521110543-f5f8bc7df098 + github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524075851-4336c3354c4c github.com/minio/minio-go/v7 v7.0.47 github.com/montanaflynn/stats v0.6.6 github.com/moogar0880/problems v0.1.1 diff --git a/go.sum b/go.sum index 9ea4e1bae76..f704e673b79 100644 --- a/go.sum +++ b/go.sum @@ -366,10 +366,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubepug/kubepug v1.7.1 h1:LKhfSxS8Y5mXs50v+3Lpyec+cogErDLcV7CMUuiaisw= github.com/kubepug/kubepug v1.7.1/go.mod h1:lv+HxD0oTFL7ZWjj0u6HKhMbbTIId3eG7aWIW0gyF8g= -github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240520124846-07a4da84c97e h1:q6lJqg6BfZlvogXRhC4iuPlQsZ1gk9Ng8JkYALFL6kA= -github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240520124846-07a4da84c97e/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk= -github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240521110543-f5f8bc7df098 h1:Dwu0AWX+pPgKYjlDXHf+7TRP3FiPzEcciBIqbUIg3dI= -github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240521110543-f5f8bc7df098/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk= +github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524075851-4336c3354c4c h1:c+j/R3+qLX55ETOqQQFjg9cr/j2JPlfaF6u9DysExgk= +github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524075851-4336c3354c4c/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8LFgLN4= diff --git a/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go b/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go index b257735c734..898b3bb26f1 100644 --- a/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go +++ b/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go @@ -37,6 +37,7 @@ type TestWorkflowIndependentServiceSpec struct { Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` Content *TestWorkflowContent `json:"content,omitempty"` Pod *TestWorkflowPodConfig `json:"pod,omitempty"` + Logs *BoxedString `json:"logs,omitempty"` RestartPolicy string `json:"restartPolicy,omitempty"` ReadinessProbe *Probe `json:"readinessProbe,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_service_spec.go b/pkg/api/v1/testkube/model_test_workflow_service_spec.go index 9c0f4312bb4..9311e16cca1 100644 --- a/pkg/api/v1/testkube/model_test_workflow_service_spec.go +++ b/pkg/api/v1/testkube/model_test_workflow_service_spec.go @@ -31,6 +31,7 @@ type TestWorkflowServiceSpec struct { Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` Content *TestWorkflowContent `json:"content,omitempty"` Pod *TestWorkflowPodConfig `json:"pod,omitempty"` + Logs *BoxedString `json:"logs,omitempty"` RestartPolicy string `json:"restartPolicy,omitempty"` ReadinessProbe *Probe `json:"readinessProbe,omitempty"` Count *BoxedString `json:"count,omitempty"` diff --git a/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go b/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go index b1f8949de22..a65f4b40fd6 100644 --- a/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go +++ b/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go @@ -1002,6 +1002,7 @@ func MapIndependentServiceSpecKubeToAPI(v testworkflowsv1.IndependentServiceSpec Timeout: v.Timeout, Transfer: common.MapSlice(v.Transfer, MapStepParallelTransferKubeToAPI), Content: common.MapPtr(v.Content, MapContentKubeToAPI), + Logs: MapStringToBoxedString(v.Logs), RestartPolicy: string(v.RestartPolicy), ReadinessProbe: common.MapPtr(v.ReadinessProbe, MapProbeKubeToAPI), } @@ -1029,6 +1030,7 @@ func MapServiceSpecKubeToAPI(v testworkflowsv1.ServiceSpec) testkube.TestWorkflo Timeout: v.Timeout, Transfer: common.MapSlice(v.Transfer, MapStepParallelTransferKubeToAPI), Content: common.MapPtr(v.Content, MapContentKubeToAPI), + Logs: MapStringToBoxedString(v.Logs), RestartPolicy: string(v.RestartPolicy), ReadinessProbe: common.MapPtr(v.ReadinessProbe, MapProbeKubeToAPI), } diff --git a/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go b/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go index 28015847a43..b78d120056a 100644 --- a/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go +++ b/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go @@ -1066,6 +1066,7 @@ func MapIndependentServiceSpecAPIToKube(v testkube.TestWorkflowIndependentServic Timeout: v.Timeout, Transfer: common.MapSlice(v.Transfer, MapStepParallelTransferAPIToKube), Content: common.MapPtr(v.Content, MapContentAPIToKube), + Logs: MapBoxedStringToString(v.Logs), RestartPolicy: testworkflowsv1.ServiceRestartPolicy(v.RestartPolicy), ReadinessProbe: common.MapPtr(v.ReadinessProbe, MapProbeAPIToKube), } @@ -1100,6 +1101,7 @@ func MapServiceSpecAPIToKube(v testkube.TestWorkflowServiceSpec) testworkflowsv1 Timeout: v.Timeout, Transfer: common.MapSlice(v.Transfer, MapStepParallelTransferAPIToKube), Content: common.MapPtr(v.Content, MapContentAPIToKube), + Logs: MapBoxedStringToString(v.Logs), RestartPolicy: testworkflowsv1.ServiceRestartPolicy(v.RestartPolicy), ReadinessProbe: common.MapPtr(v.ReadinessProbe, MapProbeAPIToKube), }, diff --git a/pkg/tcl/testworkflowstcl/testworkflowprocessor/operations.go b/pkg/tcl/testworkflowstcl/testworkflowprocessor/operations.go index 9bf60b0db83..8fe3fcf4df2 100644 --- a/pkg/tcl/testworkflowstcl/testworkflowprocessor/operations.go +++ b/pkg/tcl/testworkflowstcl/testworkflowprocessor/operations.go @@ -408,8 +408,8 @@ func ProcessServicesStop(_ InternalProcessor, layer Intermediate, container Cont args := make([]string, 0) for name, v := range step.Services { - if v.Logs { - args = append(args, "-l", name) + if v.Logs != nil { + args = append(args, "-l", fmt.Sprintf("%s=%s", name, *v.Logs)) } } stage.Container().SetArgs(args...) diff --git a/test/jmeter/executor-tests/crd-workflow/smoke.yaml b/test/jmeter/executor-tests/crd-workflow/smoke.yaml index efcfd68d557..61a618a617e 100644 --- a/test/jmeter/executor-tests/crd-workflow/smoke.yaml +++ b/test/jmeter/executor-tests/crd-workflow/smoke.yaml @@ -86,7 +86,7 @@ spec: - name: distribute/evenly count: 5 timeout: 30s # initialization timeout - logs: true + logs: 'always' image: justb4/jmeter:5.5 command: - jmeter-server @@ -141,7 +141,7 @@ spec: - name: distribute/evenly count: 5 timeout: 30s # initialization timeout - logs: true + logs: 'always' image: justb4/jmeter:5.5 command: - jmeter-server From 381f25c9ba62d161ce8a9cefbd9670c4251549d6 Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Fri, 24 May 2024 13:43:04 +0200 Subject: [PATCH 10/39] fix(testworkflows): support objects passed to matrix/shards (#5491) --- .../testworkflow-toolkit/commands/execute.go | 3 +- .../common/combinations.go | 9 +++- cmd/tcl/testworkflow-toolkit/spawn/utils.go | 17 ++++++- go.mod | 2 +- go.sum | 4 +- pkg/tcl/expressionstcl/generic.go | 18 ++++++- pkg/tcl/expressionstcl/generic_test.go | 50 +++++++++++++++++++ .../mapperstcl/testworkflows/kube_openapi.go | 4 +- 8 files changed, 95 insertions(+), 12 deletions(-) diff --git a/cmd/tcl/testworkflow-toolkit/commands/execute.go b/cmd/tcl/testworkflow-toolkit/commands/execute.go index 40dcd1a4ead..69639fa1cc7 100644 --- a/cmd/tcl/testworkflow-toolkit/commands/execute.go +++ b/cmd/tcl/testworkflow-toolkit/commands/execute.go @@ -22,6 +22,7 @@ import ( "github.com/kubeshop/testkube/cmd/tcl/testworkflow-init/data" common2 "github.com/kubeshop/testkube/cmd/tcl/testworkflow-toolkit/common" "github.com/kubeshop/testkube/cmd/tcl/testworkflow-toolkit/env" + "github.com/kubeshop/testkube/cmd/tcl/testworkflow-toolkit/spawn" "github.com/kubeshop/testkube/cmd/tcl/testworkflow-toolkit/transfer" "github.com/kubeshop/testkube/internal/common" "github.com/kubeshop/testkube/pkg/api/v1/client" @@ -221,7 +222,7 @@ func registerTransfer(transferSrv transfer.Server, request map[string]testworkfl for k, t := range request { patterns := []string{"**/*"} if t.Files != nil && !t.Files.Dynamic { - patterns = t.Files.Static + patterns = spawn.MapDynamicListToStringList(t.Files.Static) } else if t.Files != nil && t.Files.Dynamic { patternsExpr, err := expressionstcl.EvalExpression(t.Files.Expression, machines...) if err != nil { diff --git a/cmd/tcl/testworkflow-toolkit/common/combinations.go b/cmd/tcl/testworkflow-toolkit/common/combinations.go index a2bd04e49b9..2c75f639992 100644 --- a/cmd/tcl/testworkflow-toolkit/common/combinations.go +++ b/cmd/tcl/testworkflow-toolkit/common/combinations.go @@ -75,9 +75,14 @@ func readParams(base map[string]testworkflowsv1.DynamicList, machines ...express for key, items := range base { exprStr := items.Expression if !items.Dynamic { - b, err := json.Marshal(items.Static) + statics := items.DeepCopy().Static + err := expressionstcl.FinalizeForce(&statics, machines...) if err != nil { - return nil, fmt.Errorf("%s: could not parse list of values: %s\n", key, err) + return nil, fmt.Errorf("%s: error while resolving matrix: %s", key, err) + } + b, err := json.Marshal(statics) + if err != nil { + return nil, fmt.Errorf("%s: could not parse list of values: %s", key, err) } exprStr = string(b) } diff --git a/cmd/tcl/testworkflow-toolkit/spawn/utils.go b/cmd/tcl/testworkflow-toolkit/spawn/utils.go index e6918f9150a..1aa35e41af6 100644 --- a/cmd/tcl/testworkflow-toolkit/spawn/utils.go +++ b/cmd/tcl/testworkflow-toolkit/spawn/utils.go @@ -35,6 +35,19 @@ import ( "github.com/kubeshop/testkube/pkg/tcl/testworkflowstcl/testworkflowcontroller" ) +func MapDynamicListToStringList(list []interface{}) []string { + result := make([]string, len(list)) + for i := range list { + if v, ok := list[i].(string); ok { + result[i] = v + } else { + b, _ := json.Marshal(list[i]) + result[i] = string(b) + } + } + return result +} + func ProcessTransfer(transferSrv transfer.Server, transfer []testworkflowsv1.StepParallelTransfer, machines ...expressionstcl.Machine) ([]testworkflowsv1.ContentTarball, error) { if len(transfer) == 0 { return nil, nil @@ -59,7 +72,7 @@ func ProcessTransfer(transferSrv transfer.Server, transfer []testworkflowsv1.Ste // Parse 'files' clause patterns := []string{"**/*"} if t.Files != nil && !t.Files.Dynamic { - patterns = t.Files.Static + patterns = MapDynamicListToStringList(t.Files.Static) } else if t.Files != nil && t.Files.Dynamic { patternsExpr, err := expressionstcl.EvalExpression(t.Files.Expression, machines...) if err != nil { @@ -117,7 +130,7 @@ func ProcessFetch(transferSrv transfer.Server, fetch []testworkflowsv1.StepParal // Parse 'files' clause patterns := []string{"**/*"} if t.Files != nil && !t.Files.Dynamic { - patterns = t.Files.Static + patterns = MapDynamicListToStringList(t.Files.Static) } else if t.Files != nil && t.Files.Dynamic { patternsExpr, err := expressionstcl.EvalExpression(t.Files.Expression, machines...) if err != nil { diff --git a/go.mod b/go.mod index 15812f79680..493a9d3acb2 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/kelseyhightower/envconfig v1.4.0 github.com/kubepug/kubepug v1.7.1 - github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524075851-4336c3354c4c + github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524114137-5817a6293a91 github.com/minio/minio-go/v7 v7.0.47 github.com/montanaflynn/stats v0.6.6 github.com/moogar0880/problems v0.1.1 diff --git a/go.sum b/go.sum index f704e673b79..6da8380d014 100644 --- a/go.sum +++ b/go.sum @@ -366,8 +366,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubepug/kubepug v1.7.1 h1:LKhfSxS8Y5mXs50v+3Lpyec+cogErDLcV7CMUuiaisw= github.com/kubepug/kubepug v1.7.1/go.mod h1:lv+HxD0oTFL7ZWjj0u6HKhMbbTIId3eG7aWIW0gyF8g= -github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524075851-4336c3354c4c h1:c+j/R3+qLX55ETOqQQFjg9cr/j2JPlfaF6u9DysExgk= -github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524075851-4336c3354c4c/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk= +github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524114137-5817a6293a91 h1:u9HnZ2kls2jWorcFo4T9yplbKjeu7Eq5iHRkRWtNNW4= +github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524114137-5817a6293a91/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8LFgLN4= diff --git a/pkg/tcl/expressionstcl/generic.go b/pkg/tcl/expressionstcl/generic.go index f78d11e309e..aba1af960d9 100644 --- a/pkg/tcl/expressionstcl/generic.go +++ b/pkg/tcl/expressionstcl/generic.go @@ -56,6 +56,16 @@ func clone(v reflect.Value) reflect.Value { } } return r + } else if v.Kind() == reflect.Slice { + r := reflect.MakeSlice(v.Type(), v.Len(), v.Cap()) + for i := 0; i < v.Len(); i++ { + r.Index(i).Set(clone(v.Index(i))) + } + return r + } else if v.Kind() == reflect.Interface { + r := reflect.New(v.Type()) + r.Elem().Set(v) + return r.Elem() } return v } @@ -73,7 +83,9 @@ func resolve(v reflect.Value, t tagData, m []Machine, force bool, finalize bool) if v.IsNil() { return } - ptr = v + if v.CanAddr() { + ptr = v + } v = v.Elem() } @@ -185,6 +197,8 @@ func resolve(v reflect.Value, t tagData, m []Machine, force bool, finalize bool) changed = vv != str if ptr.Kind() == reflect.String { v.SetString(vv) + } else if ptr.Kind() == reflect.Interface { + ptr.Set(reflect.ValueOf(vv)) } else { ptr.Set(reflect.ValueOf(&vv)) } @@ -208,6 +222,8 @@ func resolve(v reflect.Value, t tagData, m []Machine, force bool, finalize bool) changed = vv != str if ptr.Kind() == reflect.String { v.SetString(vv) + } else if ptr.Kind() == reflect.Interface { + ptr.Set(reflect.ValueOf(vv)) } else { instance := reflect.New(v.Type()) instance.Elem().SetString(vv) diff --git a/pkg/tcl/expressionstcl/generic_test.go b/pkg/tcl/expressionstcl/generic_test.go index c9cccb23f18..b31c6555c5a 100644 --- a/pkg/tcl/expressionstcl/generic_test.go +++ b/pkg/tcl/expressionstcl/generic_test.go @@ -66,6 +66,10 @@ type testObjWithStringEnumPointers struct { Dummy *testEnum } +type testObjInterfaced struct { + Value map[string][]interface{} `expr:"force"` +} + var testMachine = NewMachine(). Register("dummy", "test"). Register("ten", 10) @@ -266,3 +270,49 @@ func TestGenericSimplifyWithStringEnumPointers(t *testing.T) { assert.NoError(t, err) assert.Equal(t, want, got) } + +func TestGenericSimplifyArrayInterface(t *testing.T) { + got := []interface{}{"{{ 5 + 2 }}{{ 5 }}"} + err := SimplifyForce(&got) + + want := []interface{}{"75"} + + assert.NoError(t, err) + assert.Equal(t, want, got) +} + +func TestGenericSimplifyMapArrayInterface(t *testing.T) { + got := map[string][]interface{}{ + "key": {"{{ 4 + 2 }}{{ 5 }}"}, + "dummy": {"{{ 10 + 2 }}{{ 5 }}"}, + } + err := SimplifyForce(&got) + + want := map[string][]interface{}{ + "key": {"65"}, + "dummy": {"125"}, + } + + assert.NoError(t, err) + assert.Equal(t, want, got) +} + +func TestGenericSimplifyNestedWithInterfaces(t *testing.T) { + got := testObjInterfaced{ + Value: map[string][]interface{}{ + "key": {"{{ 3 + 2 }}{{ 5 }}"}, + "dummy": {"{{ 10 + 2 }}{{ 5 }}"}, + }, + } + err := Simplify(&got) + + want := testObjInterfaced{ + Value: map[string][]interface{}{ + "key": {"55"}, + "dummy": {"125"}, + }, + } + + assert.NoError(t, err) + assert.Equal(t, want, got) +} diff --git a/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go b/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go index a65f4b40fd6..fcd905197c2 100644 --- a/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go +++ b/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go @@ -777,9 +777,7 @@ func MapTarballFilePatternKubeToAPI(v testworkflowsv1.DynamicList) testkube.Test if v.Expression != "" { return testkube.TestWorkflowTarballFilePattern{Expression: v.Expression} } - return testkube.TestWorkflowTarballFilePattern{Static: common.MapSlice(v.Static, func(s string) interface{} { - return s - })} + return testkube.TestWorkflowTarballFilePattern{Static: v.Static} } func MapTarballRequestKubeToAPI(v testworkflowsv1.TarballRequest) testkube.TestWorkflowTarballRequest { From 005a4fd32a843b66443b371e5b2134d56822fd6b Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Fri, 24 May 2024 14:13:11 +0200 Subject: [PATCH 11/39] fix(testworkflows): strange duration for fatal errors (#5492) --- api/v1/testkube.yaml | 6 ++++ ..._test_workflow_independent_service_spec.go | 12 ++++---- ...test_workflow_independent_step_parallel.go | 26 ++++++++--------- .../v1/testkube/model_test_workflow_result.go | 6 ++-- .../model_test_workflow_result_extended.go | 17 ++++++++++- .../model_test_workflow_result_summary.go | 6 ++-- .../model_test_workflow_service_spec.go | 4 +-- ...del_test_workflow_step_execute_test_ref.go | 12 ++++---- ...workflow_step_execute_test_workflow_ref.go | 12 ++++---- .../model_test_workflow_step_parallel.go | 28 +++++++++---------- 10 files changed, 75 insertions(+), 54 deletions(-) diff --git a/api/v1/testkube.yaml b/api/v1/testkube.yaml index 315f725b9b1..38d185dd3d2 100644 --- a/api/v1/testkube.yaml +++ b/api/v1/testkube.yaml @@ -7657,6 +7657,9 @@ components: required: - status - predictedStatus + - durationMs + - totalDurationMs + - pausedMs TestWorkflowExecutionNotification: type: object @@ -7778,6 +7781,9 @@ components: required: - status - predictedStatus + - durationMs + - pausedMs + - totalDurationMs TestWorkflowPause: type: object diff --git a/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go b/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go index 898b3bb26f1..23099c600f7 100644 --- a/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go +++ b/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go @@ -25,12 +25,6 @@ type TestWorkflowIndependentServiceSpec struct { SecurityContext *SecurityContext `json:"securityContext,omitempty"` // volumes to mount to the container VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` - Count *BoxedString `json:"count,omitempty"` - MaxCount *BoxedString `json:"maxCount,omitempty"` - // matrix of parameters to spawn instances - Matrix map[string]interface{} `json:"matrix,omitempty"` - // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` // maximum time until reaching readiness Timeout string `json:"timeout,omitempty"` // list of files to send to parallel steps @@ -40,4 +34,10 @@ type TestWorkflowIndependentServiceSpec struct { Logs *BoxedString `json:"logs,omitempty"` RestartPolicy string `json:"restartPolicy,omitempty"` ReadinessProbe *Probe `json:"readinessProbe,omitempty"` + Count *BoxedString `json:"count,omitempty"` + MaxCount *BoxedString `json:"maxCount,omitempty"` + // matrix of parameters to spawn instances + Matrix map[string]interface{} `json:"matrix,omitempty"` + // parameters that should be distributed across sharded instances + Shards map[string]interface{} `json:"shards,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go b/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go index c1ac53328aa..3ca736332e0 100644 --- a/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go +++ b/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go @@ -28,10 +28,19 @@ type TestWorkflowIndependentStepParallel struct { // delay before the step Delay string `json:"delay,omitempty"` // script to run in a default shell for the container - Shell string `json:"shell,omitempty"` - Run *TestWorkflowStepRun `json:"run,omitempty"` - Execute *TestWorkflowStepExecute `json:"execute,omitempty"` - Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` + Shell string `json:"shell,omitempty"` + Run *TestWorkflowStepRun `json:"run,omitempty"` + Execute *TestWorkflowStepExecute `json:"execute,omitempty"` + Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` + // how many resources could be scheduled in parallel + Parallelism int32 `json:"parallelism,omitempty"` + // worker description to display + Description string `json:"description,omitempty"` + Logs *BoxedString `json:"logs,omitempty"` + // list of files to send to parallel steps + Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` + // list of files to fetch from parallel steps + Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` Config map[string]TestWorkflowParameterSchema `json:"config,omitempty"` Content *TestWorkflowContent `json:"content,omitempty"` Services map[string]TestWorkflowIndependentServiceSpec `json:"services,omitempty"` @@ -42,13 +51,4 @@ type TestWorkflowIndependentStepParallel struct { Steps []TestWorkflowIndependentStep `json:"steps,omitempty"` After []TestWorkflowIndependentStep `json:"after,omitempty"` Events []TestWorkflowEvent `json:"events,omitempty"` - // how many resources could be scheduled in parallel - Parallelism int32 `json:"parallelism,omitempty"` - // worker description to display - Description string `json:"description,omitempty"` - Logs *BoxedString `json:"logs,omitempty"` - // list of files to send to parallel steps - Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` - // list of files to fetch from parallel steps - Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_result.go b/pkg/api/v1/testkube/model_test_workflow_result.go index e468c0936e0..b1834cfc3d4 100644 --- a/pkg/api/v1/testkube/model_test_workflow_result.go +++ b/pkg/api/v1/testkube/model_test_workflow_result.go @@ -27,11 +27,11 @@ type TestWorkflowResult struct { // Go-formatted (human-readable) total duration (incl. pause) TotalDuration string `json:"totalDuration,omitempty"` // Duration in milliseconds - DurationMs int32 `json:"durationMs,omitempty"` + DurationMs int32 `json:"durationMs"` // Pause duration in milliseconds - PausedMs int32 `json:"pausedMs,omitempty"` + PausedMs int32 `json:"pausedMs"` // Total duration in milliseconds (incl. pause) - TotalDurationMs int32 `json:"totalDurationMs,omitempty"` + TotalDurationMs int32 `json:"totalDurationMs"` Pauses []TestWorkflowPause `json:"pauses,omitempty"` Initialization *TestWorkflowStepResult `json:"initialization,omitempty"` Steps map[string]TestWorkflowStepResult `json:"steps,omitempty"` diff --git a/pkg/api/v1/testkube/model_test_workflow_result_extended.go b/pkg/api/v1/testkube/model_test_workflow_result_extended.go index fdaf86ab521..7dc4449ff32 100644 --- a/pkg/api/v1/testkube/model_test_workflow_result_extended.go +++ b/pkg/api/v1/testkube/model_test_workflow_result_extended.go @@ -81,6 +81,12 @@ func (r *TestWorkflowResult) Fatal(err error, aborted bool, ts time.Time) { if aborted { r.Status = common.Ptr(ABORTED_TestWorkflowStatus) } + if r.QueuedAt.IsZero() { + r.QueuedAt = ts.UTC() + } + if r.StartedAt.IsZero() { + r.StartedAt = ts.UTC() + } if r.FinishedAt.IsZero() { r.FinishedAt = ts.UTC() } @@ -156,10 +162,19 @@ func (r *TestWorkflowResult) RecomputeDuration() { if resumedAt.IsZero() { resumedAt = r.FinishedAt } - r.PausedMs += int32(resumedAt.Sub(p.PausedAt).Milliseconds()) + milli := int32(resumedAt.Sub(p.PausedAt).Milliseconds()) + if milli > 0 { + r.PausedMs += milli + } } totalDuration := r.FinishedAt.Sub(r.QueuedAt) duration := totalDuration - time.Duration(1e3*r.PausedMs) + if totalDuration < 0 { + totalDuration = time.Duration(0) + } + if duration < 0 { + duration = time.Duration(0) + } r.DurationMs = int32(duration.Milliseconds()) r.Duration = duration.Round(time.Millisecond).String() r.TotalDurationMs = int32(totalDuration.Milliseconds()) diff --git a/pkg/api/v1/testkube/model_test_workflow_result_summary.go b/pkg/api/v1/testkube/model_test_workflow_result_summary.go index c62159e72db..133feeeaef8 100644 --- a/pkg/api/v1/testkube/model_test_workflow_result_summary.go +++ b/pkg/api/v1/testkube/model_test_workflow_result_summary.go @@ -27,9 +27,9 @@ type TestWorkflowResultSummary struct { // Go-formatted (human-readable) duration (incl. pause) TotalDuration string `json:"totalDuration,omitempty"` // Duration in milliseconds - DurationMs int32 `json:"durationMs,omitempty"` + DurationMs int32 `json:"durationMs"` // Duration in milliseconds (incl. pause) - TotalDurationMs int32 `json:"totalDurationMs,omitempty"` + TotalDurationMs int32 `json:"totalDurationMs"` // Pause duration in milliseconds - PausedMs int32 `json:"pausedMs,omitempty"` + PausedMs int32 `json:"pausedMs"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_service_spec.go b/pkg/api/v1/testkube/model_test_workflow_service_spec.go index 9311e16cca1..07f69c54f79 100644 --- a/pkg/api/v1/testkube/model_test_workflow_service_spec.go +++ b/pkg/api/v1/testkube/model_test_workflow_service_spec.go @@ -34,11 +34,11 @@ type TestWorkflowServiceSpec struct { Logs *BoxedString `json:"logs,omitempty"` RestartPolicy string `json:"restartPolicy,omitempty"` ReadinessProbe *Probe `json:"readinessProbe,omitempty"` + Use []TestWorkflowTemplateRef `json:"use,omitempty"` Count *BoxedString `json:"count,omitempty"` MaxCount *BoxedString `json:"maxCount,omitempty"` // matrix of parameters to spawn instances Matrix map[string]interface{} `json:"matrix,omitempty"` // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` - Use []TestWorkflowTemplateRef `json:"use,omitempty"` + Shards map[string]interface{} `json:"shards,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go index 974209ed35b..d9943d51ddc 100644 --- a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go +++ b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go @@ -10,16 +10,16 @@ package testkube type TestWorkflowStepExecuteTestRef struct { - Count *BoxedString `json:"count,omitempty"` - MaxCount *BoxedString `json:"maxCount,omitempty"` - // matrix of parameters to spawn instances - Matrix map[string]interface{} `json:"matrix,omitempty"` - // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` // test name to schedule Name string `json:"name,omitempty"` // test execution description to display Description string `json:"description,omitempty"` + Count *BoxedString `json:"count,omitempty"` + MaxCount *BoxedString `json:"maxCount,omitempty"` ExecutionRequest *TestWorkflowStepExecuteTestExecutionRequest `json:"executionRequest,omitempty"` Tarball map[string]TestWorkflowTarballRequest `json:"tarball,omitempty"` + // matrix of parameters to spawn instances + Matrix map[string]interface{} `json:"matrix,omitempty"` + // parameters that should be distributed across sharded instances + Shards map[string]interface{} `json:"shards,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go index f2e131a22e2..c2bcd5b1d1f 100644 --- a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go +++ b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go @@ -10,12 +10,6 @@ package testkube type TestWorkflowStepExecuteTestWorkflowRef struct { - Count *BoxedString `json:"count,omitempty"` - MaxCount *BoxedString `json:"maxCount,omitempty"` - // matrix of parameters to spawn instances - Matrix map[string]interface{} `json:"matrix,omitempty"` - // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` // TestWorkflow name to include Name string `json:"name,omitempty"` // TestWorkflow execution description to display @@ -24,4 +18,10 @@ type TestWorkflowStepExecuteTestWorkflowRef struct { ExecutionName string `json:"executionName,omitempty"` Tarball map[string]TestWorkflowTarballRequest `json:"tarball,omitempty"` Config map[string]string `json:"config,omitempty"` + Count *BoxedString `json:"count,omitempty"` + MaxCount *BoxedString `json:"maxCount,omitempty"` + // matrix of parameters to spawn instances + Matrix map[string]interface{} `json:"matrix,omitempty"` + // parameters that should be distributed across sharded instances + Shards map[string]interface{} `json:"shards,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_step_parallel.go b/pkg/api/v1/testkube/model_test_workflow_step_parallel.go index fbea0caff01..d8b4de8e7ff 100644 --- a/pkg/api/v1/testkube/model_test_workflow_step_parallel.go +++ b/pkg/api/v1/testkube/model_test_workflow_step_parallel.go @@ -28,10 +28,20 @@ type TestWorkflowStepParallel struct { // delay before the step Delay string `json:"delay,omitempty"` // script to run in a default shell for the container - Shell string `json:"shell,omitempty"` - Run *TestWorkflowStepRun `json:"run,omitempty"` - Execute *TestWorkflowStepExecute `json:"execute,omitempty"` - Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` + Shell string `json:"shell,omitempty"` + Run *TestWorkflowStepRun `json:"run,omitempty"` + Execute *TestWorkflowStepExecute `json:"execute,omitempty"` + Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` + // how many resources could be scheduled in parallel + Parallelism int32 `json:"parallelism,omitempty"` + // worker description to display + Description string `json:"description,omitempty"` + Logs *BoxedString `json:"logs,omitempty"` + // list of files to send to parallel steps + Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` + // list of files to fetch from parallel steps + Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` + Template *TestWorkflowTemplateRef `json:"template,omitempty"` Use []TestWorkflowTemplateRef `json:"use,omitempty"` Config map[string]TestWorkflowParameterSchema `json:"config,omitempty"` Content *TestWorkflowContent `json:"content,omitempty"` @@ -43,14 +53,4 @@ type TestWorkflowStepParallel struct { Steps []TestWorkflowStep `json:"steps,omitempty"` After []TestWorkflowStep `json:"after,omitempty"` Events []TestWorkflowEvent `json:"events,omitempty"` - // how many resources could be scheduled in parallel - Parallelism int32 `json:"parallelism,omitempty"` - // worker description to display - Description string `json:"description,omitempty"` - Logs *BoxedString `json:"logs,omitempty"` - // list of files to send to parallel steps - Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` - // list of files to fetch from parallel steps - Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` - Template *TestWorkflowTemplateRef `json:"template,omitempty"` } From a9d65892036b7d2a7fc23f9d24da34781e0bb4ef Mon Sep 17 00:00:00 2001 From: nicufk Date: Fri, 24 May 2024 16:57:59 +0300 Subject: [PATCH 12/39] fix: add email to the on prem install telemetry (#5495) --- cmd/kubectl-testkube/commands/dashboard.go | 26 ++++++-------- pkg/k8sclient/k8sclient.go | 8 ++++- pkg/telemetry/license.go | 41 ++++++++++++++++++++++ pkg/telemetry/payload.go | 2 ++ pkg/telemetry/sender_sio.go | 3 ++ pkg/telemetry/telemetry.go | 1 + 6 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 pkg/telemetry/license.go diff --git a/cmd/kubectl-testkube/commands/dashboard.go b/cmd/kubectl-testkube/commands/dashboard.go index a6bd554a3f4..26194e024db 100644 --- a/cmd/kubectl-testkube/commands/dashboard.go +++ b/cmd/kubectl-testkube/commands/dashboard.go @@ -64,7 +64,6 @@ func openCloudDashboard(cfg config.Data) { } func openOnPremDashboard(cmd *cobra.Command, cfg config.Data, verbose bool, license string) { - var errs []error uiLocalPort, err := getDashboardLocalPort(config.EnterpriseApiForwardingPort) ui.PrintOnError("getting an ui forwarding available port", err) uri := fmt.Sprintf("http://localhost:%d", uiLocalPort) @@ -72,31 +71,29 @@ func openOnPremDashboard(cmd *cobra.Command, cfg config.Data, verbose bool, lice ctx, cancel := context.WithCancel(context.Background()) err = k8sclient.PortForward(ctx, cfg.Namespace, config.EnterpriseApiName, config.EnterpriseApiPort, config.EnterpriseApiForwardingPort, verbose) if err != nil { - errs = append(errs, err) + sendErrTelemetry(cmd, cfg, "port_forward", license, "port forwarding api", err) } - ui.PrintOnError("port forwarding api", err) + ui.ExitOnError("port forwarding api", err) err = k8sclient.PortForward(ctx, cfg.Namespace, config.EnterpriseUiName, config.EnterpriseUiPort, uiLocalPort, verbose) if err != nil { - errs = append(errs, err) + sendErrTelemetry(cmd, cfg, "port_forward", license, "port forwarding ui", err) } - ui.PrintOnError("port forwarding ui", err) + ui.ExitOnError("port forwarding ui", err) err = k8sclient.PortForward(ctx, cfg.Namespace, config.EnterpriseDexName, config.EnterpriseDexPort, config.EnterpriseDexForwardingPort, verbose) if err != nil { - errs = append(errs, err) + sendErrTelemetry(cmd, cfg, "port_forward", license, "port forwarding dex", err) } - ui.PrintOnError("port forwarding dex", err) + ui.ExitOnError("port forwarding dex", err) err = open.Run(uri) if err != nil { - errs = append(errs, err) - } - if len(errs) > 0 { - retErr := errors.Join(errs...) - sendErrTelemetry(cmd, cfg, "open_dashboard", license, "opening dashboard", retErr) - } else { - sendTelemetry(cmd, cfg, license, "dashbboard opened successfully") + sendErrTelemetry(cmd, cfg, "open_dashboard", license, "opening dashboard", err) } + ui.ExitOnError("opening dashboard in browser", err) + + sendTelemetry(cmd, cfg, license, "dashbboard opened successfully") + c := make(chan os.Signal, 1) signal.Notify(c, os.Interrupt, syscall.SIGTERM) @@ -104,7 +101,6 @@ func openOnPremDashboard(cmd *cobra.Command, cfg config.Data, verbose bool, lice ui.Success("Port forwarding the necessary services, hit Ctrl+c (or Cmd+c) to stop") <-c cancel() - } func localPortCheck(port int) error { diff --git a/pkg/k8sclient/k8sclient.go b/pkg/k8sclient/k8sclient.go index 3b156eeed28..d40d988e89a 100644 --- a/pkg/k8sclient/k8sclient.go +++ b/pkg/k8sclient/k8sclient.go @@ -364,12 +364,18 @@ func PortForward(ctx context.Context, namespace, serviceName string, servicePort } go func() { + defer func() { + if r := recover(); r != nil { + err = errors.New("port forwarding failed:" + fmt.Sprint(r)) + readyChan <- struct{}{} + } + }() if err = forwarder.ForwardPorts(); err != nil { log.Errorf(ctx, "port forwarding failed: %v", err) } }() <-readyChan - return nil + return err } func IsPodOfServiceRunning(ctx context.Context, namespace, serviceName string) (bool, error) { diff --git a/pkg/telemetry/license.go b/pkg/telemetry/license.go new file mode 100644 index 00000000000..f5b87f982dd --- /dev/null +++ b/pkg/telemetry/license.go @@ -0,0 +1,41 @@ +package telemetry + +import ( + "bytes" + "encoding/json" + "net/http" +) + +const ( + LicenseEndpoint = "https://license.testkube.io/owner" //this is default but it can be set using ldflag -X github.com/kubeshop/testkube/pkg/telemetry.LicenseEndpoint=https://license.localhost +) + +type EmailResponse struct { + Owner struct { + Email string `json:"email"` + } `json:"owner"` +} +type EmailRequest struct { + License string `json:"license"` +} + +// GetEmail returns email +func GetEmail(license string) string { + if LicenseEndpoint != "" { + payload := EmailRequest{License: license} + jsonPayload, _ := json.Marshal(payload) + resp, err := http.Post(LicenseEndpoint, "application/json", bytes.NewBuffer(jsonPayload)) + if err != nil { + return "" + } + defer resp.Body.Close() + + var emailResponse EmailResponse + err = json.NewDecoder(resp.Body).Decode(&emailResponse) + if err != nil { + return "" + } + return emailResponse.Owner.Email + } + return "" +} diff --git a/pkg/telemetry/payload.go b/pkg/telemetry/payload.go index a906a1e7d24..ece02f9a3a1 100644 --- a/pkg/telemetry/payload.go +++ b/pkg/telemetry/payload.go @@ -40,6 +40,7 @@ type Params struct { TestWorkflowKubeshopGitURI bool `json:"test_workflow_kubeshop_git_uri,omitempty"` License string `json:"license,omitempty"` Step string `json:"step,omitempty"` + Email string `json:"email,omitempty"` } type Event struct { @@ -141,6 +142,7 @@ func NewCLIWithLicensePayload(context RunContext, id, name, version, category, c ClusterType: clusterType, CliContext: GetCliRunContext(), License: license, + Email: GetEmail(license), Step: step, }, }}, diff --git a/pkg/telemetry/sender_sio.go b/pkg/telemetry/sender_sio.go index ec6fdec454d..516f6668ea5 100644 --- a/pkg/telemetry/sender_sio.go +++ b/pkg/telemetry/sender_sio.go @@ -105,6 +105,9 @@ func mapProperties(params Params) analytics.Properties { if params.Step != "" { properties = properties.Set("step", params.Step) } + if params.Email != "" { + properties = properties.Set("email", params.Email) + } if params.DataSource != "" { properties = properties.Set("dataSource", params.DataSource) diff --git a/pkg/telemetry/telemetry.go b/pkg/telemetry/telemetry.go index 8fe388da80f..1da43514e22 100644 --- a/pkg/telemetry/telemetry.go +++ b/pkg/telemetry/telemetry.go @@ -83,6 +83,7 @@ func SendCmdErrorEventWithLicense(cmd *cobra.Command, version, errType, errorSta ErrorStackTrace: errorStackTrace, License: license, Step: step, + Email: GetEmail(license), }, }}, } From 1d82a6f217da478ab8b0937303eb314d4189ebb3 Mon Sep 17 00:00:00 2001 From: Lilla Vass Date: Fri, 24 May 2024 17:45:13 +0200 Subject: [PATCH 13/39] fix: fix semantic errors and generate openapi files (#5497) --- api/v1/testkube.yaml | 8 ++++-- ..._test_workflow_independent_service_spec.go | 12 ++++---- ...test_workflow_independent_step_parallel.go | 26 ++++++++--------- .../model_test_workflow_service_spec.go | 4 +-- ...del_test_workflow_step_execute_test_ref.go | 12 ++++---- ...workflow_step_execute_test_workflow_ref.go | 12 ++++---- .../model_test_workflow_step_parallel.go | 28 +++++++++---------- 7 files changed, 52 insertions(+), 50 deletions(-) diff --git a/api/v1/testkube.yaml b/api/v1/testkube.yaml index 38d185dd3d2..0ae84cdfd1f 100644 --- a/api/v1/testkube.yaml +++ b/api/v1/testkube.yaml @@ -3574,6 +3574,8 @@ paths: - test-workflows - api - pro + parameters: + - $ref: "#/components/parameters/ID" summary: Execute test workflow description: Execute test workflow in the kubernetes cluster operationId: executeTestWorkflow @@ -3845,7 +3847,7 @@ paths: /test-workflow-executions/{executionID}/artifacts: get: parameters: - - $ref: "#/components/parameters/ID" + - $ref: "#/components/parameters/executionID" tags: - test-workflows - artifacts @@ -3892,7 +3894,7 @@ paths: /test-workflow-executions/{executionID}/artifacts/{filename}: get: parameters: - - $ref: "#/components/parameters/ID" + - $ref: "#/components/parameters/executionID" - $ref: "#/components/parameters/Filename" tags: - test-workflows @@ -3939,7 +3941,7 @@ paths: /test-workflow-executions/{executionID}/artifact-archive: get: parameters: - - $ref: "#/components/parameters/ID" + - $ref: "#/components/parameters/executionID" - $ref: "#/components/parameters/Mask" tags: - test-workflows diff --git a/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go b/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go index 23099c600f7..898b3bb26f1 100644 --- a/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go +++ b/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go @@ -25,6 +25,12 @@ type TestWorkflowIndependentServiceSpec struct { SecurityContext *SecurityContext `json:"securityContext,omitempty"` // volumes to mount to the container VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` + Count *BoxedString `json:"count,omitempty"` + MaxCount *BoxedString `json:"maxCount,omitempty"` + // matrix of parameters to spawn instances + Matrix map[string]interface{} `json:"matrix,omitempty"` + // parameters that should be distributed across sharded instances + Shards map[string]interface{} `json:"shards,omitempty"` // maximum time until reaching readiness Timeout string `json:"timeout,omitempty"` // list of files to send to parallel steps @@ -34,10 +40,4 @@ type TestWorkflowIndependentServiceSpec struct { Logs *BoxedString `json:"logs,omitempty"` RestartPolicy string `json:"restartPolicy,omitempty"` ReadinessProbe *Probe `json:"readinessProbe,omitempty"` - Count *BoxedString `json:"count,omitempty"` - MaxCount *BoxedString `json:"maxCount,omitempty"` - // matrix of parameters to spawn instances - Matrix map[string]interface{} `json:"matrix,omitempty"` - // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go b/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go index 3ca736332e0..c1ac53328aa 100644 --- a/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go +++ b/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go @@ -28,19 +28,10 @@ type TestWorkflowIndependentStepParallel struct { // delay before the step Delay string `json:"delay,omitempty"` // script to run in a default shell for the container - Shell string `json:"shell,omitempty"` - Run *TestWorkflowStepRun `json:"run,omitempty"` - Execute *TestWorkflowStepExecute `json:"execute,omitempty"` - Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` - // how many resources could be scheduled in parallel - Parallelism int32 `json:"parallelism,omitempty"` - // worker description to display - Description string `json:"description,omitempty"` - Logs *BoxedString `json:"logs,omitempty"` - // list of files to send to parallel steps - Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` - // list of files to fetch from parallel steps - Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` + Shell string `json:"shell,omitempty"` + Run *TestWorkflowStepRun `json:"run,omitempty"` + Execute *TestWorkflowStepExecute `json:"execute,omitempty"` + Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` Config map[string]TestWorkflowParameterSchema `json:"config,omitempty"` Content *TestWorkflowContent `json:"content,omitempty"` Services map[string]TestWorkflowIndependentServiceSpec `json:"services,omitempty"` @@ -51,4 +42,13 @@ type TestWorkflowIndependentStepParallel struct { Steps []TestWorkflowIndependentStep `json:"steps,omitempty"` After []TestWorkflowIndependentStep `json:"after,omitempty"` Events []TestWorkflowEvent `json:"events,omitempty"` + // how many resources could be scheduled in parallel + Parallelism int32 `json:"parallelism,omitempty"` + // worker description to display + Description string `json:"description,omitempty"` + Logs *BoxedString `json:"logs,omitempty"` + // list of files to send to parallel steps + Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` + // list of files to fetch from parallel steps + Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_service_spec.go b/pkg/api/v1/testkube/model_test_workflow_service_spec.go index 07f69c54f79..9311e16cca1 100644 --- a/pkg/api/v1/testkube/model_test_workflow_service_spec.go +++ b/pkg/api/v1/testkube/model_test_workflow_service_spec.go @@ -34,11 +34,11 @@ type TestWorkflowServiceSpec struct { Logs *BoxedString `json:"logs,omitempty"` RestartPolicy string `json:"restartPolicy,omitempty"` ReadinessProbe *Probe `json:"readinessProbe,omitempty"` - Use []TestWorkflowTemplateRef `json:"use,omitempty"` Count *BoxedString `json:"count,omitempty"` MaxCount *BoxedString `json:"maxCount,omitempty"` // matrix of parameters to spawn instances Matrix map[string]interface{} `json:"matrix,omitempty"` // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` + Shards map[string]interface{} `json:"shards,omitempty"` + Use []TestWorkflowTemplateRef `json:"use,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go index d9943d51ddc..974209ed35b 100644 --- a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go +++ b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go @@ -10,16 +10,16 @@ package testkube type TestWorkflowStepExecuteTestRef struct { + Count *BoxedString `json:"count,omitempty"` + MaxCount *BoxedString `json:"maxCount,omitempty"` + // matrix of parameters to spawn instances + Matrix map[string]interface{} `json:"matrix,omitempty"` + // parameters that should be distributed across sharded instances + Shards map[string]interface{} `json:"shards,omitempty"` // test name to schedule Name string `json:"name,omitempty"` // test execution description to display Description string `json:"description,omitempty"` - Count *BoxedString `json:"count,omitempty"` - MaxCount *BoxedString `json:"maxCount,omitempty"` ExecutionRequest *TestWorkflowStepExecuteTestExecutionRequest `json:"executionRequest,omitempty"` Tarball map[string]TestWorkflowTarballRequest `json:"tarball,omitempty"` - // matrix of parameters to spawn instances - Matrix map[string]interface{} `json:"matrix,omitempty"` - // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go index c2bcd5b1d1f..f2e131a22e2 100644 --- a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go +++ b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go @@ -10,6 +10,12 @@ package testkube type TestWorkflowStepExecuteTestWorkflowRef struct { + Count *BoxedString `json:"count,omitempty"` + MaxCount *BoxedString `json:"maxCount,omitempty"` + // matrix of parameters to spawn instances + Matrix map[string]interface{} `json:"matrix,omitempty"` + // parameters that should be distributed across sharded instances + Shards map[string]interface{} `json:"shards,omitempty"` // TestWorkflow name to include Name string `json:"name,omitempty"` // TestWorkflow execution description to display @@ -18,10 +24,4 @@ type TestWorkflowStepExecuteTestWorkflowRef struct { ExecutionName string `json:"executionName,omitempty"` Tarball map[string]TestWorkflowTarballRequest `json:"tarball,omitempty"` Config map[string]string `json:"config,omitempty"` - Count *BoxedString `json:"count,omitempty"` - MaxCount *BoxedString `json:"maxCount,omitempty"` - // matrix of parameters to spawn instances - Matrix map[string]interface{} `json:"matrix,omitempty"` - // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_step_parallel.go b/pkg/api/v1/testkube/model_test_workflow_step_parallel.go index d8b4de8e7ff..fbea0caff01 100644 --- a/pkg/api/v1/testkube/model_test_workflow_step_parallel.go +++ b/pkg/api/v1/testkube/model_test_workflow_step_parallel.go @@ -28,20 +28,10 @@ type TestWorkflowStepParallel struct { // delay before the step Delay string `json:"delay,omitempty"` // script to run in a default shell for the container - Shell string `json:"shell,omitempty"` - Run *TestWorkflowStepRun `json:"run,omitempty"` - Execute *TestWorkflowStepExecute `json:"execute,omitempty"` - Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` - // how many resources could be scheduled in parallel - Parallelism int32 `json:"parallelism,omitempty"` - // worker description to display - Description string `json:"description,omitempty"` - Logs *BoxedString `json:"logs,omitempty"` - // list of files to send to parallel steps - Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` - // list of files to fetch from parallel steps - Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` - Template *TestWorkflowTemplateRef `json:"template,omitempty"` + Shell string `json:"shell,omitempty"` + Run *TestWorkflowStepRun `json:"run,omitempty"` + Execute *TestWorkflowStepExecute `json:"execute,omitempty"` + Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` Use []TestWorkflowTemplateRef `json:"use,omitempty"` Config map[string]TestWorkflowParameterSchema `json:"config,omitempty"` Content *TestWorkflowContent `json:"content,omitempty"` @@ -53,4 +43,14 @@ type TestWorkflowStepParallel struct { Steps []TestWorkflowStep `json:"steps,omitempty"` After []TestWorkflowStep `json:"after,omitempty"` Events []TestWorkflowEvent `json:"events,omitempty"` + // how many resources could be scheduled in parallel + Parallelism int32 `json:"parallelism,omitempty"` + // worker description to display + Description string `json:"description,omitempty"` + Logs *BoxedString `json:"logs,omitempty"` + // list of files to send to parallel steps + Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` + // list of files to fetch from parallel steps + Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` + Template *TestWorkflowTemplateRef `json:"template,omitempty"` } From d219354996cc75555005c1ef1dcc438375568d6d Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Wed, 17 Apr 2024 10:33:07 -0700 Subject: [PATCH 14/39] Bump Go to 1.22 Signed-off-by: Luca Comellini --- .github/workflows/codeql-analysis.yml | 4 +- .../docker-build-api-executors-tag.yaml | 23 ++- .github/workflows/docker-build-develop.yaml | 21 ++- .github/workflows/docker-build-release.yaml | 27 ++- .github/workflows/lint.yaml | 2 +- .github/workflows/release-dev-log-server.yaml | 2 +- .../workflows/release-dev-log-sidecar.yaml | 2 +- .github/workflows/release-dev.yaml | 4 +- .github/workflows/release-log-server.yaml | 2 +- .github/workflows/release-log-sidecar.yaml | 2 +- .github/workflows/release.yaml | 4 +- .github/workflows/test.yaml | 4 +- cmd/debug-server/Dockerfile | 4 +- .../executor/ginkgo/build/agent/Dockerfile | 2 +- contrib/executor/k6/build/agent/Dockerfile | 2 +- go.mod | 155 +++++++++--------- go.sum | 141 +++++++--------- 17 files changed, 187 insertions(+), 214 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 289a4e48daa..70249dc679c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -26,7 +26,7 @@ on: - 'cmd/**' - 'pkg/**' - 'internal/**' - - 'contrib/**' + - 'contrib/**' schedule: - cron: '00 12 * * 1-5' @@ -63,7 +63,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Get Go environment id: go-env diff --git a/.github/workflows/docker-build-api-executors-tag.yaml b/.github/workflows/docker-build-api-executors-tag.yaml index 0259327fd58..6492b05c80e 100644 --- a/.github/workflows/docker-build-api-executors-tag.yaml +++ b/.github/workflows/docker-build-api-executors-tag.yaml @@ -7,7 +7,6 @@ on: env: ALPINE_IMAGE: alpine:3.19.0 BUSYBOX_IMAGE: busybox:1.36.1-musl - GO_VERSION: 1.21.5 permissions: id-token: write # needed for keyless signing with cosign @@ -32,7 +31,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -99,7 +98,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -155,7 +154,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -237,7 +236,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -308,7 +307,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -376,7 +375,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -443,7 +442,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Docker Cache @@ -501,7 +500,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -569,7 +568,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -648,7 +647,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -849,7 +848,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache diff --git a/.github/workflows/docker-build-develop.yaml b/.github/workflows/docker-build-develop.yaml index 6551912f497..1ac2fdb1b78 100644 --- a/.github/workflows/docker-build-develop.yaml +++ b/.github/workflows/docker-build-develop.yaml @@ -8,7 +8,6 @@ on: env: ALPINE_IMAGE: alpine:3.19.0 BUSYBOX_IMAGE: busybox:1.36.1-musl - GO_VERSION: 1.21.5 jobs: api: @@ -24,7 +23,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -82,7 +81,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -140,7 +139,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -209,7 +208,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -271,7 +270,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -330,7 +329,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -432,7 +431,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -498,7 +497,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -557,7 +556,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -615,7 +614,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache diff --git a/.github/workflows/docker-build-release.yaml b/.github/workflows/docker-build-release.yaml index 9a44eb91476..db480a55e64 100644 --- a/.github/workflows/docker-build-release.yaml +++ b/.github/workflows/docker-build-release.yaml @@ -9,7 +9,6 @@ on: env: ALPINE_IMAGE: alpine:3.19.0 BUSYBOX_IMAGE: busybox:1.36.1-musl - GO_VERSION: 1.21.5 jobs: api: @@ -25,7 +24,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -83,7 +82,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -141,7 +140,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -204,7 +203,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Go Cache uses: actions/cache@v4 @@ -265,7 +264,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Go Cache uses: actions/cache@v4 @@ -325,7 +324,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -381,7 +380,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -433,7 +432,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -521,7 +520,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -573,7 +572,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -625,7 +624,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -676,7 +675,7 @@ jobs: - name: Set-up Go uses: actions/setup-go@v5 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false - name: Go Cache @@ -795,4 +794,4 @@ jobs: token: ${{ secrets.CI_BOT_TOKEN }} repository: kubeshop/helm-charts event-type: trigger-workflow-api-release - client-payload: '{"image_tag_api": "${{ steps.github_sha.outputs.sha_short }}"}' \ No newline at end of file + client-payload: '{"image_tag_api": "${{ steps.github_sha.outputs.sha_short }}"}' diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index cf3cb2a9b3d..29eb88fa709 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -34,7 +34,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Go Cache uses: actions/cache@v4 diff --git a/.github/workflows/release-dev-log-server.yaml b/.github/workflows/release-dev-log-server.yaml index 178ee54c925..24cd298a4a3 100644 --- a/.github/workflows/release-dev-log-server.yaml +++ b/.github/workflows/release-dev-log-server.yaml @@ -33,7 +33,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Go Cache uses: actions/cache@v4 diff --git a/.github/workflows/release-dev-log-sidecar.yaml b/.github/workflows/release-dev-log-sidecar.yaml index a26288d5057..5915190b21c 100644 --- a/.github/workflows/release-dev-log-sidecar.yaml +++ b/.github/workflows/release-dev-log-sidecar.yaml @@ -33,7 +33,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Go Cache uses: actions/cache@v4 diff --git a/.github/workflows/release-dev.yaml b/.github/workflows/release-dev.yaml index 55c0330d27f..63e31e7f9b6 100644 --- a/.github/workflows/release-dev.yaml +++ b/.github/workflows/release-dev.yaml @@ -44,7 +44,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Go Cache uses: actions/cache@v4 @@ -154,7 +154,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Go Cache uses: actions/cache@v4 with: diff --git a/.github/workflows/release-log-server.yaml b/.github/workflows/release-log-server.yaml index ad03c2d370f..5d8fb7eed6c 100644 --- a/.github/workflows/release-log-server.yaml +++ b/.github/workflows/release-log-server.yaml @@ -36,7 +36,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Go Cache uses: actions/cache@v4 diff --git a/.github/workflows/release-log-sidecar.yaml b/.github/workflows/release-log-sidecar.yaml index e0f1594ded6..1220c3f80e4 100644 --- a/.github/workflows/release-log-sidecar.yaml +++ b/.github/workflows/release-log-sidecar.yaml @@ -36,7 +36,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Go Cache uses: actions/cache@v4 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ab76bb33b35..e4ed72bb46f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -45,7 +45,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Go Cache uses: actions/cache@v4 @@ -144,7 +144,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Go Cache uses: actions/cache@v4 with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3f6f3935349..e8317cfa3d8 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,7 +20,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Setup gotestsum run: go install gotest.tools/gotestsum@latest @@ -91,7 +91,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.21 + go-version: stable - name: Set up Java@11 uses: actions/setup-java@v4 diff --git a/cmd/debug-server/Dockerfile b/cmd/debug-server/Dockerfile index d1cc77d453c..272782d8bc7 100644 --- a/cmd/debug-server/Dockerfile +++ b/cmd/debug-server/Dockerfile @@ -1,8 +1,8 @@ # syntax=docker/dockerfile:1 -FROM golang:1.21 +FROM golang:1.22 WORKDIR /build COPY . . -ENV CGO_ENABLED=0 +ENV CGO_ENABLED=0 ENV GOOS=linux RUN go build -o /app main.go diff --git a/contrib/executor/ginkgo/build/agent/Dockerfile b/contrib/executor/ginkgo/build/agent/Dockerfile index 0bd1fa0e62c..d584e0f8fb1 100644 --- a/contrib/executor/ginkgo/build/agent/Dockerfile +++ b/contrib/executor/ginkgo/build/agent/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM golang:1.21-alpine as base +FROM golang:1.22-alpine as base RUN apk update; RUN go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo diff --git a/contrib/executor/k6/build/agent/Dockerfile b/contrib/executor/k6/build/agent/Dockerfile index 1216f086788..2f5f8a40e85 100644 --- a/contrib/executor/k6/build/agent/Dockerfile +++ b/contrib/executor/k6/build/agent/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21 as builder +FROM golang:1.22 as builder # # build k6 0.36.0 with prometheus support ENV K6_VERSION=v0.48.0 RUN go install go.k6.io/xk6/cmd/xk6@v0.10.0 && xk6 build $K6_VERSION --with github.com/grafana/xk6-output-prometheus-remote@latest diff --git a/go.mod b/go.mod index 493a9d3acb2..c7821f35ce7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/kubeshop/testkube -go 1.21 +go 1.22.3 require ( github.com/99designs/gqlgen v0.17.27 @@ -13,6 +13,7 @@ require ( github.com/coreos/go-oidc v2.2.1+incompatible github.com/creasty/defaults v1.7.0 github.com/denisbrodbeck/machineid v1.0.1 + github.com/dustin/go-humanize v1.0.1 github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0 github.com/fasthttp/websocket v1.5.0 github.com/fluxcd/pkg/apis/event v0.2.0 @@ -22,6 +23,8 @@ require ( github.com/gofiber/fiber/v2 v2.52.1 github.com/gofiber/websocket/v2 v2.1.1 github.com/golang/mock v1.6.0 + github.com/google/go-cmp v0.6.0 + github.com/google/uuid v1.5.0 github.com/gookit/color v1.5.4 github.com/gorilla/websocket v1.5.0 github.com/h2non/filetype v1.1.3 @@ -41,8 +44,10 @@ require ( github.com/onsi/ginkgo/v2 v2.15.0 github.com/onsi/gomega v1.31.0 github.com/otiai10/copy v1.11.0 + github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.18.0 github.com/pterm/pterm v0.12.79 + github.com/robfig/cron v1.2.0 github.com/segmentio/analytics-go/v3 v3.2.1 github.com/shirou/gopsutil/v3 v3.24.3 github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 @@ -55,11 +60,18 @@ require ( go.mongodb.org/mongo-driver v1.11.3 go.uber.org/zap v1.26.0 golang.org/x/exp v0.0.0-20230905200255-921286631fa9 + golang.org/x/oauth2 v0.13.0 + golang.org/x/sync v0.5.0 + golang.org/x/text v0.14.0 + google.golang.org/appengine v1.6.8 google.golang.org/grpc v1.60.0 + google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.28.4 k8s.io/apimachinery v0.28.4 k8s.io/client-go v0.28.4 + sigs.k8s.io/controller-runtime v0.16.3 sigs.k8s.io/kustomize/kyaml v0.15.0 ) @@ -70,36 +82,52 @@ require ( github.com/AlecAivazis/survey/v2 v2.3.6 // indirect github.com/agnivade/levenshtein v1.1.1 // indirect github.com/alecthomas/chroma v0.10.0 // indirect - github.com/aymanbagabas/go-osc52 v1.2.1 // indirect + github.com/andybalholm/brotli v1.0.5 // indirect github.com/aymerick/douceur v0.2.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect - github.com/briandowns/spinner v1.19.0 // indirect - github.com/charmbracelet/glamour v0.6.0 // indirect + github.com/briandowns/spinner v1.18.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/charmbracelet/glamour v0.5.1-0.20220727184942-e70ff2d969da // indirect github.com/cli/browser v1.1.0 // indirect github.com/cli/go-gh v0.1.3-0.20221102170023-e3ec45fb1d1b // indirect github.com/cli/safeexec v1.0.0 // indirect github.com/cli/shurcooL-graphql v0.0.2 // indirect - github.com/containerd/console v1.0.4 // indirect - github.com/dlclark/regexp2 v1.8.0 // indirect - github.com/emicklei/go-restful/v3 v3.11.2 // indirect + github.com/containerd/console v1.0.3 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dlclark/regexp2 v1.4.0 // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/evanphx/json-patch v5.6.0+incompatible // indirect github.com/evanphx/json-patch/v5 v5.7.0 // indirect github.com/fatih/color v1.15.0 // indirect + github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/go-errors/errors v1.5.1 // indirect + github.com/go-logr/logr v1.3.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/jsonpointer v0.20.0 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.4 // indirect - github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect github.com/go-playground/validator/v10 v10.11.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/snappy v0.0.1 // indirect github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/gofuzz v1.2.0 // indirect github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/gorilla/css v1.0.1 // indirect + github.com/gorilla/css v1.0.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect - github.com/henvic/httpretty v0.1.0 // indirect + github.com/henvic/httpretty v0.0.6 // indirect + github.com/imdario/mergo v0.3.16 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/itchyny/timefmt-go v0.1.5 // indirect github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.2 // indirect github.com/klauspost/cpuid/v2 v2.2.3 // indirect github.com/leodido/go-urn v1.2.1 // indirect github.com/lithammer/fuzzysearch v1.1.8 // indirect @@ -108,108 +136,75 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect - github.com/microcosm-cc/bluemonday v1.0.21 // indirect + github.com/microcosm-cc/bluemonday v1.0.20 // indirect github.com/minio/highwayhash v1.0.2 // indirect + github.com/minio/md5-simd v1.1.2 // indirect + github.com/minio/sha256-simd v1.0.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/spdystream v0.2.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect github.com/muesli/reflow v0.3.0 // indirect - github.com/muesli/termenv v0.14.0 // indirect + github.com/muesli/termenv v0.12.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nats-io/jwt/v2 v2.5.2 // indirect github.com/nats-io/nkeys v0.4.6 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/package-url/packageurl-go v0.1.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/pquerna/cachecontrol v0.2.0 // indirect - github.com/rivo/uniseg v0.4.7 // indirect - github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect - github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee // indirect - github.com/segmentio/backo-go v1.0.1 // indirect - github.com/shoenig/go-m1cpu v0.1.6 // indirect - github.com/shurcooL/githubv4 v0.0.0-20220922232305-70b4d362a8cb // indirect - github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 // indirect - github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e // indirect - github.com/tidwall/pretty v1.2.0 // indirect - github.com/tklauser/go-sysconf v0.3.12 // indirect - github.com/tklauser/numcpus v0.6.1 // indirect - github.com/urfave/cli/v2 v2.24.4 // indirect - github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect - github.com/yuin/goldmark v1.6.0 // indirect - github.com/yuin/goldmark-emoji v1.0.1 // indirect - github.com/yusufpapurcu/wmi v1.2.4 // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/tools v0.18.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect - gopkg.in/square/go-jose.v2 v2.6.0 // indirect - sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect -) - -require ( - github.com/andybalholm/brotli v1.0.5 // indirect - github.com/beorn7/perks v1.0.1 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dustin/go-humanize v1.0.1 - github.com/evanphx/json-patch v5.7.0+incompatible // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/go-logr/logr v1.4.1 // indirect - github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - github.com/golang/protobuf v1.5.4 // indirect - github.com/golang/snappy v0.0.4 // indirect - github.com/google/go-cmp v0.6.0 - github.com/google/gofuzz v1.2.0 // indirect - github.com/google/uuid v1.5.0 - github.com/imdario/mergo v0.3.16 // indirect - github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/json-iterator/go v1.1.12 // indirect - github.com/klauspost/compress v1.17.2 // indirect - github.com/mattn/go-runewidth v0.0.15 // indirect - github.com/minio/md5-simd v1.1.2 // indirect - github.com/minio/sha256-simd v1.0.0 // indirect - github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/pkg/errors v0.9.1 - github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/robfig/cron v1.2.0 + github.com/rivo/uniseg v0.4.4 // indirect github.com/rs/xid v1.4.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 // indirect + github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 // indirect + github.com/segmentio/backo-go v1.0.0 // indirect + github.com/shoenig/go-m1cpu v0.1.6 // indirect + github.com/shurcooL/githubv4 v0.0.0-20220520033151-0b4e3294ff00 // indirect + github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/pflag v1.0.5 // indirect + github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect + github.com/urfave/cli/v2 v2.24.4 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect github.com/xdg-go/pbkdf2 v1.0.0 // indirect - github.com/xdg-go/scram v1.1.2 // indirect - github.com/xdg-go/stringprep v1.0.4 // indirect + github.com/xdg-go/scram v1.1.1 // indirect + github.com/xdg-go/stringprep v1.0.3 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect - github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect + github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect + github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect + github.com/yuin/goldmark v1.4.13 // indirect + github.com/yuin/goldmark-emoji v1.0.1 // indirect + github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/oauth2 v0.13.0 - golang.org/x/sync v0.6.0 - golang.org/x/sys v0.19.0 // indirect - golang.org/x/term v0.19.0 // indirect - golang.org/x/text v0.14.0 + golang.org/x/crypto v0.16.0 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.16.0 // indirect golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.16.1 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect - google.golang.org/appengine v1.6.8 - google.golang.org/protobuf v1.33.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v3 v3.0.1 + gopkg.in/ini.v1 v1.66.6 // indirect + gopkg.in/square/go-jose.v2 v2.6.0 // indirect k8s.io/apiextensions-apiserver v0.28.3 // indirect k8s.io/component-base v0.28.3 // indirect k8s.io/klog/v2 v2.100.1 // indirect k8s.io/kube-openapi v0.0.0-20230918164632-68afd615200d // indirect k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect - sigs.k8s.io/controller-runtime v0.16.3 - sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect sigs.k8s.io/yaml v1.3.0 // indirect ) diff --git a/go.sum b/go.sum index 6da8380d014..69e7f638615 100644 --- a/go.sum +++ b/go.sum @@ -82,9 +82,6 @@ github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdK github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk= -github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= -github.com/aymanbagabas/go-osc52 v1.2.1 h1:q2sWUyDcozPLcLabEMd+a+7Ea2DitxZVN9hTxab9L4E= -github.com/aymanbagabas/go-osc52 v1.2.1/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -93,15 +90,15 @@ github.com/bmatcuk/doublestar/v4 v4.6.1 h1:FH9SifrbvJhnlQpztAx++wlkk70QBf0iBWDwN github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/briandowns/spinner v1.19.0 h1:s8aq38H+Qju89yhp89b4iIiMzMm8YN3p6vGpwyh/a8E= -github.com/briandowns/spinner v1.19.0/go.mod h1:mQak9GHqbspjC/5iUx3qMlIho8xBS/ppAL/hX5SmPJU= +github.com/briandowns/spinner v1.18.1 h1:yhQmQtM1zsqFsouh09Bk/jCjd50pC3EOGsh28gLVvwY= +github.com/briandowns/spinner v1.18.1/go.mod h1:mQak9GHqbspjC/5iUx3qMlIho8xBS/ppAL/hX5SmPJU= github.com/cdevents/sdk-go v0.3.0 h1:YHb47qIVi3qV+HmkyW3e0gqCQaqKW0rnL4EejSDuMFs= github.com/cdevents/sdk-go v0.3.0/go.mod h1:8EFl9VDZkxEmO/sr06Phzr501OiU6B5d04+eYpf1tF0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charmbracelet/glamour v0.6.0 h1:wi8fse3Y7nfcabbbDuwolqTqMQPMnVPeZhDM273bISc= -github.com/charmbracelet/glamour v0.6.0/go.mod h1:taqWV4swIMMbWALc0m7AfE9JkPSU8om2538k9ITBxOc= +github.com/charmbracelet/glamour v0.5.1-0.20220727184942-e70ff2d969da h1:FGz53GWQRiKQ/5xUsoCCkewSQIC7u81Scaxx2nUy3nM= +github.com/charmbracelet/glamour v0.5.1-0.20220727184942-e70ff2d969da/go.mod h1:HXz79SMFnF9arKxqeoHWxmo1BhplAH7wehlRhKQIL94= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -121,9 +118,8 @@ github.com/cloudevents/sdk-go/v2 v2.15.2/go.mod h1:lL7kSWAE/V8VI4Wh0jbL2v/jvqsm6 github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw= github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro= -github.com/containerd/console v1.0.4/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk= github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk= github.com/coreos/go-oidc v2.2.1+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= @@ -141,23 +137,22 @@ github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMS github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E= github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= -github.com/dlclark/regexp2 v1.8.0 h1:rJD5HeGIT/2b5CDk63FVCwZA3qgYElfg+oQK7uH5pfE= -github.com/dlclark/regexp2 v1.8.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0 h1:90Ly+6UfUypEF6vvvW5rQIv9opIL8CbmW9FT20LDQoY= github.com/dustinkirkland/golang-petname v0.0.0-20191129215211-8e5a1ed0cff0/go.mod h1:V+Qd57rJe8gd4eiGzZyg4h54VLHmYVVw54iMnlAMrF8= -github.com/emicklei/go-restful/v3 v3.11.2 h1:1onLa9DcsMYO9P+CXaL0dStDqQ2EHHXLiz+BtnqkLAU= -github.com/emicklei/go-restful/v3 v3.11.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= +github.com/emicklei/go-restful/v3 v3.11.0 h1:rAQeMHw1c7zTmncogyy8VvRZwtkmkZ4FxERmMY4rD+g= +github.com/emicklei/go-restful/v3 v3.11.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI= -github.com/evanphx/json-patch v5.7.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= +github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch/v5 v5.7.0 h1:nJqP7uwL84RJInrohHfW0Fx3awjbm8qZeFv0nW9SYGc= github.com/evanphx/json-patch/v5 v5.7.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fasthttp/websocket v1.5.0 h1:B4zbe3xXyvIdnqjOZrafVFklCUq5ZLo/TqCt5JA1wLE= @@ -177,8 +172,8 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= @@ -193,9 +188,8 @@ github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogB github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= -github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= -github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= @@ -244,11 +238,10 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= -github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= @@ -300,9 +293,8 @@ github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQ github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0= github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w= +github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= -github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= -github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -314,8 +306,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru/v2 v2.0.1 h1:5pv5N1lT1fjLg2VQ5KWc7kmucp2x/kvFOnxuVTqZ6x4= github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/henvic/httpretty v0.1.0 h1:Htk66UUEbXTD4JR0qJZaw8YAMKw+9I24ZZOnDe/ti+E= -github.com/henvic/httpretty v0.1.0/go.mod h1:ViEsly7wgdugYtymX54pYp6Vv2wqZmNHayJ6q8tlKCc= +github.com/henvic/httpretty v0.0.6 h1:JdzGzKZBajBfnvlMALXXMVQWxWMF/ofTy8C3/OSUTxs= +github.com/henvic/httpretty v0.0.6/go.mod h1:X38wLjWXHkXT7r2+uK8LjCMne9rsuNaBLJ+5cU2/Pmo= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog= github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -382,8 +374,8 @@ github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -398,8 +390,9 @@ github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQth github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI= github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/microcosm-cc/bluemonday v1.0.21 h1:dNH3e4PSyE4vNX+KlRGHT5KrSvjeUkoNPwEORjffHJg= -github.com/microcosm-cc/bluemonday v1.0.21/go.mod h1:ytNkv4RrDrLJ2pqlsSI46O6IVXmZOBBD4SaJyDwwTkM= +github.com/microcosm-cc/bluemonday v1.0.19/go.mod h1:QNzV2UbLK2/53oIIwTOyLUSABMkjZ4tqiyC1g/DyqxE= +github.com/microcosm-cc/bluemonday v1.0.20 h1:flpzsq4KU3QIYAYGV/szUat7H+GPOXR0B2JU5A1Wp8Y= +github.com/microcosm-cc/bluemonday v1.0.20/go.mod h1:yfBmMi8mxvaZut3Yytv+jTXRY8mxyjJ0/kQBTElld50= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= @@ -426,9 +419,9 @@ github.com/moogar0880/problems v0.1.1 h1:bktLhq8NDG/czU2ZziYNigBFksx13RaYe5AVdNm github.com/moogar0880/problems v0.1.1/go.mod h1:5Dxrk2sD7BfBAgnOzQ1yaTiuCYdGPUh49L8Vhfky62c= github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s= github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8= -github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4YJK5e2bc= -github.com/muesli/termenv v0.14.0 h1:8x9NFfOe8lmIWK4pgy3IfVEy47f+ppe3tUqdPZG2Uy0= -github.com/muesli/termenv v0.14.0/go.mod h1:kG/pF1E7fh949Xhe156crRUrHNyK221IuGO7Ez60Uc8= +github.com/muesli/termenv v0.11.0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs= +github.com/muesli/termenv v0.12.0 h1:KuQRUE3PgxRFWhq4gHvZtPSLCGDqM5q/cYr1pZ39ytc= +github.com/muesli/termenv v0.12.0/go.mod h1:WCCv32tusQ/EEZ5S8oUIIrC/nIuBcxCVqlN4Xfkv+7A= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nats-io/jwt/v2 v2.5.2 h1:DhGH+nKt+wIkDxM6qnVSKjokq5t59AZV5HRcFW0zJwU= @@ -490,8 +483,8 @@ github.com/pterm/pterm v0.12.79 h1:lH3yrYMhdpeqX9y5Ep1u7DejyHy7NSQg9qrBjF9dFT4= github.com/pterm/pterm v0.12.79/go.mod h1:1v/gzOF1N0FsjbgTHZ1wVycRkKiatFvJSJC4IGaQAAo= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= -github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= -github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -505,13 +498,12 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0 h1:TToq11gyfNlrMFZiYujSekIsPd9AmsA2Bj/iv+s4JHE= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= +github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 h1:Orn7s+r1raRTBKLSc9DmbktTT04sL+vkzsbRD2Q8rOI= github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899/go.mod h1:oejLrk1Y/5zOF+c/aHtXqn3TFlzzbAgPWg8zBiAHDas= -github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee h1:8Iv5m6xEo1NR1AvpV+7XmhI4r39LGNzwUL4YpMuL5vk= -github.com/savsgio/gotils v0.0.0-20230208104028-c358bd845dee/go.mod h1:qwtSXrKuJh/zsFQ12yEE89xfCrGKK63Rr7ctU/uCo4g= github.com/segmentio/analytics-go/v3 v3.2.1 h1:G+f90zxtc1p9G+WigVyTR0xNfOghOGs/PYAlljLOyeg= github.com/segmentio/analytics-go/v3 v3.2.1/go.mod h1:p8owAF8X+5o27jmvUognuXxdtqvSGtD0ZrfY2kcS9bE= -github.com/segmentio/backo-go v1.0.1 h1:68RQccglxZeyURy93ASB/2kc9QudzgIDexJ927N++y4= -github.com/segmentio/backo-go v1.0.1/go.mod h1:9/Rh6yILuLysoQnZ2oNooD2g7aBnvM7r/fNVxRNWfBc= +github.com/segmentio/backo-go v1.0.0 h1:kbOAtGJY2DqOR0jfRkYEorx/b18RgtepGtY3+Cpe6qA= +github.com/segmentio/backo-go v1.0.0/go.mod h1:kJ9mm9YmoWSkk+oQ+5Cj8DEoRCX2JT6As4kEtIIOp1M= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= @@ -521,8 +513,8 @@ github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFt github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k= -github.com/shurcooL/githubv4 v0.0.0-20220922232305-70b4d362a8cb h1:Ptg7eUGaD22iZMracv+h7ghDJkGaeQ1FQ9BnkRB6DOo= -github.com/shurcooL/githubv4 v0.0.0-20220922232305-70b4d362a8cb/go.mod h1:hAF0iLZy4td2EX+/8Tw+4nodhlMrwN3HupfaXj3zkGo= +github.com/shurcooL/githubv4 v0.0.0-20220520033151-0b4e3294ff00 h1:fiFvD4lT0aWjuuAb64LlZ/67v87m+Kc9Qsu5cMFNK0w= +github.com/shurcooL/githubv4 v0.0.0-20220520033151-0b4e3294ff00/go.mod h1:hAF0iLZy4td2EX+/8Tw+4nodhlMrwN3HupfaXj3zkGo= github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29 h1:B1PEwpArrNp4dkQrfxh/abbBAOZBVp0ds+fBEOUOqOc= github.com/shurcooL/graphql v0.0.0-20220606043923-3cf50f8a0a29/go.mod h1:AuYgA5Kyo4c7HfUmvRGs/6rGlMMV/6B1bVnB9JxJEEg= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= @@ -555,9 +547,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e h1:BuzhfgfWQbX0dWzYzT1zsORLnHRv3bcRcsaUk0VmXA8= github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e/go.mod h1:/Tnicc6m/lsJE0irFMA0LfIwTBo4QP7A8IfyIv4zZKI= +github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= @@ -576,12 +567,10 @@ github.com/vektah/gqlparser/v2 v2.5.2-0.20230422221642-25e09f9d292d h1:ibuD+jp4y github.com/vektah/gqlparser/v2 v2.5.2-0.20230422221642-25e09f9d292d/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRFZrvOnp3hmCs= github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.1 h1:VOMT+81stJgXW3CpHyqHN3AXDYIMsx56mEFrB37Mb/E= github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g= -github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY= -github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.3 h1:kdwGpVNwPFtjs98xCGkHjQtGKh86rDcRZN17QEMCOIs= github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8= -github.com/xdg-go/stringprep v1.0.4 h1:XLI/Ng3O1Atzq0oBs3TWm+5ZVgkq2aqdlvP9JtoZ6c8= -github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= @@ -589,19 +578,16 @@ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavM github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d h1:splanxYIlg+5LfHAM6xpdFEAYOk8iySO56hMFq6uLyA= github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= -github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a h1:fZHgsYlfvtyqToslyjUt3VOPF4J7aK/3MPcK7xp3PDk= -github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/R083muKhosV54bj5niojjWZvU8xrevuH4= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.4/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg= +github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.5.2/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68= -github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark-emoji v1.0.1 h1:ctuWEyzGBwiucEqxzwe0SOYDXPAucOrE9NQC18Wa1os= github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGjRIBbIZQFqkQ= github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0= @@ -624,7 +610,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -633,8 +618,8 @@ golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -671,11 +656,10 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -708,17 +692,16 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220111093109-d55c255bac03/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220923203811-8be639271d50/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -743,8 +726,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -788,12 +771,13 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -804,22 +788,20 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -888,11 +870,10 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -995,8 +976,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1007,8 +988,8 @@ gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= -gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.66.6 h1:LATuAqN/shcYAOkv3wl2L4rkaKqkcgTBQjOyYDvcPKI= +gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI= gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -1054,7 +1035,7 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMm sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize/kyaml v0.15.0 h1:ynlLMAxDhrY9otSg5GYE2TcIz31XkGZ2Pkj7SdolD84= sigs.k8s.io/kustomize/kyaml v0.15.0/go.mod h1:+uMkBahdU1KNOj78Uta4rrXH+iH7wvg+nW7+GULvREA= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= -sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= +sigs.k8s.io/structured-merge-diff/v4 v4.3.0 h1:UZbZAZfX0wV2zr7YZorDz6GXROfDFj6LvqCRm4VUVKk= +sigs.k8s.io/structured-merge-diff/v4 v4.3.0/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= From 948f8811eaf44f05837bb982875a476fe2dbadc2 Mon Sep 17 00:00:00 2001 From: Tomasz Konieczny Date: Mon, 27 May 2024 12:23:26 +0200 Subject: [PATCH 15/39] tests - run script updated with workflow targets (#5500) --- test/scripts/executor-tests/run.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/scripts/executor-tests/run.sh b/test/scripts/executor-tests/run.sh index 1fe4f7f1c24..0d07e9fd5f6 100755 --- a/test/scripts/executor-tests/run.sh +++ b/test/scripts/executor-tests/run.sh @@ -536,6 +536,14 @@ main() { postman-smoke playwright-smoke soapui-smoke + workflow-cypress-smoke + workflow-gradle-smoke + workflow-jmeter-smoke + workflow-k6-smoke + workflow-maven-smoke + workflow-playwright-smoke + workflow-postman-smoke + workflow-soapui-smoke ;; smoke) artillery-smoke @@ -559,6 +567,14 @@ main() { playwright-smoke postman-smoke soapui-smoke + workflow-cypress-smoke + workflow-gradle-smoke + workflow-jmeter-smoke + workflow-k6-smoke + workflow-maven-smoke + workflow-playwright-smoke + workflow-postman-smoke + workflow-soapui-smoke ;; special) special-cases-failures From f62d60b797bdab09ec82d8031668ba986b658b85 Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Mon, 27 May 2024 16:17:47 +0200 Subject: [PATCH 16/39] fix(testworkflows): fetch logs properly for running services (#5502) * fix(testworkflows): fetch logs properly for running services * chore: extract 100ms as IdleTimeout constant * chore: avoid getting stack on container logs when the pod is already stopped --- .../testworkflow-toolkit/commands/services.go | 1 + cmd/tcl/testworkflow-toolkit/spawn/utils.go | 3 ++- .../testworkflowcontroller/controller.go | 15 ++++++++++++--- .../testworkflowcontroller/logs.go | 9 +++++++-- .../testworkflowcontroller/podstate.go | 18 +++++++++++++++++- .../watchinstrumentedpod.go | 16 ++++++++++++++-- pkg/triggers/scraper.go | 1 + 7 files changed, 54 insertions(+), 9 deletions(-) diff --git a/cmd/tcl/testworkflow-toolkit/commands/services.go b/cmd/tcl/testworkflow-toolkit/commands/services.go index 1b2e929ac3c..a414adeea6b 100644 --- a/cmd/tcl/testworkflow-toolkit/commands/services.go +++ b/cmd/tcl/testworkflow-toolkit/commands/services.go @@ -336,6 +336,7 @@ func NewServicesCmd() *cobra.Command { break } } + ctrl.StopController() // Fail if the container has not started if !started { diff --git a/cmd/tcl/testworkflow-toolkit/spawn/utils.go b/cmd/tcl/testworkflow-toolkit/spawn/utils.go index 1aa35e41af6..65fd806cbe0 100644 --- a/cmd/tcl/testworkflow-toolkit/spawn/utils.go +++ b/cmd/tcl/testworkflow-toolkit/spawn/utils.go @@ -234,7 +234,8 @@ func SaveLogs(ctx context.Context, clientSet kubernetes.Interface, storage artif Timeout: ControllerTimeout, }) if err == nil { - err = storage.SaveStream(filePath, ctrl.Logs(ctx)) + err = storage.SaveStream(filePath, ctrl.Logs(ctx, false)) + ctrl.StopController() } return filePath, err } diff --git a/pkg/tcl/testworkflowstcl/testworkflowcontroller/controller.go b/pkg/tcl/testworkflowstcl/testworkflowcontroller/controller.go index 6f323077f55..20462b59f2e 100644 --- a/pkg/tcl/testworkflowstcl/testworkflowcontroller/controller.go +++ b/pkg/tcl/testworkflowstcl/testworkflowcontroller/controller.go @@ -20,6 +20,7 @@ import ( initconstants "github.com/kubeshop/testkube/cmd/tcl/testworkflow-init/constants" "github.com/kubeshop/testkube/cmd/tcl/testworkflow-init/data" + "github.com/kubeshop/testkube/internal/common" "github.com/kubeshop/testkube/pkg/api/v1/testkube" "github.com/kubeshop/testkube/pkg/tcl/testworkflowstcl/testworkflowprocessor" "github.com/kubeshop/testkube/pkg/tcl/testworkflowstcl/testworkflowprocessor/constants" @@ -56,7 +57,7 @@ type Controller interface { Cleanup(ctx context.Context) error Watch(ctx context.Context) <-chan ChannelMessage[Notification] WatchLightweight(ctx context.Context) <-chan LightweightNotification - Logs(ctx context.Context) io.Reader + Logs(ctx context.Context, follow bool) io.Reader NodeName(ctx context.Context) (string, error) PodIP(ctx context.Context) (string, error) StopController() @@ -271,12 +272,20 @@ func (c *controller) WatchLightweight(parentCtx context.Context) <-chan Lightwei return ch } -func (c *controller) Logs(parentCtx context.Context) io.Reader { +func (c *controller) Logs(parentCtx context.Context, follow bool) io.Reader { reader, writer := io.Pipe() go func() { defer writer.Close() ref := "" - for v := range c.Watch(parentCtx) { + w, err := WatchInstrumentedPod(parentCtx, c.clientSet, c.signature, c.scheduledAt, c.pod, c.podEvents, WatchInstrumentedPodOptions{ + JobEvents: c.jobEvents, + Job: c.job, + Follow: common.Ptr(follow), + }) + if err != nil { + return + } + for v := range w.Channel() { if v.Error == nil && v.Value.Log != "" { if ref != v.Value.Ref { ref = v.Value.Ref diff --git a/pkg/tcl/testworkflowstcl/testworkflowcontroller/logs.go b/pkg/tcl/testworkflowstcl/testworkflowcontroller/logs.go index 44fa53edb8e..e4057901597 100644 --- a/pkg/tcl/testworkflowstcl/testworkflowcontroller/logs.go +++ b/pkg/tcl/testworkflowstcl/testworkflowcontroller/logs.go @@ -11,6 +11,7 @@ package testworkflowcontroller import ( "bufio" "context" + "errors" "io" "strings" "time" @@ -36,7 +37,7 @@ type ContainerLog struct { Output *data.Instruction } -func WatchContainerLogs(ctx context.Context, clientSet kubernetes.Interface, namespace, podName, containerName string, bufferSize int) Channel[ContainerLog] { +func WatchContainerLogs(ctx context.Context, clientSet kubernetes.Interface, namespace, podName, containerName string, bufferSize int, follow bool, pod Channel[*corev1.Pod]) Channel[ContainerLog] { w := newChannel[ContainerLog](ctx, bufferSize) go func() { @@ -45,7 +46,7 @@ func WatchContainerLogs(ctx context.Context, clientSet kubernetes.Interface, nam // Create logs stream request req := clientSet.CoreV1().Pods(namespace).GetLogs(podName, &corev1.PodLogOptions{ - Follow: true, + Follow: follow, Timestamps: true, Container: containerName, }) @@ -58,6 +59,10 @@ func WatchContainerLogs(ctx context.Context, clientSet kubernetes.Interface, nam w.Error(err) return } + p := <-pod.Peek(ctx) + if p != nil && IsPodDone(p) { + w.Error(errors.New("pod is finished and there are no logs for this container")) + } continue } break diff --git a/pkg/tcl/testworkflowstcl/testworkflowcontroller/podstate.go b/pkg/tcl/testworkflowstcl/testworkflowcontroller/podstate.go index eb6c1672cce..cb41223686a 100644 --- a/pkg/tcl/testworkflowstcl/testworkflowcontroller/podstate.go +++ b/pkg/tcl/testworkflowstcl/testworkflowcontroller/podstate.go @@ -62,9 +62,16 @@ func newPodState(parentCtx context.Context) *podState { <-ctx.Done() state.mu.Lock() defer state.mu.Unlock() - for _, c := range state.finishedCh { + for name, c := range state.finishedCh { if c != nil { + state.finished[name] = time.Time{} close(c) + delete(state.finishedCh, name) + } + } + for _, c := range state.prestart { + if c != nil { + c.Close() } } }() @@ -218,6 +225,8 @@ func (p *podState) RegisterJob(job *batchv1.Job) { p.setQueuedAt("", job.CreationTimestamp.Time) if job.Status.CompletionTime != nil { p.setFinishedAt("", job.Status.CompletionTime.Time) + } else if job.DeletionTimestamp != nil { + p.setFinishedAt("", job.DeletionTimestamp.Time) } } @@ -231,6 +240,13 @@ func (p *podState) PreStart(name string) <-chan ChannelMessage[podStateUpdate] { return p.preStartWatcher(name).Channel() } +func (p *podState) IsFinished(name string) bool { + p.mu.Lock() + defer p.mu.Unlock() + _, ok := p.finished[name] + return ok && p.ctx.Err() == nil +} + func (p *podState) Finished(name string) chan struct{} { p.mu.Lock() defer p.mu.Unlock() diff --git a/pkg/tcl/testworkflowstcl/testworkflowcontroller/watchinstrumentedpod.go b/pkg/tcl/testworkflowstcl/testworkflowcontroller/watchinstrumentedpod.go index c2032692d53..286d2e18181 100644 --- a/pkg/tcl/testworkflowstcl/testworkflowcontroller/watchinstrumentedpod.go +++ b/pkg/tcl/testworkflowstcl/testworkflowcontroller/watchinstrumentedpod.go @@ -19,17 +19,20 @@ import ( "k8s.io/client-go/kubernetes" "github.com/kubeshop/testkube/cmd/tcl/testworkflow-init/constants" + "github.com/kubeshop/testkube/internal/common" "github.com/kubeshop/testkube/pkg/api/v1/testkube" "github.com/kubeshop/testkube/pkg/tcl/testworkflowstcl/testworkflowprocessor" ) const ( InitContainerName = "tktw-init" + IdleTimeout = 100 * time.Millisecond ) type WatchInstrumentedPodOptions struct { JobEvents Channel[*corev1.Event] Job Channel[*batchv1.Job] + Follow *bool } func WatchInstrumentedPod(parentCtx context.Context, clientSet kubernetes.Interface, signature []testworkflowprocessor.Signature, scheduledAt time.Time, pod Channel[*corev1.Pod], podEvents Channel[*corev1.Event], opts WatchInstrumentedPodOptions) (Channel[Notification], error) { @@ -101,7 +104,8 @@ func WatchInstrumentedPod(parentCtx context.Context, clientSet kubernetes.Interf } // Watch the container logs - for v := range WatchContainerLogs(ctx, clientSet, podObj.Namespace, podObj.Name, ref, 10).Channel() { + follow := common.ResolvePtr(opts.Follow, true) && !state.IsFinished(ref) + for v := range WatchContainerLogs(ctx, clientSet, podObj.Namespace, podObj.Name, ref, 10, follow, pod).Channel() { if v.Error != nil { s.Error(v.Error) } else if v.Value.Output != nil { @@ -139,7 +143,15 @@ func WatchInstrumentedPod(parentCtx context.Context, clientSet kubernetes.Interf } // Get the final result - <-state.Finished(ref) + if follow { + <-state.Finished(ref) + } else { + select { + case <-state.Finished(ref): + case <-time.After(IdleTimeout): + return + } + } status, err := state.ContainerResult(ref) if err != nil { s.Error(err) diff --git a/pkg/triggers/scraper.go b/pkg/triggers/scraper.go index 27a58b063cb..f7a07187095 100644 --- a/pkg/triggers/scraper.go +++ b/pkg/triggers/scraper.go @@ -188,6 +188,7 @@ func (s *Service) abortRunningTestWorkflowExecutions(ctx context.Context, status // Pro edition only (tcl protected code) // Abort the execution err = ctrl.Abort(context.Background()) + ctrl.StopController() if err != nil { s.logger.Errorf("trigger service: execution scraper component: error aborting test workflow execution: %v", err) continue From 4f98baed4c9eab74d58c0fdcc26210a870ab2276 Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Tue, 28 May 2024 09:44:49 +0200 Subject: [PATCH 17/39] fix(testworkflows): mount tarballs when needed (i.e. content.tarball or transfer) (#5501) --- pkg/tcl/testworkflowstcl/testworkflowprocessor/operations.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/tcl/testworkflowstcl/testworkflowprocessor/operations.go b/pkg/tcl/testworkflowstcl/testworkflowprocessor/operations.go index 8fe3fcf4df2..fa6da46b440 100644 --- a/pkg/tcl/testworkflowstcl/testworkflowprocessor/operations.go +++ b/pkg/tcl/testworkflowstcl/testworkflowprocessor/operations.go @@ -311,14 +311,14 @@ func ProcessContentTarball(_ InternalProcessor, layer Intermediate, container Co args[i] = fmt.Sprintf("%s=%s", t.Path, t.Url) needsMount := t.Mount != nil && *t.Mount if !needsMount { - needsMount = selfContainer.HasVolumeAt(t.Path) + needsMount = !selfContainer.HasVolumeAt(t.Path) } if needsMount && t.Mount != nil && !*t.Mount { return nil, fmt.Errorf("content.tarball[%d]: %s: is not part of any volume: should be mounted", i, t.Path) } - if (needsMount && t.Mount == nil) || (t.Mount == nil && *t.Mount) { + if needsMount { volumeMount := layer.AddEmptyDirVolume(nil, t.Path) container.AppendVolumeMounts(volumeMount) } From 6d7a3cbef0d4e4ff3508922a0a663537bb6e9170 Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Tue, 28 May 2024 13:06:44 +0200 Subject: [PATCH 18/39] fix(testworkflows): expose service's description (#5504) --- api/v1/testkube.yaml | 3 ++ .../testworkflow-toolkit/commands/services.go | 7 ++++- go.mod | 2 +- go.sum | 4 +-- ..._test_workflow_independent_service_spec.go | 14 ++++++---- ...test_workflow_independent_step_parallel.go | 26 ++++++++--------- .../model_test_workflow_service_spec.go | 6 ++-- ...del_test_workflow_step_execute_test_ref.go | 12 ++++---- ...workflow_step_execute_test_workflow_ref.go | 12 ++++---- .../model_test_workflow_step_parallel.go | 28 +++++++++---------- .../mapperstcl/testworkflows/kube_openapi.go | 2 ++ .../mapperstcl/testworkflows/openapi_kube.go | 6 ++-- 12 files changed, 69 insertions(+), 53 deletions(-) diff --git a/api/v1/testkube.yaml b/api/v1/testkube.yaml index 0ae84cdfd1f..9177e706f6c 100644 --- a/api/v1/testkube.yaml +++ b/api/v1/testkube.yaml @@ -7966,6 +7966,9 @@ components: - $ref: "#/components/schemas/TestWorkflowStepExecuteStrategy" - $ref: "#/components/schemas/TestWorkflowStepRun" - properties: + description: + type: string + description: "service description to display" timeout: type: string description: "maximum time until reaching readiness" diff --git a/cmd/tcl/testworkflow-toolkit/commands/services.go b/cmd/tcl/testworkflow-toolkit/commands/services.go index a414adeea6b..c97ffc5495d 100644 --- a/cmd/tcl/testworkflow-toolkit/commands/services.go +++ b/cmd/tcl/testworkflow-toolkit/commands/services.go @@ -46,7 +46,8 @@ type ServiceInstance struct { } type ServiceState struct { - Ip string `json:"ip"` + Ip string `json:"ip"` + Description string `json:"description"` } type ServiceStatus string @@ -164,6 +165,7 @@ func NewServicesCmd() *cobra.Command { svcInstances[index] = ServiceInstance{ Index: index, Name: name, + Description: svcSpec.Description, RestartPolicy: corev1.RestartPolicy(svcSpec.RestartPolicy), ReadinessProbe: svcSpec.ReadinessProbe, Spec: spec, @@ -182,6 +184,9 @@ func NewServicesCmd() *cobra.Command { // Update the state state[name] = make([]ServiceState, len(svcInstances)) + for i := range svcInstances { + state[name][i].Description = svcInstances[i].Description + } data.PrintHintDetails(env.Ref(), fmt.Sprintf("services.%s", name), state) } diff --git a/go.mod b/go.mod index c7821f35ce7..10cb27e92d1 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/kelseyhightower/envconfig v1.4.0 github.com/kubepug/kubepug v1.7.1 - github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524114137-5817a6293a91 + github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240528102239-5e235fc7b611 github.com/minio/minio-go/v7 v7.0.47 github.com/montanaflynn/stats v0.6.6 github.com/moogar0880/problems v0.1.1 diff --git a/go.sum b/go.sum index 69e7f638615..44d2d642a4e 100644 --- a/go.sum +++ b/go.sum @@ -358,8 +358,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubepug/kubepug v1.7.1 h1:LKhfSxS8Y5mXs50v+3Lpyec+cogErDLcV7CMUuiaisw= github.com/kubepug/kubepug v1.7.1/go.mod h1:lv+HxD0oTFL7ZWjj0u6HKhMbbTIId3eG7aWIW0gyF8g= -github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524114137-5817a6293a91 h1:u9HnZ2kls2jWorcFo4T9yplbKjeu7Eq5iHRkRWtNNW4= -github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240524114137-5817a6293a91/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk= +github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240528102239-5e235fc7b611 h1:nlp3YjeEQZ9huo1BbvZbi5ouXeJWfsZJER9UBt3s/+g= +github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240528102239-5e235fc7b611/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8LFgLN4= diff --git a/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go b/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go index 898b3bb26f1..192eeadb608 100644 --- a/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go +++ b/pkg/api/v1/testkube/model_test_workflow_independent_service_spec.go @@ -25,12 +25,8 @@ type TestWorkflowIndependentServiceSpec struct { SecurityContext *SecurityContext `json:"securityContext,omitempty"` // volumes to mount to the container VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` - Count *BoxedString `json:"count,omitempty"` - MaxCount *BoxedString `json:"maxCount,omitempty"` - // matrix of parameters to spawn instances - Matrix map[string]interface{} `json:"matrix,omitempty"` - // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` + // service description to display + Description string `json:"description,omitempty"` // maximum time until reaching readiness Timeout string `json:"timeout,omitempty"` // list of files to send to parallel steps @@ -40,4 +36,10 @@ type TestWorkflowIndependentServiceSpec struct { Logs *BoxedString `json:"logs,omitempty"` RestartPolicy string `json:"restartPolicy,omitempty"` ReadinessProbe *Probe `json:"readinessProbe,omitempty"` + Count *BoxedString `json:"count,omitempty"` + MaxCount *BoxedString `json:"maxCount,omitempty"` + // matrix of parameters to spawn instances + Matrix map[string]interface{} `json:"matrix,omitempty"` + // parameters that should be distributed across sharded instances + Shards map[string]interface{} `json:"shards,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go b/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go index c1ac53328aa..3ca736332e0 100644 --- a/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go +++ b/pkg/api/v1/testkube/model_test_workflow_independent_step_parallel.go @@ -28,10 +28,19 @@ type TestWorkflowIndependentStepParallel struct { // delay before the step Delay string `json:"delay,omitempty"` // script to run in a default shell for the container - Shell string `json:"shell,omitempty"` - Run *TestWorkflowStepRun `json:"run,omitempty"` - Execute *TestWorkflowStepExecute `json:"execute,omitempty"` - Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` + Shell string `json:"shell,omitempty"` + Run *TestWorkflowStepRun `json:"run,omitempty"` + Execute *TestWorkflowStepExecute `json:"execute,omitempty"` + Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` + // how many resources could be scheduled in parallel + Parallelism int32 `json:"parallelism,omitempty"` + // worker description to display + Description string `json:"description,omitempty"` + Logs *BoxedString `json:"logs,omitempty"` + // list of files to send to parallel steps + Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` + // list of files to fetch from parallel steps + Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` Config map[string]TestWorkflowParameterSchema `json:"config,omitempty"` Content *TestWorkflowContent `json:"content,omitempty"` Services map[string]TestWorkflowIndependentServiceSpec `json:"services,omitempty"` @@ -42,13 +51,4 @@ type TestWorkflowIndependentStepParallel struct { Steps []TestWorkflowIndependentStep `json:"steps,omitempty"` After []TestWorkflowIndependentStep `json:"after,omitempty"` Events []TestWorkflowEvent `json:"events,omitempty"` - // how many resources could be scheduled in parallel - Parallelism int32 `json:"parallelism,omitempty"` - // worker description to display - Description string `json:"description,omitempty"` - Logs *BoxedString `json:"logs,omitempty"` - // list of files to send to parallel steps - Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` - // list of files to fetch from parallel steps - Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_service_spec.go b/pkg/api/v1/testkube/model_test_workflow_service_spec.go index 9311e16cca1..ad915dd162e 100644 --- a/pkg/api/v1/testkube/model_test_workflow_service_spec.go +++ b/pkg/api/v1/testkube/model_test_workflow_service_spec.go @@ -25,6 +25,8 @@ type TestWorkflowServiceSpec struct { SecurityContext *SecurityContext `json:"securityContext,omitempty"` // volumes to mount to the container VolumeMounts []VolumeMount `json:"volumeMounts,omitempty"` + // service description to display + Description string `json:"description,omitempty"` // maximum time until reaching readiness Timeout string `json:"timeout,omitempty"` // list of files to send to parallel steps @@ -34,11 +36,11 @@ type TestWorkflowServiceSpec struct { Logs *BoxedString `json:"logs,omitempty"` RestartPolicy string `json:"restartPolicy,omitempty"` ReadinessProbe *Probe `json:"readinessProbe,omitempty"` + Use []TestWorkflowTemplateRef `json:"use,omitempty"` Count *BoxedString `json:"count,omitempty"` MaxCount *BoxedString `json:"maxCount,omitempty"` // matrix of parameters to spawn instances Matrix map[string]interface{} `json:"matrix,omitempty"` // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` - Use []TestWorkflowTemplateRef `json:"use,omitempty"` + Shards map[string]interface{} `json:"shards,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go index 974209ed35b..d9943d51ddc 100644 --- a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go +++ b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_ref.go @@ -10,16 +10,16 @@ package testkube type TestWorkflowStepExecuteTestRef struct { - Count *BoxedString `json:"count,omitempty"` - MaxCount *BoxedString `json:"maxCount,omitempty"` - // matrix of parameters to spawn instances - Matrix map[string]interface{} `json:"matrix,omitempty"` - // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` // test name to schedule Name string `json:"name,omitempty"` // test execution description to display Description string `json:"description,omitempty"` + Count *BoxedString `json:"count,omitempty"` + MaxCount *BoxedString `json:"maxCount,omitempty"` ExecutionRequest *TestWorkflowStepExecuteTestExecutionRequest `json:"executionRequest,omitempty"` Tarball map[string]TestWorkflowTarballRequest `json:"tarball,omitempty"` + // matrix of parameters to spawn instances + Matrix map[string]interface{} `json:"matrix,omitempty"` + // parameters that should be distributed across sharded instances + Shards map[string]interface{} `json:"shards,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go index f2e131a22e2..c2bcd5b1d1f 100644 --- a/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go +++ b/pkg/api/v1/testkube/model_test_workflow_step_execute_test_workflow_ref.go @@ -10,12 +10,6 @@ package testkube type TestWorkflowStepExecuteTestWorkflowRef struct { - Count *BoxedString `json:"count,omitempty"` - MaxCount *BoxedString `json:"maxCount,omitempty"` - // matrix of parameters to spawn instances - Matrix map[string]interface{} `json:"matrix,omitempty"` - // parameters that should be distributed across sharded instances - Shards map[string]interface{} `json:"shards,omitempty"` // TestWorkflow name to include Name string `json:"name,omitempty"` // TestWorkflow execution description to display @@ -24,4 +18,10 @@ type TestWorkflowStepExecuteTestWorkflowRef struct { ExecutionName string `json:"executionName,omitempty"` Tarball map[string]TestWorkflowTarballRequest `json:"tarball,omitempty"` Config map[string]string `json:"config,omitempty"` + Count *BoxedString `json:"count,omitempty"` + MaxCount *BoxedString `json:"maxCount,omitempty"` + // matrix of parameters to spawn instances + Matrix map[string]interface{} `json:"matrix,omitempty"` + // parameters that should be distributed across sharded instances + Shards map[string]interface{} `json:"shards,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_step_parallel.go b/pkg/api/v1/testkube/model_test_workflow_step_parallel.go index fbea0caff01..d8b4de8e7ff 100644 --- a/pkg/api/v1/testkube/model_test_workflow_step_parallel.go +++ b/pkg/api/v1/testkube/model_test_workflow_step_parallel.go @@ -28,10 +28,20 @@ type TestWorkflowStepParallel struct { // delay before the step Delay string `json:"delay,omitempty"` // script to run in a default shell for the container - Shell string `json:"shell,omitempty"` - Run *TestWorkflowStepRun `json:"run,omitempty"` - Execute *TestWorkflowStepExecute `json:"execute,omitempty"` - Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` + Shell string `json:"shell,omitempty"` + Run *TestWorkflowStepRun `json:"run,omitempty"` + Execute *TestWorkflowStepExecute `json:"execute,omitempty"` + Artifacts *TestWorkflowStepArtifacts `json:"artifacts,omitempty"` + // how many resources could be scheduled in parallel + Parallelism int32 `json:"parallelism,omitempty"` + // worker description to display + Description string `json:"description,omitempty"` + Logs *BoxedString `json:"logs,omitempty"` + // list of files to send to parallel steps + Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` + // list of files to fetch from parallel steps + Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` + Template *TestWorkflowTemplateRef `json:"template,omitempty"` Use []TestWorkflowTemplateRef `json:"use,omitempty"` Config map[string]TestWorkflowParameterSchema `json:"config,omitempty"` Content *TestWorkflowContent `json:"content,omitempty"` @@ -43,14 +53,4 @@ type TestWorkflowStepParallel struct { Steps []TestWorkflowStep `json:"steps,omitempty"` After []TestWorkflowStep `json:"after,omitempty"` Events []TestWorkflowEvent `json:"events,omitempty"` - // how many resources could be scheduled in parallel - Parallelism int32 `json:"parallelism,omitempty"` - // worker description to display - Description string `json:"description,omitempty"` - Logs *BoxedString `json:"logs,omitempty"` - // list of files to send to parallel steps - Transfer []TestWorkflowStepParallelTransfer `json:"transfer,omitempty"` - // list of files to fetch from parallel steps - Fetch []TestWorkflowStepParallelFetch `json:"fetch,omitempty"` - Template *TestWorkflowTemplateRef `json:"template,omitempty"` } diff --git a/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go b/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go index fcd905197c2..030ad5dd3cc 100644 --- a/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go +++ b/pkg/tcl/mapperstcl/testworkflows/kube_openapi.go @@ -985,6 +985,7 @@ func MapIndependentServiceSpecKubeToAPI(v testworkflowsv1.IndependentServiceSpec MaxCount: MapIntOrStringToBoxedString(v.MaxCount), Matrix: MapDynamicListMapKubeToAPI(v.Matrix), Shards: MapDynamicListMapKubeToAPI(v.Shards), + Description: v.Description, Pod: common.MapPtr(v.Pod, MapPodConfigKubeToAPI), WorkingDir: MapStringToBoxedString(v.WorkingDir), Image: v.Image, @@ -1013,6 +1014,7 @@ func MapServiceSpecKubeToAPI(v testworkflowsv1.ServiceSpec) testkube.TestWorkflo Matrix: MapDynamicListMapKubeToAPI(v.Matrix), Shards: MapDynamicListMapKubeToAPI(v.Shards), Use: common.MapSlice(v.Use, MapTemplateRefKubeToAPI), + Description: v.Description, Pod: common.MapPtr(v.Pod, MapPodConfigKubeToAPI), WorkingDir: MapStringToBoxedString(v.WorkingDir), Image: v.Image, diff --git a/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go b/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go index b78d120056a..5e13f155209 100644 --- a/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go +++ b/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go @@ -1047,7 +1047,8 @@ func MapIndependentServiceSpecAPIToKube(v testkube.TestWorkflowIndependentServic Matrix: MapDynamicListMapAPIToKube(v.Matrix), Shards: MapDynamicListMapAPIToKube(v.Shards), }, - Pod: common.MapPtr(v.Pod, MapPodConfigAPIToKube), + Description: v.Description, + Pod: common.MapPtr(v.Pod, MapPodConfigAPIToKube), StepRun: testworkflowsv1.StepRun{ ContainerConfig: testworkflowsv1.ContainerConfig{ WorkingDir: MapBoxedStringToString(v.WorkingDir), @@ -1082,7 +1083,8 @@ func MapServiceSpecAPIToKube(v testkube.TestWorkflowServiceSpec) testworkflowsv1 Matrix: MapDynamicListMapAPIToKube(v.Matrix), Shards: MapDynamicListMapAPIToKube(v.Shards), }, - Pod: common.MapPtr(v.Pod, MapPodConfigAPIToKube), + Description: v.Description, + Pod: common.MapPtr(v.Pod, MapPodConfigAPIToKube), StepRun: testworkflowsv1.StepRun{ ContainerConfig: testworkflowsv1.ContainerConfig{ WorkingDir: MapBoxedStringToString(v.WorkingDir), From 3bae2bea5a81aea76602c2c5f46fdfbbf748bc9e Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Tue, 28 May 2024 16:12:23 +0400 Subject: [PATCH 19/39] feat: [TKC-1840] test workflow execution cr (#5478) * feat: test workflow execution cr * fix: test workflow execution name * fix: dep update * fix: map test workflow execution * fix: update status during workflow run * fix: dep update * fix: dep update * docs: test workflow executions * fix: get test workflow execution once * fix: dep update * fix: dep update --- api/v1/testkube.yaml | 39 +++++++ cmd/api-server/main.go | 2 + docs/docs/articles/crds.md | 23 ++-- docs/docs/articles/test-executions.md | 34 +++++- go.mod | 2 +- go.sum | 4 +- .../testkube/model_test_workflow_execution.go | 2 + .../model_test_workflow_execution_cr.go | 16 +++ .../model_test_workflow_execution_request.go | 2 + ...model_test_workflow_execution_status_cr.go | 17 +++ pkg/tcl/apitcl/v1/testworkflows.go | 1 + .../mapperstcl/testworkflows/openapi_kube.go | 106 ++++++++++++++++++ .../testworkflowexecutor/executor.go | 31 ++++- 13 files changed, 256 insertions(+), 23 deletions(-) create mode 100644 pkg/api/v1/testkube/model_test_workflow_execution_cr.go create mode 100644 pkg/api/v1/testkube/model_test_workflow_execution_status_cr.go diff --git a/api/v1/testkube.yaml b/api/v1/testkube.yaml index 9177e706f6c..2a2c4b41aef 100644 --- a/api/v1/testkube.yaml +++ b/api/v1/testkube.yaml @@ -3576,6 +3576,7 @@ paths: - pro parameters: - $ref: "#/components/parameters/ID" + - $ref: "#/components/parameters/TestWorkflowExecutionName" summary: Execute test workflow description: Execute test workflow in the kubernetes cluster operationId: executeTestWorkflow @@ -7488,6 +7489,9 @@ components: description: custom execution name config: $ref: "#/components/schemas/TestWorkflowConfigValue" + testWorkflowExecutionName: + type: string + description: test workflow execution name started the test workflow execution TestWorkflowWithExecution: type: object @@ -7569,6 +7573,9 @@ components: $ref: "#/components/schemas/TestWorkflow" resolvedWorkflow: $ref: "#/components/schemas/TestWorkflow" + testWorkflowExecutionName: + type: string + description: test workflow execution name started the test workflow execution required: - id - name @@ -8914,6 +8921,32 @@ components: additionalProperties: type: string + TestWorkflowExecutionCR: + type: object + required: + - testWorkflow + properties: + testWorkflow: + $ref: "#/components/schemas/ObjectRef" + description: test workflow name and namespace + executionRequest: + $ref: "#/components/schemas/TestWorkflowExecutionRequest" + description: test workflow execution request parameters + status: + $ref: "#/components/schemas/TestWorkflowExecutionStatusCR" + description: test workflow execution status + + TestWorkflowExecutionStatusCR: + type: object + description: test workflow execution status + properties: + latestExecution: + $ref: "#/components/schemas/TestWorkflowExecution" + generation: + type: integer + format: int64 + description: test workflow execution generation + ContentGitAuthType: type: string description: auth type for git requests @@ -9965,6 +9998,12 @@ components: schema: type: string description: test suite execution name stated the test suite execution + TestWorkflowExecutionName: + in: query + name: testWorkflowExecutionName + schema: + type: string + description: test workflow execution name stated the test workflow execution Namespace: in: query name: namespace diff --git a/cmd/api-server/main.go b/cmd/api-server/main.go index 10783befd50..5c8ec8b4a39 100644 --- a/cmd/api-server/main.go +++ b/cmd/api-server/main.go @@ -235,6 +235,7 @@ func main() { testsuiteExecutionsClient := testsuiteexecutionsclientv1.NewClient(kubeClient, cfg.TestkubeNamespace) testWorkflowsClient := testworkflowsclientv1.NewClient(kubeClient, cfg.TestkubeNamespace) testWorkflowTemplatesClient := testworkflowsclientv1.NewTestWorkflowTemplatesClient(kubeClient, cfg.TestkubeNamespace) + testWorkflowExecutionsClient := testworkflowsclientv1.NewTestWorkflowExecutionsClient(kubeClient, cfg.TestkubeNamespace) templatesClient := templatesclientv1.NewClient(kubeClient, cfg.TestkubeNamespace) clientset, err := k8sclient.ConnectToK8s() @@ -593,6 +594,7 @@ func main() { inspector, configMapConfig, resultsRepository, + testWorkflowExecutionsClient, serviceAccountNames, cfg.GlobalWorkflowTemplateName, cfg.TestkubeNamespace, diff --git a/docs/docs/articles/crds.md b/docs/docs/articles/crds.md index dd83e1f99b1..f8d74aede1c 100644 --- a/docs/docs/articles/crds.md +++ b/docs/docs/articles/crds.md @@ -9,17 +9,18 @@ kubectl get crds -n testkube ``` ```sh title="Expected output:" -NAME CREATED AT -executors.executor.testkube.io 2023-06-15T14:49:11Z -scripts.tests.testkube.io 2023-06-15T14:49:11Z -templates.tests.testkube.io 2023-06-15T14:49:11Z -testexecutions.tests.testkube.io 2023-06-15T14:49:11Z -tests.tests.testkube.io 2023-06-15T14:49:11Z -testsources.tests.testkube.io 2023-06-15T14:49:11Z -testsuiteexecutions.tests.testkube.io 2023-06-15T14:49:11Z -testsuites.tests.testkube.io 2023-06-15T14:49:11Z -testtriggers.tests.testkube.io 2023-06-15T14:49:11Z -webhooks.executor.testkube.io 2023-06-15T14:49:11Z +NAME CREATED AT +executors.executor.testkube.io 2023-06-15T14:49:11Z +scripts.tests.testkube.io 2023-06-15T14:49:11Z +templates.tests.testkube.io 2023-06-15T14:49:11Z +testexecutions.tests.testkube.io 2023-06-15T14:49:11Z +tests.tests.testkube.io 2023-06-15T14:49:11Z +testsources.tests.testkube.io 2023-06-15T14:49:11Z +testsuiteexecutions.tests.testkube.io 2023-06-15T14:49:11Z +testsuites.tests.testkube.io 2023-06-15T14:49:11Z +testtriggers.tests.testkube.io 2023-06-15T14:49:11Z +testworkflowexecutions.testworkflows.testkube.io 2023-06-15T14:49:11Z +webhooks.executor.testkube.io 2023-06-15T14:49:11Z ``` To check details on one of the CRDs, use `describe`: diff --git a/docs/docs/articles/test-executions.md b/docs/docs/articles/test-executions.md index 8d1d7c501d8..505bf052d9b 100644 --- a/docs/docs/articles/test-executions.md +++ b/docs/docs/articles/test-executions.md @@ -1,10 +1,10 @@ -# Test and Test Suite Execution CRDs +# Test, Test Suite and Test Workflow Execution CRDs -Testkube allows you to automatically run tests and test suites by creating or updating Test or Test Suite Execution CRDs. +Testkube allows you to automatically run tests, test suites and test workflows by creating or updating Test, Test Suite or Test Workflow Execution CRDs. ## What are Testkube Execution CRDs? -In generic terms, an _Execution_ defines a _test_ or _testsuite_ which will be executed when CRD is created or updated. For example, we could define a _TestExecution_ which _runs_ a _Test_ when a _TestExecution_ gets _modified_. +In generic terms, an _Execution_ defines a _test_, _testsuite_ or _testworkflow_ which will be executed when CRD is created or updated. For example, we could define a _TestExecution_ which _runs_ a _Test_ when a _TestExecution_ gets _modified_. #### Selecting Resource @@ -22,6 +22,13 @@ testSuite: name: Testkube test suite name ``` +or + +```yaml +testWorkflow: + name: Testkube test workflow name +``` + ### Execution Request An Execution Request defines execution parameters for each specific resource. @@ -29,8 +36,10 @@ An Execution Request defines execution parameters for each specific resource. ## Example Here are examples for a **Test Execution** *testexecution-example* which runs the **Test** *test-example* -when a **Test Execution** is created or updated and a **Test Suite Execution** *testsuiteexecution-example* -which runs the **Test Suite** *testsuite-example * when a **Test Suite Execution** is created or updated. +when a **Test Execution** is created or updated, a **Test Suite Execution** *testsuiteexecution-example* +which runs the **Test Suite** *testsuite-example* when a **Test Suite Execution** is created or updated +and **Test Workflow Execution** *testworkflowexecution-example* which runs the **Test Workflow** *testworkflow-example* +when a **Test Workflow Execution** is created or updated ```yaml apiVersion: tests.testkube.io/v1 @@ -64,6 +73,19 @@ spec: type: basic ``` +```yaml +apiVersion: testworkflows.testkube.io/v1 +kind: TestWorkflowExecution +metadata: + name: testworkflowexecution-example +spec: + testWorkflow: + name: testworkflow-example + executionRequest: + config: + browser: "chrome" +``` + ## Architecture -Testkube uses a Kubernetes Operator to reconcile Test and Test Suite Execution CRDs state and run the corresponding test and test suite when resource generation is changed. \ No newline at end of file +Testkube uses a Kubernetes Operator to reconcile Test, Test Suite and Test Workflow Execution CRDs state and run the corresponding test, test suite and test workflow when resource generation is changed. \ No newline at end of file diff --git a/go.mod b/go.mod index 10cb27e92d1..557009685cf 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/kelseyhightower/envconfig v1.4.0 github.com/kubepug/kubepug v1.7.1 - github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240528102239-5e235fc7b611 + github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240528111848-c16a678d8855 github.com/minio/minio-go/v7 v7.0.47 github.com/montanaflynn/stats v0.6.6 github.com/moogar0880/problems v0.1.1 diff --git a/go.sum b/go.sum index 44d2d642a4e..e511a633b2e 100644 --- a/go.sum +++ b/go.sum @@ -358,8 +358,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kubepug/kubepug v1.7.1 h1:LKhfSxS8Y5mXs50v+3Lpyec+cogErDLcV7CMUuiaisw= github.com/kubepug/kubepug v1.7.1/go.mod h1:lv+HxD0oTFL7ZWjj0u6HKhMbbTIId3eG7aWIW0gyF8g= -github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240528102239-5e235fc7b611 h1:nlp3YjeEQZ9huo1BbvZbi5ouXeJWfsZJER9UBt3s/+g= -github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240528102239-5e235fc7b611/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk= +github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240528111848-c16a678d8855 h1:zFQaa1fGiuccZf1QV5qzgwGBtJ5YVDr/sIhnApi2UGs= +github.com/kubeshop/testkube-operator v1.15.2-beta1.0.20240528111848-c16a678d8855/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8LFgLN4= diff --git a/pkg/api/v1/testkube/model_test_workflow_execution.go b/pkg/api/v1/testkube/model_test_workflow_execution.go index 6f6cd24cdb4..e4ebf39b57b 100644 --- a/pkg/api/v1/testkube/model_test_workflow_execution.go +++ b/pkg/api/v1/testkube/model_test_workflow_execution.go @@ -35,4 +35,6 @@ type TestWorkflowExecution struct { Reports []TestWorkflowReport `json:"reports,omitempty"` Workflow *TestWorkflow `json:"workflow"` ResolvedWorkflow *TestWorkflow `json:"resolvedWorkflow,omitempty"` + // test workflow execution name started the test workflow execution + TestWorkflowExecutionName string `json:"testWorkflowExecutionName,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_execution_cr.go b/pkg/api/v1/testkube/model_test_workflow_execution_cr.go new file mode 100644 index 00000000000..a80bad3d99a --- /dev/null +++ b/pkg/api/v1/testkube/model_test_workflow_execution_cr.go @@ -0,0 +1,16 @@ +/* + * Testkube API + * + * Testkube provides a Kubernetes-native framework for test definition, execution and results + * + * API version: 1.0.0 + * Contact: testkube@kubeshop.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package testkube + +type TestWorkflowExecutionCr struct { + TestWorkflow *ObjectRef `json:"testWorkflow"` + ExecutionRequest *TestWorkflowExecutionRequest `json:"executionRequest,omitempty"` + Status *TestWorkflowExecutionStatusCr `json:"status,omitempty"` +} diff --git a/pkg/api/v1/testkube/model_test_workflow_execution_request.go b/pkg/api/v1/testkube/model_test_workflow_execution_request.go index ccd4d0db8a4..7b86a2c2417 100644 --- a/pkg/api/v1/testkube/model_test_workflow_execution_request.go +++ b/pkg/api/v1/testkube/model_test_workflow_execution_request.go @@ -13,4 +13,6 @@ type TestWorkflowExecutionRequest struct { // custom execution name Name string `json:"name,omitempty"` Config map[string]string `json:"config,omitempty"` + // test workflow execution name started the test workflow execution + TestWorkflowExecutionName string `json:"testWorkflowExecutionName,omitempty"` } diff --git a/pkg/api/v1/testkube/model_test_workflow_execution_status_cr.go b/pkg/api/v1/testkube/model_test_workflow_execution_status_cr.go new file mode 100644 index 00000000000..2affdb1ba32 --- /dev/null +++ b/pkg/api/v1/testkube/model_test_workflow_execution_status_cr.go @@ -0,0 +1,17 @@ +/* + * Testkube API + * + * Testkube provides a Kubernetes-native framework for test definition, execution and results + * + * API version: 1.0.0 + * Contact: testkube@kubeshop.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package testkube + +// test workflow execution status +type TestWorkflowExecutionStatusCr struct { + LatestExecution *TestWorkflowExecution `json:"latestExecution,omitempty"` + // test workflow execution generation + Generation int64 `json:"generation,omitempty"` +} diff --git a/pkg/tcl/apitcl/v1/testworkflows.go b/pkg/tcl/apitcl/v1/testworkflows.go index 04bf0c7e5af..1c4703d8d0e 100644 --- a/pkg/tcl/apitcl/v1/testworkflows.go +++ b/pkg/tcl/apitcl/v1/testworkflows.go @@ -281,6 +281,7 @@ func (s *apiTCL) ExecuteTestWorkflowHandler() fiber.Handler { var results []testkube.TestWorkflowExecution var errs []error + request.TestWorkflowExecutionName = strings.Clone(c.Query("testWorkflowExecutionName")) concurrencyLevel := scheduler.DefaultConcurrencyLevel workerpoolService := workerpool.New[testworkflowsv1.TestWorkflow, testkube.TestWorkflowExecutionRequest, testkube.TestWorkflowExecution](concurrencyLevel) diff --git a/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go b/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go index 5e13f155209..1f06cb0020f 100644 --- a/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go +++ b/pkg/tcl/mapperstcl/testworkflows/openapi_kube.go @@ -1286,3 +1286,109 @@ func MapTemplateListAPIToKube(v []testkube.TestWorkflowTemplate) testworkflowsv1 Items: items, } } + +func MapTestWorkflowReportSummaryAPIToKube(v testkube.TestWorkflowReportSummary) testworkflowsv1.TestWorkflowReportSummary { + return testworkflowsv1.TestWorkflowReportSummary{ + Tests: v.Tests, + Passed: v.Passed, + Failed: v.Failed, + Skipped: v.Skipped, + Errored: v.Errored, + Duration: v.Duration, + } +} + +func MapTestWorkflowReportAPIToKube(v testkube.TestWorkflowReport) testworkflowsv1.TestWorkflowReport { + return testworkflowsv1.TestWorkflowReport{ + Ref: v.Ref, + Kind: v.Kind, + File: v.File, + Summary: common.MapPtr(v.Summary, MapTestWorkflowReportSummaryAPIToKube), + } +} + +func MapTestWorkflowStepResultAPIToKube(v testkube.TestWorkflowStepResult) testworkflowsv1.TestWorkflowStepResult { + return testworkflowsv1.TestWorkflowStepResult{ + ErrorMessage: v.ErrorMessage, + Status: common.MapPtr(v.Status, func(status testkube.TestWorkflowStepStatus) testworkflowsv1.TestWorkflowStepStatus { + return (testworkflowsv1.TestWorkflowStepStatus)(status) + }), + ExitCode: int64(v.ExitCode), + QueuedAt: metav1.Time{Time: v.QueuedAt}, + StartedAt: metav1.Time{Time: v.StartedAt}, + FinishedAt: metav1.Time{Time: v.FinishedAt}, + } +} + +func MapTestWorkflowOutputAPIToKube(v testkube.TestWorkflowOutput) testworkflowsv1.TestWorkflowOutput { + return testworkflowsv1.TestWorkflowOutput{ + Ref: v.Ref, + Name: v.Name, + Value: MapDynamicListMapAPIToKube(v.Value), + } +} + +func MapTestWorkflowPauseAPIToKube(v testkube.TestWorkflowPause) testworkflowsv1.TestWorkflowPause { + return testworkflowsv1.TestWorkflowPause{ + Ref: v.Ref, + PausedAt: metav1.Time{Time: v.PausedAt}, + ResumedAt: metav1.Time{Time: v.ResumedAt}, + } +} + +func MapTestWorkflowResultAPIToKube(v testkube.TestWorkflowResult) testworkflowsv1.TestWorkflowResult { + return testworkflowsv1.TestWorkflowResult{ + Status: common.MapPtr(v.Status, func(status testkube.TestWorkflowStatus) testworkflowsv1.TestWorkflowStatus { + return (testworkflowsv1.TestWorkflowStatus)(status) + }), + PredictedStatus: common.MapPtr(v.Status, func(status testkube.TestWorkflowStatus) testworkflowsv1.TestWorkflowStatus { + return (testworkflowsv1.TestWorkflowStatus)(status) + }), + QueuedAt: metav1.Time{Time: v.QueuedAt}, + StartedAt: metav1.Time{Time: v.StartedAt}, + FinishedAt: metav1.Time{Time: v.FinishedAt}, + Duration: v.Duration, + TotalDuration: v.TotalDuration, + DurationMs: v.DurationMs, + PausedMs: v.PausedMs, + TotalDurationMs: v.TotalDurationMs, + Pauses: common.MapSlice(v.Pauses, MapTestWorkflowPauseAPIToKube), + Initialization: common.MapPtr(v.Initialization, MapTestWorkflowStepResultAPIToKube), + Steps: common.MapMap(v.Steps, MapTestWorkflowStepResultAPIToKube), + } +} +func MapTestWorkflowSignatureAPIToKube(v testkube.TestWorkflowSignature) testworkflowsv1.TestWorkflowSignature { + return testworkflowsv1.TestWorkflowSignature{ + Ref: v.Ref, + Name: v.Name, + Category: v.Category, + Optional: v.Optional, + Negative: v.Negative, + Children: common.MapSlice(v.Children, MapTestWorkflowSignatureAPIToKube), + } +} + +func MapTestWorkflowExecutionAPIToKube(v *testkube.TestWorkflowExecution) *testworkflowsv1.TestWorkflowExecutionDetails { + return &testworkflowsv1.TestWorkflowExecutionDetails{ + Id: v.Id, + Name: v.Name, + Namespace: v.Namespace, + Number: v.Number, + ScheduledAt: metav1.Time{Time: v.ScheduledAt}, + StatusAt: metav1.Time{Time: v.StatusAt}, + Signature: common.MapSlice(v.Signature, MapTestWorkflowSignatureAPIToKube), + Result: common.MapPtr(v.Result, MapTestWorkflowResultAPIToKube), + Output: common.MapSlice(v.Output, MapTestWorkflowOutputAPIToKube), + Reports: common.MapSlice(v.Reports, MapTestWorkflowReportAPIToKube), + Workflow: common.MapPtr(v.Workflow, MapTestWorkflowAPIToKube), + ResolvedWorkflow: common.MapPtr(v.ResolvedWorkflow, MapTestWorkflowAPIToKube), + TestWorkflowExecutionName: v.TestWorkflowExecutionName, + } +} + +func MapTestWorkflowExecutionStatusAPIToKube(v *testkube.TestWorkflowExecution, generation int64) testworkflowsv1.TestWorkflowExecutionStatus { + return testworkflowsv1.TestWorkflowExecutionStatus{ + LatestExecution: MapTestWorkflowExecutionAPIToKube(v), + Generation: generation, + } +} diff --git a/pkg/tcl/testworkflowstcl/testworkflowexecutor/executor.go b/pkg/tcl/testworkflowstcl/testworkflowexecutor/executor.go index 33670b6f35b..436aa128795 100644 --- a/pkg/tcl/testworkflowstcl/testworkflowexecutor/executor.go +++ b/pkg/tcl/testworkflowstcl/testworkflowexecutor/executor.go @@ -63,6 +63,7 @@ type executor struct { imageInspector imageinspector.Inspector configMap configRepo.Repository executionResults result.Repository + testWorkflowExecutionsClient testworkflowsclientv1.TestWorkflowExecutionsInterface globalTemplateName string apiUrl string namespace string @@ -80,6 +81,7 @@ func New(emitter *event.Emitter, imageInspector imageinspector.Inspector, configMap configRepo.Repository, executionResults result.Repository, + testWorkflowExecutionsClient testworkflowsclientv1.TestWorkflowExecutionsInterface, serviceAccountNames map[string]string, globalTemplateName, namespace, apiUrl, defaultRegistry string, enableImageDataPersistentCache bool, imageDataPersistentCacheKey string) TestWorkflowExecutor { @@ -96,6 +98,7 @@ func New(emitter *event.Emitter, imageInspector: imageInspector, configMap: configMap, executionResults: executionResults, + testWorkflowExecutionsClient: testWorkflowExecutionsClient, serviceAccountNames: serviceAccountNames, globalTemplateName: globalTemplateName, apiUrl: apiUrl, @@ -148,6 +151,15 @@ func (e *executor) Recover(ctx context.Context) { } } +func (e *executor) updateStatus(execution *testkube.TestWorkflowExecution, testWorkflowExecution *testworkflowsv1.TestWorkflowExecution) { + if testWorkflowExecution != nil { + testWorkflowExecution.Status = testworkflowmappers.MapTestWorkflowExecutionStatusAPIToKube(execution, testWorkflowExecution.Generation) + if err := e.testWorkflowExecutionsClient.UpdateStatus(testWorkflowExecution); err != nil { + log.DefaultLogger.Errorw("failed to update test workflow execution", "error", err) + } + } +} + func (e *executor) Control(ctx context.Context, execution *testkube.TestWorkflowExecution) error { ctrl, err := testworkflowcontroller.New(ctx, e.clientSet, execution.GetNamespace(e.namespace), execution.Id, execution.ScheduledAt) if err != nil { @@ -161,6 +173,14 @@ func (e *executor) Control(ctx context.Context, execution *testkube.TestWorkflow reader := bufio.NewReader(r) ref := "" + var testWorkflowExecution *testworkflowsv1.TestWorkflowExecution + if execution.TestWorkflowExecutionName != "" { + testWorkflowExecution, err = e.testWorkflowExecutionsClient.Get(execution.TestWorkflowExecutionName) + if err != nil { + log.DefaultLogger.Errorw("failed to get test workflow execution", "error", err) + } + } + wg := sync.WaitGroup{} wg.Add(1) go func() { @@ -195,6 +215,8 @@ func (e *executor) Control(ctx context.Context, execution *testkube.TestWorkflow log.DefaultLogger.Error(errors.Wrap(err, "saving log output content")) } } + + e.updateStatus(execution, testWorkflowExecution) } // Try to gracefully handle abort @@ -260,6 +282,7 @@ func (e *executor) Control(ctx context.Context, execution *testkube.TestWorkflow wg.Wait() + e.updateStatus(execution, testWorkflowExecution) err = testworkflowcontroller.Cleanup(ctx, e.clientSet, execution.GetNamespace(e.namespace), execution.Id) if err != nil { log.DefaultLogger.Errorw("failed to cleanup TestWorkflow resources", "id", execution.Id, "error", err) @@ -411,6 +434,7 @@ func (e *executor) Execute(ctx context.Context, workflow testworkflowsv1.TestWor executionName = fmt.Sprintf("%s-%d", workflow.Name, number) } + testWorkflowExecutionName := request.TestWorkflowExecutionName // Ensure it is unique name // TODO: Consider if we shouldn't make name unique across all TestWorkflows next, _ := e.repository.GetByNameAndTestWorkflow(ctx, executionName, workflow.Name) @@ -436,9 +460,10 @@ func (e *executor) Execute(ctx context.Context, workflow testworkflowsv1.TestWor }, Steps: testworkflowprocessor.MapSignatureListToStepResults(bundle.Signature), }, - Output: []testkube.TestWorkflowOutput{}, - Workflow: testworkflowmappers.MapKubeToAPI(initialWorkflow), - ResolvedWorkflow: testworkflowmappers.MapKubeToAPI(resolvedWorkflow), + Output: []testkube.TestWorkflowOutput{}, + Workflow: testworkflowmappers.MapKubeToAPI(initialWorkflow), + ResolvedWorkflow: testworkflowmappers.MapKubeToAPI(resolvedWorkflow), + TestWorkflowExecutionName: testWorkflowExecutionName, } err = e.repository.Insert(ctx, execution) if err != nil { From 189657ac5d1830a20f2e0bd60e17ff961ca463e1 Mon Sep 17 00:00:00 2001 From: Jacek Wysocki Date: Wed, 29 May 2024 07:51:19 +0200 Subject: [PATCH 20/39] fix: agent send healthcheck each 5 seconds (#5508) --- pkg/agent/events.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/agent/events.go b/pkg/agent/events.go index 2580dfb26ce..42cd201d5c0 100644 --- a/pkg/agent/events.go +++ b/pkg/agent/events.go @@ -18,6 +18,8 @@ import ( var _ common.ListenerLoader = (*Agent)(nil) +const HealthcheckInterval = 5 * time.Second + func (ag *Agent) Kind() string { return "agent" } @@ -70,7 +72,7 @@ func (ag *Agent) runEventLoop(ctx context.Context) error { return errors.Wrap(err, "failed to setup stream") } - ticker := time.NewTicker(30 * time.Second) + ticker := time.NewTicker(HealthcheckInterval) defer ticker.Stop() for { From f7bbea525add442fa06bd28160ada0a1b166ab7f Mon Sep 17 00:00:00 2001 From: nicufk Date: Wed, 29 May 2024 11:08:40 +0300 Subject: [PATCH 21/39] fix: port-forward minio when opening the dashboard for enterprise (#5483) --- cmd/kubectl-testkube/commands/dashboard.go | 6 +++++ cmd/kubectl-testkube/config/storage.go | 27 ++++++++++++---------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/cmd/kubectl-testkube/commands/dashboard.go b/cmd/kubectl-testkube/commands/dashboard.go index 26194e024db..e8845b4346d 100644 --- a/cmd/kubectl-testkube/commands/dashboard.go +++ b/cmd/kubectl-testkube/commands/dashboard.go @@ -85,6 +85,12 @@ func openOnPremDashboard(cmd *cobra.Command, cfg config.Data, verbose bool, lice } ui.ExitOnError("port forwarding dex", err) + err = k8sclient.PortForward(ctx, cfg.Namespace, config.EnterpriseMinioName, config.EnterpriseMinioPort, config.EnterpriseMinioPortFrwardingPort, verbose) + if err != nil { + errs = append(errs, err) + } + ui.PrintOnError("port forwarding minio", err) + err = open.Run(uri) if err != nil { sendErrTelemetry(cmd, cfg, "open_dashboard", license, "opening dashboard", err) diff --git a/cmd/kubectl-testkube/config/storage.go b/cmd/kubectl-testkube/config/storage.go index fc11c1a502f..236ba86a6e8 100644 --- a/cmd/kubectl-testkube/config/storage.go +++ b/cmd/kubectl-testkube/config/storage.go @@ -9,18 +9,21 @@ import ( ) const ( - APIServerName string = "testkube-api-server" - APIServerPort int = 8088 - DashboardName string = "testkube-dashboard" - DashboardPort int = 8080 - EnterpriseUiName string = "testkube-enterprise-ui" - EnterpriseUiPort int = 8080 - EnterpriseApiName string = "testkube-enterprise-api" - EnterpriseApiPort int = 8088 - EnterpriseApiForwardingPort int = 8090 - EnterpriseDexName string = "testkube-enterprise-dex" - EnterpriseDexPort int = 5556 - EnterpriseDexForwardingPort int = 5556 + APIServerName string = "testkube-api-server" + APIServerPort int = 8088 + DashboardName string = "testkube-dashboard" + DashboardPort int = 8080 + EnterpriseUiName string = "testkube-enterprise-ui" + EnterpriseUiPort int = 8080 + EnterpriseApiName string = "testkube-enterprise-api" + EnterpriseApiPort int = 8088 + EnterpriseApiForwardingPort int = 8090 + EnterpriseDexName string = "testkube-enterprise-dex" + EnterpriseDexPort int = 5556 + EnterpriseDexForwardingPort int = 5556 + EnterpriseMinioName string = "testkube-enterprise-minio" + EnterpriseMinioPort int = 9000 + EnterpriseMinioPortFrwardingPort int = 9000 configDirName = ".testkube" configFile = "config.json" From 3b1d55ff1de58e052007330c96611feec7bb24f2 Mon Sep 17 00:00:00 2001 From: nicufk Date: Wed, 29 May 2024 13:51:33 +0300 Subject: [PATCH 22/39] fix: dashboard undefined error (#5510) --- cmd/kubectl-testkube/commands/dashboard.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/kubectl-testkube/commands/dashboard.go b/cmd/kubectl-testkube/commands/dashboard.go index e8845b4346d..82bd0292937 100644 --- a/cmd/kubectl-testkube/commands/dashboard.go +++ b/cmd/kubectl-testkube/commands/dashboard.go @@ -87,9 +87,9 @@ func openOnPremDashboard(cmd *cobra.Command, cfg config.Data, verbose bool, lice err = k8sclient.PortForward(ctx, cfg.Namespace, config.EnterpriseMinioName, config.EnterpriseMinioPort, config.EnterpriseMinioPortFrwardingPort, verbose) if err != nil { - errs = append(errs, err) + sendTelemetry(cmd, cfg, license, "port forwarding minio") } - ui.PrintOnError("port forwarding minio", err) + ui.ExitOnError("port forwarding minio", err) err = open.Run(uri) if err != nil { From 801d12b9a102329accffb37ebfce17d0dad0f178 Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Wed, 22 May 2024 13:09:19 +0300 Subject: [PATCH 23/39] fix: add output option --- cmd/kubectl-testkube/commands/run.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/kubectl-testkube/commands/run.go b/cmd/kubectl-testkube/commands/run.go index ac921fc6055..6a21c695c3f 100644 --- a/cmd/kubectl-testkube/commands/run.go +++ b/cmd/kubectl-testkube/commands/run.go @@ -34,5 +34,8 @@ func NewRunCmd() *cobra.Command { cmd.AddCommand(testsuites.NewRunTestSuiteCmd()) cmd.AddCommand(testworkflows.NewRunTestWorkflowCmd()) + cmd.PersistentFlags().StringP("output", "o", "pretty", "output type can be one of json|yaml|pretty|go") + cmd.PersistentFlags().StringP("go-template", "", "{{.}}", "go template to render") + return cmd } From abf0b61a9282b1c9e2d4d0a6fd0184ee7a28c516 Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Tue, 28 May 2024 20:15:33 +0300 Subject: [PATCH 24/39] feat: run output fro test --- cmd/kubectl-testkube/commands/download.go | 6 +- cmd/kubectl-testkube/commands/tests/common.go | 94 +++++++++++++------ cmd/kubectl-testkube/commands/tests/run.go | 59 ++++++++---- .../commands/testsuites/common.go | 4 +- .../commands/testsuites/run.go | 2 +- pkg/ui/ui.go | 17 +++- 6 files changed, 121 insertions(+), 61 deletions(-) diff --git a/cmd/kubectl-testkube/commands/download.go b/cmd/kubectl-testkube/commands/download.go index f587ea49430..622fa91de89 100644 --- a/cmd/kubectl-testkube/commands/download.go +++ b/cmd/kubectl-testkube/commands/download.go @@ -133,12 +133,12 @@ func NewDownloadAllArtifactsCmd() *cobra.Command { execution, err := client.GetExecution(executionID) if err == nil && execution.Id != "" { - tests.DownloadTestArtifacts(executionID, downloadDir, format, masks, client) + tests.DownloadTestArtifacts(executionID, downloadDir, format, masks, client, true) return } twExecution, err := client.GetTestWorkflowExecution(executionID) if err == nil && twExecution.Id != "" { - tests.DownloadTestWorkflowArtifacts(executionID, downloadDir, format, masks, client) + tests.DownloadTestWorkflowArtifacts(executionID, downloadDir, format, masks, client, true) return } }, @@ -166,7 +166,7 @@ func NewDownloadTestSuiteArtifactsCmd() *cobra.Command { client, _, err := common.GetClient(cmd) ui.ExitOnError("getting client", err) - testsuites.DownloadArtifacts(executionID, downloadDir, format, masks, client) + testsuites.DownloadArtifacts(executionID, downloadDir, format, masks, client, true) }, } diff --git a/cmd/kubectl-testkube/commands/tests/common.go b/cmd/kubectl-testkube/commands/tests/common.go index 6c71c528644..eb233fe399e 100644 --- a/cmd/kubectl-testkube/commands/tests/common.go +++ b/cmd/kubectl-testkube/commands/tests/common.go @@ -14,6 +14,7 @@ import ( "github.com/spf13/cobra" "github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/common" + "github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/common/render" "github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/renderer" "github.com/kubeshop/testkube/pkg/api/v1/client" apiclientv1 "github.com/kubeshop/testkube/pkg/api/v1/client" @@ -29,30 +30,50 @@ const ( maxArgSize = int64(131072) // maximum argument size in linux-based systems is 128 KiB ) -func printExecutionDetails(execution testkube.Execution) { - ui.Warn("Type: ", execution.TestType) - ui.Warn("Name: ", execution.TestName) - if execution.Id != "" { - ui.Warn("Execution ID: ", execution.Id) - ui.Warn("Execution name: ", execution.Name) - if execution.Number != 0 { - ui.Warn("Execution number: ", fmt.Sprintf("%d", execution.Number)) - } - if execution.ExecutionResult != nil && execution.ExecutionResult.Status != nil { - ui.Warn("Status: ", string(*execution.ExecutionResult.Status)) +func printExecutionDetails(cmd *cobra.Command, execution testkube.Execution) error { + outputFlag := cmd.Flag("output") + outputType := render.OutputPretty + if outputFlag != nil { + outputType = render.OutputType(outputFlag.Value.String()) + } + + switch outputType { + case render.OutputPretty: + ui.Warn("Type: ", execution.TestType) + ui.Warn("Name: ", execution.TestName) + if execution.Id != "" { + ui.Warn("Execution ID: ", execution.Id) + ui.Warn("Execution name: ", execution.Name) + if execution.Number != 0 { + ui.Warn("Execution number: ", fmt.Sprintf("%d", execution.Number)) + } + if execution.ExecutionResult != nil && execution.ExecutionResult.Status != nil { + ui.Warn("Status: ", string(*execution.ExecutionResult.Status)) + } + ui.Warn("Start time: ", execution.StartTime.String()) + ui.Warn("End time: ", execution.EndTime.String()) + ui.Warn("Duration: ", execution.Duration) } - ui.Warn("Start time: ", execution.StartTime.String()) - ui.Warn("End time: ", execution.EndTime.String()) - ui.Warn("Duration: ", execution.Duration) - } - renderer.RenderVariables(execution.Variables) + renderer.RenderVariables(execution.Variables) - ui.NL() - ui.NL() + ui.NL() + ui.NL() + case render.OutputYAML: + return render.RenderYaml(execution, os.Stdout) + case render.OutputJSON: + return render.RenderJSON(execution, os.Stdout) + case render.OutputGoTemplate: + tpl := cmd.Flag("go-template").Value.String() + return render.RenderGoTemplate(execution, os.Stdout, tpl) + default: + return render.RenderYaml(execution, os.Stdout) + } + + return nil } -func DownloadTestArtifacts(id, dir, format string, masks []string, client apiclientv1.Client) { +func DownloadTestArtifacts(id, dir, format string, masks []string, client apiclientv1.Client, outputPretty bool) { artifacts, err := client.GetExecutionArtifacts(id) ui.ExitOnError("getting artifacts", err) @@ -62,10 +83,10 @@ func DownloadTestArtifacts(id, dir, format string, masks []string, client apicli downloadArchive := func(dir string, masks []string) (string, error) { return client.DownloadArchive(id, dir, masks) } - downloadArtifacts(dir, format, masks, artifacts, downloadFile, downloadArchive) + downloadArtifacts(dir, format, masks, artifacts, downloadFile, downloadArchive, outputPretty) } -func DownloadTestWorkflowArtifacts(id, dir, format string, masks []string, client apiclientv1.Client) { +func DownloadTestWorkflowArtifacts(id, dir, format string, masks []string, client apiclientv1.Client, outputPretty bool) { artifacts, err := client.GetTestWorkflowExecutionArtifacts(id) ui.ExitOnError("getting artifacts", err) @@ -75,7 +96,7 @@ func DownloadTestWorkflowArtifacts(id, dir, format string, masks []string, clien downloadArchive := func(dir string, masks []string) (string, error) { return client.DownloadTestWorkflowArtifactArchive(id, dir, masks) } - downloadArtifacts(dir, format, masks, artifacts, downloadFile, downloadArchive) + downloadArtifacts(dir, format, masks, artifacts, downloadFile, downloadArchive, outputPretty) } func downloadArtifacts( @@ -84,11 +105,12 @@ func downloadArtifacts( artifacts testkube.Artifacts, downloadFile func(artifact testkube.Artifact, dir string) (string, error), downloadArchive func(dir string, masks []string) (string, error), + outputPretty bool, ) { err := os.MkdirAll(dir, os.ModePerm) ui.ExitOnError("creating dir "+dir, err) - if len(artifacts) > 0 { + if len(artifacts) > 0 && outputPretty { ui.Info("Getting artifacts", fmt.Sprintf("count = %d", len(artifacts)), "\n") } @@ -122,7 +144,9 @@ func downloadArtifacts( f, err := downloadFile(artifact, dir) ui.ExitOnError("downloading file: "+f, err) - ui.Warn(" - downloading file ", f) + if outputPretty { + ui.Warn(" - downloading file ", f) + } } } @@ -142,24 +166,34 @@ func downloadArtifacts( }() var archive string - ui.Warn(" - preparing archive ") + if outputPretty { + ui.Warn(" - preparing archive ") + } outloop: for { select { case <-ticker.C: - ui.PrintDot() + if outputPretty { + ui.PrintDot() + } case archive = <-ch: - ui.NL() + if outputPretty { + ui.NL() + } break outloop } } - ui.Warn(" - downloading archive ", archive) + if outputPretty { + ui.Warn(" - downloading archive ", archive) + } } - ui.NL() - ui.NL() + if outputPretty { + ui.NL() + ui.NL() + } } func watchLogs(id string, silentMode bool, client apiclientv1.Client) error { diff --git a/cmd/kubectl-testkube/commands/tests/run.go b/cmd/kubectl-testkube/commands/tests/run.go index 59ec3413fb7..fbe99a59d8e 100644 --- a/cmd/kubectl-testkube/commands/tests/run.go +++ b/cmd/kubectl-testkube/commands/tests/run.go @@ -94,20 +94,27 @@ func NewRunTestCmd() *cobra.Command { if attachDebugger { watchEnabled = true } + outputFlag := cmd.Flag("output") + outputType := render.OutputPretty + if outputFlag != nil { + outputType = render.OutputType(outputFlag.Value.String()) + } + + outputPretty := outputType == render.OutputPretty envs, err := cmd.Flags().GetStringToString("env") - ui.WarnOnError("getting envs", err) + ui.WarnOnErrorAndOutputPretty("getting envs", outputPretty, err) client, _, err := common.GetClient(cmd) ui.ExitOnError("getting client", err) info, err := client.GetServerInfo() - ui.WarnOnError("getting server info", err) + ui.WarnOnErrorAndOutputPretty("getting server info", outputPretty, err) variables, err := common.CreateVariables(cmd, info.DisableSecretCreation) - ui.WarnOnError("getting variables", err) + ui.WarnOnErrorAndOutputPretty("getting variables", outputPretty, err) envConfigMaps, envSecrets, err := newEnvReferencesFromFlags(cmd) - ui.WarnOnError("getting env config maps and secrets", err) + ui.WarnOnErrorAndOutputPretty("getting env config maps and secrets", outputPretty, err) mode := "" if cmd.Flag("args-mode").Changed { @@ -287,7 +294,9 @@ func NewRunTestCmd() *cobra.Command { copyFileList, err := mergeCopyFiles(test.Uploads, copyFiles) ui.ExitOnError("could not merge files", err) - ui.Warn("Testkube will use the following file mappings:", copyFileList...) + if outputPretty { + ui.Warn("Testkube will use the following file mappings:", copyFileList...) + } } var eventsDebugger *debugger.EventsDebugger @@ -295,7 +304,7 @@ func NewRunTestCmd() *cobra.Command { writer := os.Stderr if debugFile != "" { writer, err = os.Create(debugFile) - ui.WarnOnError("creating debug file", err) + ui.WarnOnErrorAndOutputPretty("creating debug file", outputPretty, err) } i := debugger.NewInsights().WithWriter(writer) @@ -331,7 +340,7 @@ func NewRunTestCmd() *cobra.Command { var execErrors []error for _, execution := range executions { - printExecutionDetails(execution) + printExecutionDetails(cmd, execution) if execution.ExecutionResult != nil && execution.ExecutionResult.ErrorMessage != "" { execErrors = append(execErrors, errors.New(execution.ExecutionResult.ErrorMessage)) @@ -342,13 +351,15 @@ func NewRunTestCmd() *cobra.Command { info, err := client.GetServerInfo() ui.ExitOnError("getting server info", err) - if info.Features != nil && info.Features.LogsV2 { - if err = watchLogsV2(execution.Id, silentMode, client); err != nil { - execErrors = append(execErrors, err) - } - } else { - if err = watchLogs(execution.Id, silentMode, client); err != nil { - execErrors = append(execErrors, err) + if outputPretty { + if info.Features != nil && info.Features.LogsV2 { + if err = watchLogsV2(execution.Id, silentMode, client); err != nil { + execErrors = append(execErrors, err) + } + } else { + if err = watchLogs(execution.Id, silentMode, client); err != nil { + execErrors = append(execErrors, err) + } } } } @@ -357,28 +368,36 @@ func NewRunTestCmd() *cobra.Command { ui.ExitOnError("getting recent execution data id:"+execution.Id, err) } - if err = render.RenderExecutionResult(client, &execution, false, !watchEnabled); err != nil { - execErrors = append(execErrors, err) + if outputPretty { + if err = render.RenderExecutionResult(client, &execution, false, !watchEnabled); err != nil { + execErrors = append(execErrors, err) + } } if execution.Id != "" { if watchEnabled && len(args) > 0 { if downloadArtifactsEnabled && (execution.IsPassed() || execution.IsFailed()) { - DownloadTestArtifacts(execution.Id, downloadDir, format, masks, client) + DownloadTestArtifacts(execution.Id, downloadDir, format, masks, client, outputPretty) } } - uiShellWatchExecution(execution.Name) + if outputPretty { + uiShellWatchExecution(execution.Name) + } } - uiShellGetExecution(execution.Name) + if outputPretty { + uiShellGetExecution(execution.Name) + } } ui.ExitOnError("executions contain failed on errors", execErrors...) if attachDebugger { // Wait to catch logs from attached debugger after job completed time.Sleep(3 * time.Second) - ui.Success("Debugger stopped") + if outputPretty { + ui.Success("Debugger stopped") + } } }, } diff --git a/cmd/kubectl-testkube/commands/testsuites/common.go b/cmd/kubectl-testkube/commands/testsuites/common.go index fade97d72da..ffb6a0a99b6 100644 --- a/cmd/kubectl-testkube/commands/testsuites/common.go +++ b/cmd/kubectl-testkube/commands/testsuites/common.go @@ -433,7 +433,7 @@ func NewTestSuiteUpdateOptionsFromFlags(cmd *cobra.Command) (options apiclientv1 return options, nil } -func DownloadArtifacts(id, dir, format string, masks []string, client apiclientv1.Client) { +func DownloadArtifacts(id, dir, format string, masks []string, client apiclientv1.Client, outputPretty bool) { testSuiteExecution, err := client.GetTestSuiteExecution(id) ui.ExitOnError("getting test suite execution ", err) @@ -441,7 +441,7 @@ func DownloadArtifacts(id, dir, format string, masks []string, client apiclientv for _, step := range execution.Execute { if step.Execution != nil && step.Step != nil && step.Step.Test != "" { if step.Execution.IsPassed() || step.Execution.IsFailed() { - tests.DownloadTestArtifacts(step.Execution.Id, filepath.Join(dir, step.Execution.TestName+"-"+step.Execution.Id), format, masks, client) + tests.DownloadTestArtifacts(step.Execution.Id, filepath.Join(dir, step.Execution.TestName+"-"+step.Execution.Id), format, masks, client, outputPretty) } } } diff --git a/cmd/kubectl-testkube/commands/testsuites/run.go b/cmd/kubectl-testkube/commands/testsuites/run.go index fabd9f1ce59..044cea158b2 100644 --- a/cmd/kubectl-testkube/commands/testsuites/run.go +++ b/cmd/kubectl-testkube/commands/testsuites/run.go @@ -178,7 +178,7 @@ func NewRunTestSuiteCmd() *cobra.Command { if execution.Id != "" { if watchEnabled && len(args) > 0 { if downloadArtifactsEnabled { - DownloadArtifacts(execution.Id, downloadDir, format, masks, client) + DownloadArtifacts(execution.Id, downloadDir, format, masks, client, true) } } diff --git a/pkg/ui/ui.go b/pkg/ui/ui.go index 2b1773e63fa..de98c9de7cd 100644 --- a/pkg/ui/ui.go +++ b/pkg/ui/ui.go @@ -46,11 +46,18 @@ type UI struct { Writer io.Writer } -func SetVerbose(verbose bool) { ui.Verbose = verbose } -func IsVerbose() bool { return ui.Verbose } -func ExitOnError(item string, errors ...error) { ui.ExitOnError(item, errors...) } -func PrintOnError(item string, errors ...error) { ui.PrintOnError(item, errors...) } -func WarnOnError(item string, errors ...error) { ui.WarnOnError(item, errors...) } +func SetVerbose(verbose bool) { ui.Verbose = verbose } +func IsVerbose() bool { return ui.Verbose } +func ExitOnError(item string, errors ...error) { ui.ExitOnError(item, errors...) } +func PrintOnError(item string, errors ...error) { ui.PrintOnError(item, errors...) } +func WarnOnError(item string, errors ...error) { ui.WarnOnError(item, errors...) } +func WarnOnErrorAndOutputPretty(item string, outputPretty bool, errors ...error) { + if outputPretty { + return + } + + ui.WarnOnError(item, errors...) +} func Logo() { ui.Logo() } func LogoNoColor() { ui.LogoNoColor() } func NL(amount ...int) { ui.NL(amount...) } From 78f4cbf37614e11de1b0be80965a64631ed68fc5 Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Tue, 28 May 2024 20:38:26 +0300 Subject: [PATCH 25/39] feat: output for test suite run --- cmd/kubectl-testkube/commands/tests/run.go | 1 + .../commands/testsuites/common.go | 50 +++++++++++++------ .../commands/testsuites/run.go | 31 +++++++++--- .../commands/testsuites/watch.go | 4 +- 4 files changed, 61 insertions(+), 25 deletions(-) diff --git a/cmd/kubectl-testkube/commands/tests/run.go b/cmd/kubectl-testkube/commands/tests/run.go index fbe99a59d8e..e9e83415602 100644 --- a/cmd/kubectl-testkube/commands/tests/run.go +++ b/cmd/kubectl-testkube/commands/tests/run.go @@ -94,6 +94,7 @@ func NewRunTestCmd() *cobra.Command { if attachDebugger { watchEnabled = true } + outputFlag := cmd.Flag("output") outputType := render.OutputPretty if outputFlag != nil { diff --git a/cmd/kubectl-testkube/commands/testsuites/common.go b/cmd/kubectl-testkube/commands/testsuites/common.go index ffb6a0a99b6..ed89848b245 100644 --- a/cmd/kubectl-testkube/commands/testsuites/common.go +++ b/cmd/kubectl-testkube/commands/testsuites/common.go @@ -18,27 +18,47 @@ import ( "github.com/kubeshop/testkube/pkg/ui" ) -func printExecution(execution testkube.TestSuiteExecution, startTime time.Time) { - if execution.TestSuite != nil { - ui.Warn("Name :", execution.TestSuite.Name) +func printExecution(cmd *cobra.Command, execution testkube.TestSuiteExecution, startTime time.Time) error { + outputFlag := cmd.Flag("output") + outputType := render.OutputPretty + if outputFlag != nil { + outputType = render.OutputType(outputFlag.Value.String()) } - if execution.Id != "" { - ui.Warn("Execution ID :", execution.Id) - ui.Warn("Execution name:", execution.Name) - } + switch outputType { + case render.OutputPretty: + if execution.TestSuite != nil { + ui.Warn("Name :", execution.TestSuite.Name) + } - if execution.Status != nil { - ui.Warn("Status :", string(*execution.Status)) - } + if execution.Id != "" { + ui.Warn("Execution ID :", execution.Id) + ui.Warn("Execution name:", execution.Name) + } + + if execution.Status != nil { + ui.Warn("Status :", string(*execution.Status)) + } - if execution.Id != "" { - ui.Warn("Duration:", execution.CalculateDuration().String()+"\n") - ui.Table(execution, os.Stdout) + if execution.Id != "" { + ui.Warn("Duration:", execution.CalculateDuration().String()+"\n") + ui.Table(execution, os.Stdout) + } + + ui.NL() + ui.NL() + case render.OutputYAML: + return render.RenderYaml(execution, os.Stdout) + case render.OutputJSON: + return render.RenderJSON(execution, os.Stdout) + case render.OutputGoTemplate: + tpl := cmd.Flag("go-template").Value.String() + return render.RenderGoTemplate(execution, os.Stdout, tpl) + default: + return render.RenderYaml(execution, os.Stdout) } - ui.NL() - ui.NL() + return nil } func uiPrintExecutionStatus(client apiclientv1.Client, execution testkube.TestSuiteExecution) error { diff --git a/cmd/kubectl-testkube/commands/testsuites/run.go b/cmd/kubectl-testkube/commands/testsuites/run.go index 044cea158b2..d81b3644f74 100644 --- a/cmd/kubectl-testkube/commands/testsuites/run.go +++ b/cmd/kubectl-testkube/commands/testsuites/run.go @@ -11,6 +11,7 @@ import ( "github.com/spf13/cobra" "github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/common" + "github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/common/render" apiv1 "github.com/kubeshop/testkube/pkg/api/v1/client" "github.com/kubeshop/testkube/pkg/api/v1/testkube" "github.com/kubeshop/testkube/pkg/ui" @@ -55,6 +56,13 @@ func NewRunTestSuiteCmd() *cobra.Command { Short: "Starts new test suite", Long: `Starts new test suite based on TestSuite Custom Resource name, returns results to console`, Run: func(cmd *cobra.Command, args []string) { + outputFlag := cmd.Flag("output") + outputType := render.OutputPretty + if outputFlag != nil { + outputType = render.OutputType(outputFlag.Value.String()) + } + + outputPretty := outputType == render.OutputPretty startTime := time.Now() client, namespace, err := common.GetClient(cmd) ui.ExitOnError("getting client", err) @@ -109,7 +117,7 @@ func NewRunTestSuiteCmd() *cobra.Command { ui.ExitOnError("getting server info", err) options.ExecutionVariables, err = common.CreateVariables(cmd, info.DisableSecretCreation) - ui.WarnOnError("getting variables", err) + ui.WarnOnErrorAndOutputPretty("getting variables", outputPretty, err) if gitBranch != "" || gitCommit != "" || gitPath != "" || gitWorkingDir != "" { options.ContentRequest = &testkube.TestContentRequest{ @@ -158,7 +166,7 @@ func NewRunTestSuiteCmd() *cobra.Command { ui.ExitOnError("watching test suite execution", resp.Error) if !silentMode { execution.TruncateErrorMessages(maxErrorMessageLength) - printExecution(execution, startTime) + printExecution(cmd, execution, startTime) } } } @@ -167,23 +175,30 @@ func NewRunTestSuiteCmd() *cobra.Command { } execution.TruncateErrorMessages(maxErrorMessageLength) - printExecution(execution, startTime) + printExecution(cmd, execution, startTime) ui.ExitOnError("getting recent execution data id:"+execution.Id, err) - if err = uiPrintExecutionStatus(client, execution); err != nil { - execErrors = append(execErrors, err) + if outputPretty { + if err = uiPrintExecutionStatus(client, execution); err != nil { + execErrors = append(execErrors, err) + } + } + + if outputPretty { + uiShellTestSuiteGetCommandBlock(execution.Id) } - uiShellTestSuiteGetCommandBlock(execution.Id) if execution.Id != "" { if watchEnabled && len(args) > 0 { if downloadArtifactsEnabled { - DownloadArtifacts(execution.Id, downloadDir, format, masks, client, true) + DownloadArtifacts(execution.Id, downloadDir, format, masks, client, outputPretty) } } if !watchEnabled || len(args) == 0 { - uiShellTestSuiteWatchCommandBlock(execution.Id) + if outputPretty { + uiShellTestSuiteWatchCommandBlock(execution.Id) + } } } } diff --git a/cmd/kubectl-testkube/commands/testsuites/watch.go b/cmd/kubectl-testkube/commands/testsuites/watch.go index 6b9fc80aacc..2b781b37643 100644 --- a/cmd/kubectl-testkube/commands/testsuites/watch.go +++ b/cmd/kubectl-testkube/commands/testsuites/watch.go @@ -29,12 +29,12 @@ func NewWatchTestSuiteExecutionCmd() *cobra.Command { watchResp := client.WatchTestSuiteExecution(executionID) for resp := range watchResp { ui.ExitOnError("watching test suite execution", resp.Error) - printExecution(resp.Execution, startTime) + printExecution(cmd, resp.Execution, startTime) } execution, err := client.GetTestSuiteExecution(executionID) ui.ExitOnError("getting test suite excecution", err) - printExecution(execution, startTime) + printExecution(cmd, execution, startTime) ui.ExitOnError("getting recent execution data id:"+execution.Id, err) err = uiPrintExecutionStatus(client, execution) From 14888274486fd195b5070934fbdea2cffdd1d4dc Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Tue, 28 May 2024 21:10:18 +0300 Subject: [PATCH 26/39] feat: output test workflow run --- .../renderer/testworkflowexecution_obj.go | 35 +++++++++++-- .../commands/testworkflows/run.go | 24 ++++++--- docs/docs/cli/testkube_init_agent.md | 49 ++++++++++--------- docs/docs/cli/testkube_pro_agent.md | 49 ++++++++++--------- docs/docs/cli/testkube_run.md | 4 +- docs/docs/cli/testkube_run_test.md | 4 ++ docs/docs/cli/testkube_run_testsuite.md | 2 + docs/docs/cli/testkube_run_testworkflow.md | 2 + 8 files changed, 110 insertions(+), 59 deletions(-) diff --git a/cmd/kubectl-testkube/commands/testworkflows/renderer/testworkflowexecution_obj.go b/cmd/kubectl-testkube/commands/testworkflows/renderer/testworkflowexecution_obj.go index 594e457ecd9..154566b5485 100644 --- a/cmd/kubectl-testkube/commands/testworkflows/renderer/testworkflowexecution_obj.go +++ b/cmd/kubectl-testkube/commands/testworkflows/renderer/testworkflowexecution_obj.go @@ -2,20 +2,52 @@ package renderer import ( "fmt" + "os" "github.com/pkg/errors" + "github.com/spf13/cobra" + "github.com/kubeshop/testkube/cmd/kubectl-testkube/commands/common/render" "github.com/kubeshop/testkube/pkg/api/v1/client" "github.com/kubeshop/testkube/pkg/api/v1/testkube" "github.com/kubeshop/testkube/pkg/ui" ) +func PrintTestWorkflowExecution(cmd *cobra.Command, execution testkube.TestWorkflowExecution) error { + outputFlag := cmd.Flag("output") + outputType := render.OutputPretty + if outputFlag != nil { + outputType = render.OutputType(outputFlag.Value.String()) + } + + switch outputType { + case render.OutputPretty: + printPrettyOutput(ui.NewUI(ui.Verbose, os.Stdout), execution) + case render.OutputYAML: + return render.RenderYaml(execution, os.Stdout) + case render.OutputJSON: + return render.RenderJSON(execution, os.Stdout) + case render.OutputGoTemplate: + tpl := cmd.Flag("go-template").Value.String() + return render.RenderGoTemplate(execution, os.Stdout, tpl) + default: + return render.RenderYaml(execution, os.Stdout) + } + + return nil +} + func TestWorkflowExecutionRenderer(client client.Client, ui *ui.UI, obj interface{}) error { execution, ok := obj.(testkube.TestWorkflowExecution) if !ok { return fmt.Errorf("can't use '%T' as testkube.TestWorkflowExecution in RenderObj for test workflow execution", obj) } + printPrettyOutput(ui, execution) + return nil +} + +func printPrettyOutput(ui *ui.UI, execution testkube.TestWorkflowExecution) { ui.Info("Test Workflow Execution:") ui.Warn("Name: ", execution.Workflow.Name) if execution.Id != "" { @@ -45,7 +77,4 @@ func TestWorkflowExecutionRenderer(client client.Client, ui *ui.UI, obj interfac ui.NL() ui.Err(errors.New(execution.Result.Initialization.ErrorMessage)) } - - return nil - } diff --git a/cmd/kubectl-testkube/commands/testworkflows/run.go b/cmd/kubectl-testkube/commands/testworkflows/run.go index f8e81b6c3e8..fc26b4a4a36 100644 --- a/cmd/kubectl-testkube/commands/testworkflows/run.go +++ b/cmd/kubectl-testkube/commands/testworkflows/run.go @@ -34,6 +34,13 @@ func NewRunTestWorkflowCmd() *cobra.Command { Short: "Starts test workflow execution", Run: func(cmd *cobra.Command, args []string) { + outputFlag := cmd.Flag("output") + outputType := render.OutputPretty + if outputFlag != nil { + outputType = render.OutputType(outputFlag.Value.String()) + } + + outputPretty := outputType == render.OutputPretty namespace := cmd.Flag("namespace").Value.String() client, _, err := common.GetClient(cmd) ui.ExitOnError("getting client", err) @@ -44,19 +51,22 @@ func NewRunTestWorkflowCmd() *cobra.Command { Config: config, }) ui.ExitOnError("execute test workflow "+name+" from namespace "+namespace, err) - err = render.Obj(cmd, execution, os.Stdout, renderer.TestWorkflowExecutionRenderer) + err = renderer.PrintTestWorkflowExecution(cmd, execution) ui.ExitOnError("render test workflow execution", err) - ui.NL() var exitCode = 0 - if watchEnabled { - exitCode = uiWatch(execution, client) + if outputPretty { ui.NL() - } else { - uiShellWatchExecution(execution.Id) + if watchEnabled { + exitCode = uiWatch(execution, client) + ui.NL() + } else { + uiShellWatchExecution(execution.Id) + } + + uiShellGetExecution(execution.Id) } - uiShellGetExecution(execution.Id) os.Exit(exitCode) }, } diff --git a/docs/docs/cli/testkube_init_agent.md b/docs/docs/cli/testkube_init_agent.md index b7a379ddada..d1d77e3dc10 100644 --- a/docs/docs/cli/testkube_init_agent.md +++ b/docs/docs/cli/testkube_init_agent.md @@ -9,30 +9,31 @@ testkube init agent [flags] ### Options ``` - --agent-prefix string usually don't need to be changed [required for custom cloud mode] (default "agent") - --agent-token string Testkube Pro agent key [required for centralized mode] - --agent-uri string Testkube Pro agent URI [required for centralized mode] - --api-prefix string usually don't need to be changed [required for custom cloud mode] (default "api") - --chart string chart name (usually you don't need to change it) (default "kubeshop/testkube") - --dry-run dry run mode - only print commands that would be executed - --env-id string Testkube Pro environment id [required for centralized mode] - --export Export the values.yaml - --feature-logs-v2 Logs v2 feature flag - -h, --help help for agent - --logs-prefix string usually don't need to be changed [required for custom cloud mode] (default "logs") - --logs-uri string Testkube Pro logs URI [required for centralized mode] - --master-insecure should client connect in insecure mode (will use http instead of https) - --multi-namespace multi namespace mode - --name string installation name (usually you don't need to change it) (default "testkube") - --namespace string namespace where to install (default "testkube") - --no-confirm don't ask for confirmation - unatended installation mode - --no-minio don't install MinIO - --no-mongo don't install MongoDB - --no-operator should operator be installed (for more instances in multi namespace mode it should be set to true) - --org-id string Testkube Pro organization id [required for centralized mode] - --root-domain string usually don't need to be changed [required for custom cloud mode] (default "testkube.io") - --ui-prefix string usually don't need to be changed [required for custom cloud mode] (default "app") - --values string path to Helm values file + --agent-prefix string usually don't need to be changed [required for custom cloud mode] (default "agent") + --agent-token string Testkube Pro agent key [required for centralized mode] + --agent-uri string Testkube Pro agent URI [required for centralized mode] + --api-prefix string usually don't need to be changed [required for custom cloud mode] (default "api") + --chart string chart name (usually you don't need to change it) (default "kubeshop/testkube") + --dry-run dry run mode - only print commands that would be executed + --env-id string Testkube Pro environment id [required for centralized mode] + --export Export the values.yaml + --feature-logs-v2 Logs v2 feature flag + -h, --help help for agent + --logs-prefix string usually don't need to be changed [required for custom cloud mode] (default "logs") + --logs-uri string Testkube Pro logs URI [required for centralized mode] + --master-insecure should client connect in insecure mode (will use http instead of https) + --multi-namespace multi namespace mode + --name string installation name (usually you don't need to change it) (default "testkube") + --namespace string namespace where to install (default "testkube") + --no-confirm don't ask for confirmation - unatended installation mode + --no-login testkube set context Ignore login prompt, set existing token later by testkube set context + --no-minio don't install MinIO + --no-mongo don't install MongoDB + --no-operator should operator be installed (for more instances in multi namespace mode it should be set to true) + --org-id string Testkube Pro organization id [required for centralized mode] + --root-domain string usually don't need to be changed [required for custom cloud mode] (default "testkube.io") + --ui-prefix string usually don't need to be changed [required for custom cloud mode] (default "app") + --values string path to Helm values file ``` ### Options inherited from parent commands diff --git a/docs/docs/cli/testkube_pro_agent.md b/docs/docs/cli/testkube_pro_agent.md index ab222b9ca12..acb060db7e1 100644 --- a/docs/docs/cli/testkube_pro_agent.md +++ b/docs/docs/cli/testkube_pro_agent.md @@ -9,30 +9,31 @@ testkube pro agent [flags] ### Options ``` - --agent-prefix string usually don't need to be changed [required for custom cloud mode] (default "agent") - --agent-token string Testkube Pro agent key [required for centralized mode] - --agent-uri string Testkube Pro agent URI [required for centralized mode] - --api-prefix string usually don't need to be changed [required for custom cloud mode] (default "api") - --chart string chart name (usually you don't need to change it) (default "kubeshop/testkube") - --dry-run dry run mode - only print commands that would be executed - --env-id string Testkube Pro environment id [required for centralized mode] - --export Export the values.yaml - --feature-logs-v2 Logs v2 feature flag - -h, --help help for agent - --logs-prefix string usually don't need to be changed [required for custom cloud mode] (default "logs") - --logs-uri string Testkube Pro logs URI [required for centralized mode] - --master-insecure should client connect in insecure mode (will use http instead of https) - --multi-namespace multi namespace mode - --name string installation name (usually you don't need to change it) (default "testkube") - --namespace string namespace where to install (default "testkube") - --no-confirm don't ask for confirmation - unatended installation mode - --no-minio don't install MinIO - --no-mongo don't install MongoDB - --no-operator should operator be installed (for more instances in multi namespace mode it should be set to true) - --org-id string Testkube Pro organization id [required for centralized mode] - --root-domain string usually don't need to be changed [required for custom cloud mode] (default "testkube.io") - --ui-prefix string usually don't need to be changed [required for custom cloud mode] (default "app") - --values string path to Helm values file + --agent-prefix string usually don't need to be changed [required for custom cloud mode] (default "agent") + --agent-token string Testkube Pro agent key [required for centralized mode] + --agent-uri string Testkube Pro agent URI [required for centralized mode] + --api-prefix string usually don't need to be changed [required for custom cloud mode] (default "api") + --chart string chart name (usually you don't need to change it) (default "kubeshop/testkube") + --dry-run dry run mode - only print commands that would be executed + --env-id string Testkube Pro environment id [required for centralized mode] + --export Export the values.yaml + --feature-logs-v2 Logs v2 feature flag + -h, --help help for agent + --logs-prefix string usually don't need to be changed [required for custom cloud mode] (default "logs") + --logs-uri string Testkube Pro logs URI [required for centralized mode] + --master-insecure should client connect in insecure mode (will use http instead of https) + --multi-namespace multi namespace mode + --name string installation name (usually you don't need to change it) (default "testkube") + --namespace string namespace where to install (default "testkube") + --no-confirm don't ask for confirmation - unatended installation mode + --no-login testkube set context Ignore login prompt, set existing token later by testkube set context + --no-minio don't install MinIO + --no-mongo don't install MongoDB + --no-operator should operator be installed (for more instances in multi namespace mode it should be set to true) + --org-id string Testkube Pro organization id [required for centralized mode] + --root-domain string usually don't need to be changed [required for custom cloud mode] (default "testkube.io") + --ui-prefix string usually don't need to be changed [required for custom cloud mode] (default "app") + --values string path to Helm values file ``` ### Options inherited from parent commands diff --git a/docs/docs/cli/testkube_run.md b/docs/docs/cli/testkube_run.md index 30bca261abf..b185654e1e4 100644 --- a/docs/docs/cli/testkube_run.md +++ b/docs/docs/cli/testkube_run.md @@ -9,7 +9,9 @@ testkube run [flags] ### Options ``` - -h, --help help for run + --go-template string go template to render (default "{{.}}") + -h, --help help for run + -o, --output string output type can be one of json|yaml|pretty|go (default "pretty") ``` ### Options inherited from parent commands diff --git a/docs/docs/cli/testkube_run_test.md b/docs/docs/cli/testkube_run_test.md index b9a95ddf34c..443be56880d 100644 --- a/docs/docs/cli/testkube_run_test.md +++ b/docs/docs/cli/testkube_run_test.md @@ -24,10 +24,12 @@ testkube run test [flags] --artifact-storage-class-name string artifact storage class name for container executor --artifact-use-default-storage-class-name whether to use default storage class name --artifact-volume-mount-path string artifact volume mount path for container executor + --attach-debugger attach simple debugger for job, need KUBECONFIG for the agent to be active --command stringArray command passed to image in executor --concurrency int concurrency level for multiple test execution (default 10) --context string running context description for test execution --copy-files stringArray file path mappings from host to pod of form source:destination + --debugger-file string store debug info into file, stdout by default -d, --download-artifacts download artifacts automatically --download-dir string download dir (default "artifacts") --execute-postrun-script-before-scraping whether to execute postrun scipt before scraping or not (prebuilt executor only) @@ -80,10 +82,12 @@ testkube run test [flags] ``` -a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088") -c, --client string client used for connecting to Testkube API one of proxy|direct|cluster (default "proxy") + --go-template string go template to render (default "{{.}}") --header stringToString headers for direct client key value pair: --header name=value (default []) --insecure insecure connection for direct client --namespace string Kubernetes namespace, default value read from config if set (default "testkube") --oauth-enabled enable oauth + -o, --output string output type can be one of json|yaml|pretty|go (default "pretty") --verbose show additional debug messages ``` diff --git a/docs/docs/cli/testkube_run_testsuite.md b/docs/docs/cli/testkube_run_testsuite.md index 086d9af6d26..77df51e24b9 100644 --- a/docs/docs/cli/testkube_run_testsuite.md +++ b/docs/docs/cli/testkube_run_testsuite.md @@ -47,10 +47,12 @@ testkube run testsuite [flags] ``` -a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088") -c, --client string client used for connecting to Testkube API one of proxy|direct|cluster (default "proxy") + --go-template string go template to render (default "{{.}}") --header stringToString headers for direct client key value pair: --header name=value (default []) --insecure insecure connection for direct client --namespace string Kubernetes namespace, default value read from config if set (default "testkube") --oauth-enabled enable oauth + -o, --output string output type can be one of json|yaml|pretty|go (default "pretty") --verbose show additional debug messages ``` diff --git a/docs/docs/cli/testkube_run_testworkflow.md b/docs/docs/cli/testkube_run_testworkflow.md index 098594f2242..71ced6840a2 100644 --- a/docs/docs/cli/testkube_run_testworkflow.md +++ b/docs/docs/cli/testkube_run_testworkflow.md @@ -20,10 +20,12 @@ testkube run testworkflow [name] [flags] ``` -a, --api-uri string api uri, default value read from config if set (default "http://localhost:8088") -c, --client string client used for connecting to Testkube API one of proxy|direct|cluster (default "proxy") + --go-template string go template to render (default "{{.}}") --header stringToString headers for direct client key value pair: --header name=value (default []) --insecure insecure connection for direct client --namespace string Kubernetes namespace, default value read from config if set (default "testkube") --oauth-enabled enable oauth + -o, --output string output type can be one of json|yaml|pretty|go (default "pretty") --verbose show additional debug messages ``` From d5e758cd34c55fe8cf81894f2415a360ca12a14a Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Tue, 28 May 2024 21:17:39 +0300 Subject: [PATCH 27/39] fix: check renderer error --- cmd/kubectl-testkube/commands/tests/run.go | 3 ++- cmd/kubectl-testkube/commands/testsuites/run.go | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/kubectl-testkube/commands/tests/run.go b/cmd/kubectl-testkube/commands/tests/run.go index e9e83415602..231f652df1f 100644 --- a/cmd/kubectl-testkube/commands/tests/run.go +++ b/cmd/kubectl-testkube/commands/tests/run.go @@ -341,7 +341,8 @@ func NewRunTestCmd() *cobra.Command { var execErrors []error for _, execution := range executions { - printExecutionDetails(cmd, execution) + err = printExecutionDetails(cmd, execution) + ui.ExitOnError("printing test execution "+execution.Id, err) if execution.ExecutionResult != nil && execution.ExecutionResult.ErrorMessage != "" { execErrors = append(execErrors, errors.New(execution.ExecutionResult.ErrorMessage)) diff --git a/cmd/kubectl-testkube/commands/testsuites/run.go b/cmd/kubectl-testkube/commands/testsuites/run.go index d81b3644f74..899a0f01f8d 100644 --- a/cmd/kubectl-testkube/commands/testsuites/run.go +++ b/cmd/kubectl-testkube/commands/testsuites/run.go @@ -166,7 +166,8 @@ func NewRunTestSuiteCmd() *cobra.Command { ui.ExitOnError("watching test suite execution", resp.Error) if !silentMode { execution.TruncateErrorMessages(maxErrorMessageLength) - printExecution(cmd, execution, startTime) + err = printExecution(cmd, execution, startTime) + ui.ExitOnError("printing test suite execution "+execution.Id, err) } } } @@ -175,9 +176,11 @@ func NewRunTestSuiteCmd() *cobra.Command { } execution.TruncateErrorMessages(maxErrorMessageLength) - printExecution(cmd, execution, startTime) ui.ExitOnError("getting recent execution data id:"+execution.Id, err) + err = printExecution(cmd, execution, startTime) + ui.ExitOnError("printing test suite execution "+execution.Id, err) + if outputPretty { if err = uiPrintExecutionStatus(client, execution); err != nil { execErrors = append(execErrors, err) From 37d546c42049850b9276393fd2b55dc3549eaa78 Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Tue, 28 May 2024 21:23:00 +0300 Subject: [PATCH 28/39] fix: check for pretty output --- pkg/ui/ui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ui/ui.go b/pkg/ui/ui.go index de98c9de7cd..6a7d13f5b6c 100644 --- a/pkg/ui/ui.go +++ b/pkg/ui/ui.go @@ -52,7 +52,7 @@ func ExitOnError(item string, errors ...error) { ui.ExitOnError(item, errors... func PrintOnError(item string, errors ...error) { ui.PrintOnError(item, errors...) } func WarnOnError(item string, errors ...error) { ui.WarnOnError(item, errors...) } func WarnOnErrorAndOutputPretty(item string, outputPretty bool, errors ...error) { - if outputPretty { + if !outputPretty { return } From 16c375c808a5e68f9c95e79b845de04f00b2551c Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Tue, 28 May 2024 21:29:30 +0300 Subject: [PATCH 29/39] fix: combine the check --- cmd/kubectl-testkube/commands/testsuites/run.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/kubectl-testkube/commands/testsuites/run.go b/cmd/kubectl-testkube/commands/testsuites/run.go index 899a0f01f8d..77dbbfc22d7 100644 --- a/cmd/kubectl-testkube/commands/testsuites/run.go +++ b/cmd/kubectl-testkube/commands/testsuites/run.go @@ -185,9 +185,7 @@ func NewRunTestSuiteCmd() *cobra.Command { if err = uiPrintExecutionStatus(client, execution); err != nil { execErrors = append(execErrors, err) } - } - if outputPretty { uiShellTestSuiteGetCommandBlock(execution.Id) } From 5bd9944ef56b22807486ceb58130965e0dbbd493 Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Wed, 29 May 2024 13:32:42 +0300 Subject: [PATCH 30/39] fix: pass stdout parameter --- cmd/kubectl-testkube/commands/tests/common.go | 11 ++++++----- cmd/kubectl-testkube/commands/tests/run.go | 2 +- cmd/kubectl-testkube/commands/testsuites/common.go | 13 +++++++------ cmd/kubectl-testkube/commands/testsuites/run.go | 4 ++-- cmd/kubectl-testkube/commands/testsuites/watch.go | 4 ++-- .../renderer/testworkflowexecution_obj.go | 14 +++++++------- cmd/kubectl-testkube/commands/testworkflows/run.go | 2 +- 7 files changed, 26 insertions(+), 24 deletions(-) diff --git a/cmd/kubectl-testkube/commands/tests/common.go b/cmd/kubectl-testkube/commands/tests/common.go index eb233fe399e..601078c23df 100644 --- a/cmd/kubectl-testkube/commands/tests/common.go +++ b/cmd/kubectl-testkube/commands/tests/common.go @@ -3,6 +3,7 @@ package tests import ( "errors" "fmt" + "io" "os" "path" "regexp" @@ -30,7 +31,7 @@ const ( maxArgSize = int64(131072) // maximum argument size in linux-based systems is 128 KiB ) -func printExecutionDetails(cmd *cobra.Command, execution testkube.Execution) error { +func printExecutionDetails(cmd *cobra.Command, w io.Writer, execution testkube.Execution) error { outputFlag := cmd.Flag("output") outputType := render.OutputPretty if outputFlag != nil { @@ -60,14 +61,14 @@ func printExecutionDetails(cmd *cobra.Command, execution testkube.Execution) err ui.NL() ui.NL() case render.OutputYAML: - return render.RenderYaml(execution, os.Stdout) + return render.RenderYaml(execution, w) case render.OutputJSON: - return render.RenderJSON(execution, os.Stdout) + return render.RenderJSON(execution, w) case render.OutputGoTemplate: tpl := cmd.Flag("go-template").Value.String() - return render.RenderGoTemplate(execution, os.Stdout, tpl) + return render.RenderGoTemplate(execution, w, tpl) default: - return render.RenderYaml(execution, os.Stdout) + return render.RenderYaml(execution, w) } return nil diff --git a/cmd/kubectl-testkube/commands/tests/run.go b/cmd/kubectl-testkube/commands/tests/run.go index 231f652df1f..06892322704 100644 --- a/cmd/kubectl-testkube/commands/tests/run.go +++ b/cmd/kubectl-testkube/commands/tests/run.go @@ -341,7 +341,7 @@ func NewRunTestCmd() *cobra.Command { var execErrors []error for _, execution := range executions { - err = printExecutionDetails(cmd, execution) + err = printExecutionDetails(cmd, os.Stdout, execution) ui.ExitOnError("printing test execution "+execution.Id, err) if execution.ExecutionResult != nil && execution.ExecutionResult.ErrorMessage != "" { diff --git a/cmd/kubectl-testkube/commands/testsuites/common.go b/cmd/kubectl-testkube/commands/testsuites/common.go index ed89848b245..43c825359c7 100644 --- a/cmd/kubectl-testkube/commands/testsuites/common.go +++ b/cmd/kubectl-testkube/commands/testsuites/common.go @@ -4,6 +4,7 @@ import ( "encoding/json" "errors" "fmt" + "io" "os" "path/filepath" "time" @@ -18,7 +19,7 @@ import ( "github.com/kubeshop/testkube/pkg/ui" ) -func printExecution(cmd *cobra.Command, execution testkube.TestSuiteExecution, startTime time.Time) error { +func printExecution(cmd *cobra.Command, w io.Writer, execution testkube.TestSuiteExecution, startTime time.Time) error { outputFlag := cmd.Flag("output") outputType := render.OutputPretty if outputFlag != nil { @@ -42,20 +43,20 @@ func printExecution(cmd *cobra.Command, execution testkube.TestSuiteExecution, s if execution.Id != "" { ui.Warn("Duration:", execution.CalculateDuration().String()+"\n") - ui.Table(execution, os.Stdout) + ui.Table(execution, w) } ui.NL() ui.NL() case render.OutputYAML: - return render.RenderYaml(execution, os.Stdout) + return render.RenderYaml(execution, w) case render.OutputJSON: - return render.RenderJSON(execution, os.Stdout) + return render.RenderJSON(execution, w) case render.OutputGoTemplate: tpl := cmd.Flag("go-template").Value.String() - return render.RenderGoTemplate(execution, os.Stdout, tpl) + return render.RenderGoTemplate(execution, w, tpl) default: - return render.RenderYaml(execution, os.Stdout) + return render.RenderYaml(execution, w) } return nil diff --git a/cmd/kubectl-testkube/commands/testsuites/run.go b/cmd/kubectl-testkube/commands/testsuites/run.go index 77dbbfc22d7..a423e8f0e7a 100644 --- a/cmd/kubectl-testkube/commands/testsuites/run.go +++ b/cmd/kubectl-testkube/commands/testsuites/run.go @@ -166,7 +166,7 @@ func NewRunTestSuiteCmd() *cobra.Command { ui.ExitOnError("watching test suite execution", resp.Error) if !silentMode { execution.TruncateErrorMessages(maxErrorMessageLength) - err = printExecution(cmd, execution, startTime) + err = printExecution(cmd, os.Stdout, execution, startTime) ui.ExitOnError("printing test suite execution "+execution.Id, err) } } @@ -178,7 +178,7 @@ func NewRunTestSuiteCmd() *cobra.Command { execution.TruncateErrorMessages(maxErrorMessageLength) ui.ExitOnError("getting recent execution data id:"+execution.Id, err) - err = printExecution(cmd, execution, startTime) + err = printExecution(cmd, os.Stdout, execution, startTime) ui.ExitOnError("printing test suite execution "+execution.Id, err) if outputPretty { diff --git a/cmd/kubectl-testkube/commands/testsuites/watch.go b/cmd/kubectl-testkube/commands/testsuites/watch.go index 2b781b37643..21e00768e70 100644 --- a/cmd/kubectl-testkube/commands/testsuites/watch.go +++ b/cmd/kubectl-testkube/commands/testsuites/watch.go @@ -29,12 +29,12 @@ func NewWatchTestSuiteExecutionCmd() *cobra.Command { watchResp := client.WatchTestSuiteExecution(executionID) for resp := range watchResp { ui.ExitOnError("watching test suite execution", resp.Error) - printExecution(cmd, resp.Execution, startTime) + printExecution(cmd, os.Stdout, resp.Execution, startTime) } execution, err := client.GetTestSuiteExecution(executionID) ui.ExitOnError("getting test suite excecution", err) - printExecution(cmd, execution, startTime) + printExecution(cmd, os.Stdout, execution, startTime) ui.ExitOnError("getting recent execution data id:"+execution.Id, err) err = uiPrintExecutionStatus(client, execution) diff --git a/cmd/kubectl-testkube/commands/testworkflows/renderer/testworkflowexecution_obj.go b/cmd/kubectl-testkube/commands/testworkflows/renderer/testworkflowexecution_obj.go index 154566b5485..05076da5af9 100644 --- a/cmd/kubectl-testkube/commands/testworkflows/renderer/testworkflowexecution_obj.go +++ b/cmd/kubectl-testkube/commands/testworkflows/renderer/testworkflowexecution_obj.go @@ -2,7 +2,7 @@ package renderer import ( "fmt" - "os" + "io" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -13,7 +13,7 @@ import ( "github.com/kubeshop/testkube/pkg/ui" ) -func PrintTestWorkflowExecution(cmd *cobra.Command, execution testkube.TestWorkflowExecution) error { +func PrintTestWorkflowExecution(cmd *cobra.Command, w io.Writer, execution testkube.TestWorkflowExecution) error { outputFlag := cmd.Flag("output") outputType := render.OutputPretty if outputFlag != nil { @@ -22,16 +22,16 @@ func PrintTestWorkflowExecution(cmd *cobra.Command, execution testkube.TestWorkf switch outputType { case render.OutputPretty: - printPrettyOutput(ui.NewUI(ui.Verbose, os.Stdout), execution) + printPrettyOutput(ui.NewUI(ui.Verbose, w), execution) case render.OutputYAML: - return render.RenderYaml(execution, os.Stdout) + return render.RenderYaml(execution, w) case render.OutputJSON: - return render.RenderJSON(execution, os.Stdout) + return render.RenderJSON(execution, w) case render.OutputGoTemplate: tpl := cmd.Flag("go-template").Value.String() - return render.RenderGoTemplate(execution, os.Stdout, tpl) + return render.RenderGoTemplate(execution, w, tpl) default: - return render.RenderYaml(execution, os.Stdout) + return render.RenderYaml(execution, w) } return nil diff --git a/cmd/kubectl-testkube/commands/testworkflows/run.go b/cmd/kubectl-testkube/commands/testworkflows/run.go index fc26b4a4a36..8739eade6ed 100644 --- a/cmd/kubectl-testkube/commands/testworkflows/run.go +++ b/cmd/kubectl-testkube/commands/testworkflows/run.go @@ -51,7 +51,7 @@ func NewRunTestWorkflowCmd() *cobra.Command { Config: config, }) ui.ExitOnError("execute test workflow "+name+" from namespace "+namespace, err) - err = renderer.PrintTestWorkflowExecution(cmd, execution) + err = renderer.PrintTestWorkflowExecution(cmd, os.Stdout, execution) ui.ExitOnError("render test workflow execution", err) var exitCode = 0 From 10f8ed7c96496d73b160da833ab0a348d7cfe720 Mon Sep 17 00:00:00 2001 From: Povilas Versockas Date: Wed, 29 May 2024 15:26:11 +0300 Subject: [PATCH 31/39] feat: [TKC-2063] Delete testworkflow output when workflow is deleted (#5509) --- cmd/api-server/main.go | 2 +- pkg/tcl/apitcl/v1/testworkflows.go | 4 ++ .../data/testworkflow/execution_models.go | 7 +++ pkg/tcl/cloudtcl/data/testworkflow/output.go | 6 +++ .../repositorytcl/testworkflow/interface.go | 3 ++ .../testworkflow/minio_output_repository.go | 43 ++++++++++++++++--- .../testworkflow/mock_output_repository.go | 14 ++++++ 7 files changed, 73 insertions(+), 6 deletions(-) diff --git a/cmd/api-server/main.go b/cmd/api-server/main.go index 5c8ec8b4a39..733e18c7943 100644 --- a/cmd/api-server/main.go +++ b/cmd/api-server/main.go @@ -298,7 +298,7 @@ func main() { } storageClient = minioClient // Pro edition only (tcl protected code) - testWorkflowOutputRepository = testworkflow.NewMinioOutputRepository(storageClient, cfg.LogsBucket) + testWorkflowOutputRepository = testworkflow.NewMinioOutputRepository(storageClient, db.Collection(testworkflow.CollectionName), cfg.LogsBucket) artifactStorage = minio.NewMinIOArtifactClient(storageClient) // init storage isMinioStorage := cfg.LogsStorage == "minio" diff --git a/pkg/tcl/apitcl/v1/testworkflows.go b/pkg/tcl/apitcl/v1/testworkflows.go index 1c4703d8d0e..4420b71c57c 100644 --- a/pkg/tcl/apitcl/v1/testworkflows.go +++ b/pkg/tcl/apitcl/v1/testworkflows.go @@ -69,6 +69,10 @@ func (s *apiTCL) DeleteTestWorkflowHandler() fiber.Handler { } skipExecutions := c.Query("skipDeleteExecutions", "") if skipExecutions != "true" { + err = s.TestWorkflowOutput.DeleteOutputByTestWorkflow(context.Background(), name) + if err != nil { + return s.ClientError(c, "deleting executions output", err) + } err = s.TestWorkflowResults.DeleteByTestWorkflow(context.Background(), name) if err != nil { return s.ClientError(c, "deleting executions", err) diff --git a/pkg/tcl/cloudtcl/data/testworkflow/execution_models.go b/pkg/tcl/cloudtcl/data/testworkflow/execution_models.go index e457fb1d9e6..5d72a96be04 100644 --- a/pkg/tcl/cloudtcl/data/testworkflow/execution_models.go +++ b/pkg/tcl/cloudtcl/data/testworkflow/execution_models.go @@ -114,6 +114,13 @@ type ExecutionDeleteByWorkflowRequest struct { type ExecutionDeleteByWorkflowResponse struct { } +type ExecutionDeleteOutputByWorkflowRequest struct { + WorkflowName string `json:"workflowName"` +} + +type ExecutionDeleteOutputByWorkflowResponse struct { +} + type ExecutionDeleteAllRequest struct { } diff --git a/pkg/tcl/cloudtcl/data/testworkflow/output.go b/pkg/tcl/cloudtcl/data/testworkflow/output.go index 94ffdceff91..40122b87176 100644 --- a/pkg/tcl/cloudtcl/data/testworkflow/output.go +++ b/pkg/tcl/cloudtcl/data/testworkflow/output.go @@ -105,3 +105,9 @@ func (r *CloudOutputRepository) HasLog(ctx context.Context, id, workflowName str } return pass(r.executor, ctx, req, process) } + +// DeleteByTestWorkflow deletes execution results by workflow +func (r *CloudOutputRepository) DeleteOutputByTestWorkflow(ctx context.Context, workflowName string) (err error) { + req := ExecutionDeleteOutputByWorkflowRequest{WorkflowName: workflowName} + return passNoContent(r.executor, ctx, req) +} diff --git a/pkg/tcl/repositorytcl/testworkflow/interface.go b/pkg/tcl/repositorytcl/testworkflow/interface.go index 635868c5128..265e8742047 100644 --- a/pkg/tcl/repositorytcl/testworkflow/interface.go +++ b/pkg/tcl/repositorytcl/testworkflow/interface.go @@ -86,4 +86,7 @@ type OutputRepository interface { ReadLog(ctx context.Context, id, workflowName string) (io.Reader, error) // HasLog checks if there is an output in Minio HasLog(ctx context.Context, id, workflowName string) (bool, error) + + // DeleteOutputByTestWorkflow deletes execution output by test workflow + DeleteOutputByTestWorkflow(ctx context.Context, testWorkflowName string) error } diff --git a/pkg/tcl/repositorytcl/testworkflow/minio_output_repository.go b/pkg/tcl/repositorytcl/testworkflow/minio_output_repository.go index 5802dc4b0e1..12fc71cefb3 100644 --- a/pkg/tcl/repositorytcl/testworkflow/minio_output_repository.go +++ b/pkg/tcl/repositorytcl/testworkflow/minio_output_repository.go @@ -13,8 +13,12 @@ import ( "io" "time" + "github.com/kubeshop/testkube/pkg/api/v1/testkube" "github.com/kubeshop/testkube/pkg/log" "github.com/kubeshop/testkube/pkg/storage" + + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/mongo" ) var _ OutputRepository = (*MinioRepository)(nil) @@ -22,15 +26,17 @@ var _ OutputRepository = (*MinioRepository)(nil) const bucketFolder = "testworkflows" type MinioRepository struct { - storage storage.Client - bucket string + storage storage.Client + executionCollection *mongo.Collection + bucket string } -func NewMinioOutputRepository(storageClient storage.Client, bucket string) *MinioRepository { +func NewMinioOutputRepository(storageClient storage.Client, executionCollection *mongo.Collection, bucket string) *MinioRepository { log.DefaultLogger.Debugw("creating minio workflow output repository", "bucket", bucket) return &MinioRepository{ - storage: storageClient, - bucket: bucket, + storage: storageClient, + executionCollection: executionCollection, + bucket: bucket, } } @@ -66,3 +72,30 @@ func (m *MinioRepository) HasLog(ctx context.Context, id, workflowName string) ( } return true, nil } + +func (m *MinioRepository) DeleteOutputByTestWorkflow(ctx context.Context, testWorkflowName string) error { + log.DefaultLogger.Debugw("deleting output by testWorkflowName", "testWorkflowName", testWorkflowName) + var executions []testkube.TestWorkflowExecution + //TODO + cursor, err := m.executionCollection.Find(ctx, bson.M{"testworkflow.name": testWorkflowName}) + if err != nil { + return err + } + err = cursor.All(ctx, &executions) + if err != nil { + return err + } + for _, execution := range executions { + log.DefaultLogger.Debugw("deleting output for execution", "execution", execution) + err = m.DeleteOutput(ctx, execution.Id) + if err != nil { + return err + } + } + return nil +} + +func (m *MinioRepository) DeleteOutput(ctx context.Context, id string) error { + log.DefaultLogger.Debugw("deleting test workflow output", "id", id) + return m.storage.DeleteFileFromBucket(ctx, m.bucket, bucketFolder, id) +} diff --git a/pkg/tcl/repositorytcl/testworkflow/mock_output_repository.go b/pkg/tcl/repositorytcl/testworkflow/mock_output_repository.go index bc01a3f0fbb..15a8ab433be 100644 --- a/pkg/tcl/repositorytcl/testworkflow/mock_output_repository.go +++ b/pkg/tcl/repositorytcl/testworkflow/mock_output_repository.go @@ -35,6 +35,20 @@ func (m *MockOutputRepository) EXPECT() *MockOutputRepositoryMockRecorder { return m.recorder } +// DeleteOutputByTestWorkflow mocks base method. +func (m *MockOutputRepository) DeleteOutputByTestWorkflow(arg0 context.Context, arg1 string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteOutputByTestWorkflow", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteOutputByTestWorkflow indicates an expected call of DeleteOutputByTestWorkflow. +func (mr *MockOutputRepositoryMockRecorder) DeleteOutputByTestWorkflow(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteOutputByTestWorkflow", reflect.TypeOf((*MockOutputRepository)(nil).DeleteOutputByTestWorkflow), arg0, arg1) +} + // HasLog mocks base method. func (m *MockOutputRepository) HasLog(arg0 context.Context, arg1, arg2 string) (bool, error) { m.ctrl.T.Helper() From 0784ad4cf78d6e608ca18376be4f3d822a8a944d Mon Sep 17 00:00:00 2001 From: Tomasz Konieczny Date: Wed, 29 May 2024 15:48:06 +0200 Subject: [PATCH 32/39] feat: workflow - repository dispatch - update tests (#5511) * Repository dispatch - update tests at dev agent * repo name fixed * workflow name fixed --- .../workflows/agent-test-update-dispatch.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/agent-test-update-dispatch.yaml diff --git a/.github/workflows/agent-test-update-dispatch.yaml b/.github/workflows/agent-test-update-dispatch.yaml new file mode 100644 index 00000000000..3840af44863 --- /dev/null +++ b/.github/workflows/agent-test-update-dispatch.yaml @@ -0,0 +1,19 @@ +name: Dispatch - update tests at dev agent + +on: + push: + branches: + - develop + paths: + - test/** + +jobs: + dispatch: + name: Dispatch - update tests at dev agent + runs-on: ubuntu-latest + steps: + - name: Update tests at dev agent + uses: peter-evans/repository-dispatch@v2 + with: + repository: kubeshop/testkube-cloud-api + event-type: create_update_tests From dce2f4cf2f20400c715ab73e4653662dd5cb08c2 Mon Sep 17 00:00:00 2001 From: Povilas Versockas Date: Thu, 30 May 2024 10:02:00 +0300 Subject: [PATCH 33/39] feat: [TKC-2063] add testworkflow delete output command mapping (#5513) --- pkg/tcl/cloudtcl/data/testworkflow/commands.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/tcl/cloudtcl/data/testworkflow/commands.go b/pkg/tcl/cloudtcl/data/testworkflow/commands.go index e89bdfb536b..a91ff0a7156 100644 --- a/pkg/tcl/cloudtcl/data/testworkflow/commands.go +++ b/pkg/tcl/cloudtcl/data/testworkflow/commands.go @@ -29,9 +29,10 @@ const ( CmdTestWorkflowExecutionDeleteByWorkflows executor.Command = "workflow_execution_delete_by_workflows" CmdTestWorkflowExecutionGetWorkflowMetrics executor.Command = "workflow_execution_get_workflow_metrics" - CmdTestWorkflowOutputPresignSaveLog executor.Command = "workflow_output_presign_save_log" - CmdTestWorkflowOutputPresignReadLog executor.Command = "workflow_output_presign_read_log" - CmdTestWorkflowOutputHasLog executor.Command = "workflow_output_has_log" + CmdTestWorkflowOutputPresignSaveLog executor.Command = "workflow_output_presign_save_log" + CmdTestWorkflowOutputPresignReadLog executor.Command = "workflow_output_presign_read_log" + CmdTestWorkflowOutputHasLog executor.Command = "workflow_output_has_log" + CmdTestWorkflowOutputDeleteByTestWorkflow executor.Command = "workflow_output_delete_by_test_workflow" ) func command(v interface{}) executor.Command { @@ -75,6 +76,8 @@ func command(v interface{}) executor.Command { return CmdTestWorkflowOutputPresignReadLog case OutputHasLogRequest: return CmdTestWorkflowOutputHasLog + case ExecutionDeleteOutputByWorkflowRequest: + return CmdTestWorkflowOutputDeleteByTestWorkflow } panic("unknown test workflows Cloud request") } From fc685157121ad5354af4425f323d98289b3867d6 Mon Sep 17 00:00:00 2001 From: Jacek Wysocki Date: Thu, 30 May 2024 12:49:13 +0200 Subject: [PATCH 34/39] fix: removed ui from main file (#5452) --- cmd/api-server/main.go | 81 ++++++++++++++++++++++-------------------- 1 file changed, 43 insertions(+), 38 deletions(-) diff --git a/cmd/api-server/main.go b/cmd/api-server/main.go index 733e18c7943..9b461c3d5d5 100644 --- a/cmd/api-server/main.go +++ b/cmd/api-server/main.go @@ -94,14 +94,12 @@ import ( "github.com/kubeshop/testkube/pkg/reconciler" "github.com/kubeshop/testkube/pkg/secret" "github.com/kubeshop/testkube/pkg/tcl/testworkflowstcl/testworkflowexecutor" - "github.com/kubeshop/testkube/pkg/ui" ) var verbose = flag.Bool("v", false, "enable verbosity level") func init() { flag.Parse() - ui.Verbose = *verbose } func runMigrations() (err error) { @@ -143,10 +141,10 @@ func runMongoMigrations(ctx context.Context, db *mongo.Database, migrationsDir s func main() { cfg, err := config.Get() cfg.CleanLegacyVars() - ui.ExitOnError("error getting application config", err) + exitOnError("error getting application config", err) features, err := featureflags.Get() - ui.ExitOnError("error getting application feature flags", err) + exitOnError("error getting application feature flags", err) log.DefaultLogger.Infow("Feature flags configured", "ff", features) @@ -172,23 +170,23 @@ func main() { }) ln, err := net.Listen("tcp", ":"+cfg.APIServerPort) - ui.ExitOnError("Checking if port "+cfg.APIServerPort+"is free", err) + exitOnError("Checking if port "+cfg.APIServerPort+"is free", err) _ = ln.Close() log.DefaultLogger.Debugw("TCP Port is available", "port", cfg.APIServerPort) ln, err = net.Listen("tcp", ":"+cfg.GraphqlPort) - ui.ExitOnError("Checking if port "+cfg.GraphqlPort+"is free", err) + exitOnError("Checking if port "+cfg.GraphqlPort+"is free", err) _ = ln.Close() log.DefaultLogger.Debugw("TCP Port is available", "port", cfg.GraphqlPort) kubeClient, err := kubeclient.GetClient() - ui.ExitOnError("Getting kubernetes client", err) + exitOnError("Getting kubernetes client", err) secretClient, err := secret.NewClient(cfg.TestkubeNamespace) - ui.ExitOnError("Getting secret client", err) + exitOnError("Getting secret client", err) configMapClient, err := configmap.NewClient(cfg.TestkubeNamespace) - ui.ExitOnError("Getting config map client", err) + exitOnError("Getting config map client", err) // agent var grpcClient cloud.TestKubeCloudAPIClient var grpcConn *grpc.ClientConn @@ -207,7 +205,7 @@ func main() { cfg.TestkubeProCAFile, log.DefaultLogger, ) - ui.ExitOnError("error creating gRPC connection", err) + exitOnError("error creating gRPC connection", err) defer grpcConn.Close() grpcClient = cloud.NewTestKubeCloudAPIClient(grpcConn) @@ -240,22 +238,22 @@ func main() { clientset, err := k8sclient.ConnectToK8s() if err != nil { - ui.ExitOnError("Creating k8s clientset", err) + exitOnError("Creating k8s clientset", err) } k8sCfg, err := k8sclient.GetK8sClientConfig() if err != nil { - ui.ExitOnError("Getting k8s client config", err) + exitOnError("Getting k8s client config", err) } testkubeClientset, err := testkubeclientset.NewForConfig(k8sCfg) if err != nil { - ui.ExitOnError("Creating TestKube Clientset", err) + exitOnError("Creating TestKube Clientset", err) } var logGrpcClient logsclient.StreamGetter if features.LogsV2 { creds, err := newGRPCTransportCredentials(cfg) - ui.ExitOnError("Getting log server TLS credentials", err) + exitOnError("Getting log server TLS credentials", err) logGrpcClient = logsclient.NewGrpcClient(cfg.LogServerGrpcAddress, creds) } @@ -280,7 +278,7 @@ func main() { } else { mongoSSLConfig := getMongoSSLConfig(cfg, secretClient) db, err := storage.GetMongoDatabase(cfg.APIMongoDSN, cfg.APIMongoDB, cfg.APIMongoDBType, cfg.APIMongoAllowTLS, mongoSSLConfig) - ui.ExitOnError("Getting mongo database", err) + exitOnError("Getting mongo database", err) isDocDb := cfg.APIMongoDBType == storage.TypeDocDB mongoResultsRepository := result.NewMongoRepository(db, cfg.APIMongoAllowDiskUse, isDocDb, result.WithFeatureFlags(features), result.WithLogsClient(logGrpcClient)) resultsRepository = mongoResultsRepository @@ -291,7 +289,7 @@ func main() { triggerLeaseBackend = triggers.NewMongoLeaseBackend(db) minioClient := newStorageClient(cfg) if err = minioClient.Connect(); err != nil { - ui.ExitOnError("Connecting to minio", err) + exitOnError("Connecting to minio", err) } if expErr := minioClient.SetExpirationPolicy(cfg.StorageExpiration); expErr != nil { log.DefaultLogger.Errorw("Error setting expiration policy", "error", expErr) @@ -329,7 +327,7 @@ func main() { } configMapConfig, err := configrepository.NewConfigMapConfig(configName, cfg.TestkubeNamespace) - ui.ExitOnError("Getting config map config", err) + exitOnError("Getting config map config", err) // try to load from mongo based config first telemetryEnabled, err := configMapConfig.GetTelemetryEnabled(ctx) @@ -370,7 +368,7 @@ func main() { // TODO check if this version exists somewhere in stats (probably could be removed) migrations.Migrator.Add(migrations.NewVersion_0_9_2(scriptsClient, testsClientV1, testsClientV3, testsuitesClientV2)) if err := runMigrations(); err != nil { - ui.ExitOnError("Running server migrations", err) + exitOnError("Running server migrations", err) } apiVersion := version.Version @@ -387,7 +385,7 @@ func main() { nc, err := newNATSConnection(cfg) if err != nil { - ui.ExitOnError("Creating NATS connection", err) + exitOnError("Creating NATS connection", err) } eventBus := bus.NewNATSBus(nc) eventsEmitter := event.NewEmitter(eventBus, cfg.TestkubeClusterName, envs) @@ -397,7 +395,7 @@ func main() { if features.LogsV2 { logsStream, err = logsclient.NewNatsLogStream(nc.Conn) if err != nil { - ui.ExitOnError("Creating logs streaming client", err) + exitOnError("Creating logs streaming client", err) } } @@ -405,17 +403,17 @@ func main() { defaultExecutors, err := parseDefaultExecutors(cfg) if err != nil { - ui.ExitOnError("Parsing default executors", err) + exitOnError("Parsing default executors", err) } images, err := kubeexecutor.SyncDefaultExecutors(executorsClient, cfg.TestkubeNamespace, defaultExecutors, cfg.TestkubeReadonlyExecutors) if err != nil { - ui.ExitOnError("Sync default executors", err) + exitOnError("Sync default executors", err) } jobTemplates, err := parser.ParseJobTemplates(cfg) if err != nil { - ui.ExitOnError("Creating job templates", err) + exitOnError("Creating job templates", err) } proContext := newProContext(cfg, grpcClient) @@ -424,7 +422,7 @@ func main() { var subscriptionChecker checktcl.SubscriptionChecker if mode == common.ModeAgent { subscriptionChecker, err = checktcl.NewSubscriptionChecker(ctx, proContext, grpcClient, grpcConn) - ui.ExitOnError("Failed creating subscription checker", err) + exitOnError("Failed creating subscription checker", err) } serviceAccountNames := map[string]string{ @@ -434,7 +432,7 @@ func main() { // Pro edition only (tcl protected code) if cfg.TestkubeExecutionNamespaces != "" { err = subscriptionChecker.IsActiveOrgPlanEnterpriseForFeature("execution namespace") - ui.ExitOnError("Subscription checking", err) + exitOnError("Subscription checking", err) serviceAccountNames = schedulertcl.GetServiceAccountNamesFromConfig(serviceAccountNames, cfg.TestkubeExecutionNamespaces) } @@ -463,12 +461,12 @@ func main() { cfg.TestkubeDefaultStorageClassName, ) if err != nil { - ui.ExitOnError("Creating executor client", err) + exitOnError("Creating executor client", err) } containerTemplates, err := parser.ParseContainerTemplates(cfg) if err != nil { - ui.ExitOnError("Creating container job templates", err) + exitOnError("Creating container job templates", err) } inspectorStorages := []imageinspector.Storage{imageinspector.NewMemoryStorage()} @@ -509,7 +507,7 @@ func main() { cfg.TestkubeDefaultStorageClassName, ) if err != nil { - ui.ExitOnError("Creating container executor", err) + exitOnError("Creating container executor", err) } sched := scheduler.NewScheduler( @@ -542,7 +540,7 @@ func main() { slackLoader, err := newSlackLoader(cfg, envs) if err != nil { - ui.ExitOnError("Creating slack loader", err) + exitOnError("Creating slack loader", err) } api := apiv1.NewTestkubeAPI( @@ -632,12 +630,12 @@ func main() { proContext, ) if err != nil { - ui.ExitOnError("Starting agent", err) + exitOnError("Starting agent", err) } g.Go(func() error { err = agentHandle.Run(ctx) if err != nil { - ui.ExitOnError("Running agent", err) + exitOnError("Running agent", err) } return nil }) @@ -816,25 +814,25 @@ func getMongoSSLConfig(cfg *config.Config, secretClient *secret.Client) *storage clientCertPath := "/tmp/mongodb.pem" rootCAPath := "/tmp/mongodb-root-ca.pem" mongoSSLSecret, err := secretClient.Get(cfg.APIMongoSSLCert) - ui.ExitOnError(fmt.Sprintf("Could not get secret %s for MongoDB connection", cfg.APIMongoSSLCert), err) + exitOnError(fmt.Sprintf("Could not get secret %s for MongoDB connection", cfg.APIMongoSSLCert), err) var keyFile, caFile, pass string var ok bool if keyFile, ok = mongoSSLSecret[cfg.APIMongoSSLClientFileKey]; !ok { - ui.Warn("Could not find sslClientCertificateKeyFile with key %s in secret %s", cfg.APIMongoSSLClientFileKey, cfg.APIMongoSSLCert) + log.DefaultLogger.Warnf("Could not find sslClientCertificateKeyFile with key %s in secret %s", cfg.APIMongoSSLClientFileKey, cfg.APIMongoSSLCert) } if caFile, ok = mongoSSLSecret[cfg.APIMongoSSLCAFileKey]; !ok { - ui.Warn("Could not find sslCertificateAuthorityFile with key %s in secret %s", cfg.APIMongoSSLCAFileKey, cfg.APIMongoSSLCert) + log.DefaultLogger.Warnf("Could not find sslCertificateAuthorityFile with key %s in secret %s", cfg.APIMongoSSLCAFileKey, cfg.APIMongoSSLCert) } if pass, ok = mongoSSLSecret[cfg.APIMongoSSLClientFilePass]; !ok { - ui.Warn("Could not find sslClientCertificateKeyFilePassword with key %s in secret %s", cfg.APIMongoSSLClientFilePass, cfg.APIMongoSSLCert) + log.DefaultLogger.Warnf("Could not find sslClientCertificateKeyFilePassword with key %s in secret %s", cfg.APIMongoSSLClientFilePass, cfg.APIMongoSSLCert) } err = os.WriteFile(clientCertPath, []byte(keyFile), 0644) - ui.ExitOnError(fmt.Sprintf("Could not place mongodb certificate key file: %s", err)) + exitOnError("Could not place mongodb certificate key file", err) err = os.WriteFile(rootCAPath, []byte(caFile), 0644) - ui.ExitOnError(fmt.Sprintf("Could not place mongodb ssl ca file: %s", err)) + exitOnError("Could not place mongodb ssl ca file: %s", err) return &storage.MongoSSLConfig{ SSLClientCertificateKeyFile: clientCertPath, @@ -878,7 +876,7 @@ func newProContext(cfg *config.Config, grpcClient cloud.TestKubeCloudAPIClient) defer cancel() getProContext, err := grpcClient.GetProContext(ctx, &emptypb.Empty{}) if err != nil { - ui.WarnOnError("cannot fetch pro-context from cloud: %s", err) + log.DefaultLogger.Warnf("cannot fetch pro-context from cloud: %s", err) return proContext } @@ -892,3 +890,10 @@ func newProContext(cfg *config.Config, grpcClient cloud.TestKubeCloudAPIClient) return proContext } + +func exitOnError(title string, err error) { + if err != nil { + log.DefaultLogger.Errorw(title, "error", err) + os.Exit(1) + } +} From 2bf480f10eb09e74fa1c4b6541372af5f3f10ad2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 12:49:36 +0200 Subject: [PATCH 35/39] chore(deps): bump formidable and superagent in /test/cli-tests (#5339) Bumps [formidable](https://github.com/node-formidable/formidable) to 3.5.1 and updates ancestor dependency [superagent](https://github.com/ladjs/superagent). These dependencies need to be updated together. Updates `formidable` from 2.1.1 to 3.5.1 - [Release notes](https://github.com/node-formidable/formidable/releases) - [Changelog](https://github.com/node-formidable/formidable/blob/master/CHANGELOG.md) - [Commits](https://github.com/node-formidable/formidable/commits/v3.5.1) Updates `superagent` from 8.0.0 to 9.0.1 - [Release notes](https://github.com/ladjs/superagent/releases) - [Changelog](https://github.com/ladjs/superagent/blob/master/HISTORY.md) - [Commits](https://github.com/ladjs/superagent/compare/v8.0.0...v9.0.1) --- updated-dependencies: - dependency-name: formidable dependency-type: indirect - dependency-name: superagent dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- test/cli-tests/package-lock.json | 417 +++++++++++++++++++++---------- test/cli-tests/package.json | 2 +- 2 files changed, 280 insertions(+), 139 deletions(-) diff --git a/test/cli-tests/package-lock.json b/test/cli-tests/package-lock.json index 36066383f50..2b1ccbaedf4 100644 --- a/test/cli-tests/package-lock.json +++ b/test/cli-tests/package-lock.json @@ -15,7 +15,7 @@ "chai": "^4.3.6", "dotenv": "^16.0.3", "mocha": "^10.1.0", - "superagent": "8.0.0" + "superagent": "9.0.1" } }, "node_modules/@ampproject/remapping": { @@ -2098,13 +2098,19 @@ "dev": true }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2386,6 +2392,23 @@ "node": ">=0.12" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -2435,6 +2458,27 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -2537,15 +2581,14 @@ } }, "node_modules/formidable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.1.tgz", - "integrity": "sha512-0EcS9wCFEzLvfiks7omJ+SiYJAiD+TzK4Pcw1UlUoGnhUxDcMKjt0P7x8wEb0u6OHu8Nb98WG3nxtlF5C7bvUQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.1.tgz", + "integrity": "sha512-WJWKelbRHN41m5dumb0/k8TeAx7Id/y3a+Z7QfhxP/htI9Js5zYaEDtG8uMgG0vM0lOlqnmjE99/kfpOYi/0Og==", "dev": true, "dependencies": { "dezalgo": "^1.0.4", "hexoid": "^1.0.0", - "once": "^1.4.0", - "qs": "^6.11.0" + "once": "^1.4.0" }, "funding": { "url": "https://ko-fi.com/tunnckoCore/commissions" @@ -2572,10 +2615,13 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gensync": { "version": "1.0.0-beta.2", @@ -2605,14 +2651,19 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", - "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -2681,6 +2732,18 @@ "node": ">=4" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -2702,6 +2765,30 @@ "node": ">=8" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -2714,6 +2801,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -3109,9 +3208,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3308,12 +3407,12 @@ } }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.12.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.1.tgz", + "integrity": "sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==", "dev": true, "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -3331,20 +3430,6 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -3494,6 +3579,23 @@ "randombytes": "^2.1.0" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -3507,14 +3609,18 @@ } }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3539,15 +3645,6 @@ "source-map": "^0.6.0" } }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3596,25 +3693,24 @@ } }, "node_modules/superagent": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.0.0.tgz", - "integrity": "sha512-iudipXEel+SzlP9y29UBWGDjB+Zzag+eeA1iLosaR2YHBRr1Q1kC29iBrF2zIVD9fqVbpZnXkN/VJmwFMVyNWg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-9.0.1.tgz", + "integrity": "sha512-CcRSdb/P2oUVaEpQ87w9Obsl+E9FruRd6b2b7LdiBtJoyMr2DQt7a89anAfiX/EL59j9b2CbRFvf2S91DhuCww==", "dev": true, "dependencies": { "component-emitter": "^1.3.0", - "cookiejar": "^2.1.3", + "cookiejar": "^2.1.4", "debug": "^4.3.4", "fast-safe-stringify": "^2.1.1", "form-data": "^4.0.0", - "formidable": "^2.0.1", + "formidable": "^3.5.1", "methods": "^1.1.2", "mime": "2.6.0", - "qs": "^6.10.3", - "readable-stream": "^3.6.0", - "semver": "^7.3.7" + "qs": "^6.11.0", + "semver": "^7.3.8" }, "engines": { - "node": ">=6.4.0 <13 || >=14" + "node": ">=14.18.0" } }, "node_modules/supports-color": { @@ -3731,12 +3827,6 @@ "browserslist": ">= 4.21.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", @@ -5344,13 +5434,16 @@ "dev": true }, "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" } }, "camelcase": { @@ -5557,6 +5650,17 @@ "type-detect": "^4.0.0" } }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -5597,6 +5701,21 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -5669,15 +5788,14 @@ } }, "formidable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.1.tgz", - "integrity": "sha512-0EcS9wCFEzLvfiks7omJ+SiYJAiD+TzK4Pcw1UlUoGnhUxDcMKjt0P7x8wEb0u6OHu8Nb98WG3nxtlF5C7bvUQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.1.tgz", + "integrity": "sha512-WJWKelbRHN41m5dumb0/k8TeAx7Id/y3a+Z7QfhxP/htI9Js5zYaEDtG8uMgG0vM0lOlqnmjE99/kfpOYi/0Og==", "dev": true, "requires": { "dezalgo": "^1.0.4", "hexoid": "^1.0.0", - "once": "^1.4.0", - "qs": "^6.11.0" + "once": "^1.4.0" } }, "fs.realpath": { @@ -5694,9 +5812,9 @@ "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true }, "gensync": { @@ -5718,14 +5836,16 @@ "dev": true }, "get-intrinsic": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz", - "integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, "glob": { @@ -5778,6 +5898,15 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -5793,12 +5922,36 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true + }, "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", "dev": true }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -6083,9 +6236,9 @@ "dev": true }, "object-inspect": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz", - "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true }, "once": { @@ -6224,12 +6377,12 @@ } }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.12.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.1.tgz", + "integrity": "sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ==", "dev": true, "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "randombytes": { @@ -6241,17 +6394,6 @@ "safe-buffer": "^5.1.0" } }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -6360,6 +6502,20 @@ "randombytes": "^2.1.0" } }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, "shallow-clone": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", @@ -6370,14 +6526,15 @@ } }, "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" } }, "source-map": { @@ -6396,15 +6553,6 @@ "source-map": "^0.6.0" } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, - "requires": { - "safe-buffer": "~5.2.0" - } - }, "string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -6440,22 +6588,21 @@ "dev": true }, "superagent": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.0.0.tgz", - "integrity": "sha512-iudipXEel+SzlP9y29UBWGDjB+Zzag+eeA1iLosaR2YHBRr1Q1kC29iBrF2zIVD9fqVbpZnXkN/VJmwFMVyNWg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-9.0.1.tgz", + "integrity": "sha512-CcRSdb/P2oUVaEpQ87w9Obsl+E9FruRd6b2b7LdiBtJoyMr2DQt7a89anAfiX/EL59j9b2CbRFvf2S91DhuCww==", "dev": true, "requires": { "component-emitter": "^1.3.0", - "cookiejar": "^2.1.3", + "cookiejar": "^2.1.4", "debug": "^4.3.4", "fast-safe-stringify": "^2.1.1", "form-data": "^4.0.0", - "formidable": "^2.0.1", + "formidable": "^3.5.1", "methods": "^1.1.2", "mime": "2.6.0", - "qs": "^6.10.3", - "readable-stream": "^3.6.0", - "semver": "^7.3.7" + "qs": "^6.11.0", + "semver": "^7.3.8" } }, "supports-color": { @@ -6526,12 +6673,6 @@ "picocolors": "^1.0.0" } }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, "workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", diff --git a/test/cli-tests/package.json b/test/cli-tests/package.json index 682e3f3bdb7..a2fce66b404 100644 --- a/test/cli-tests/package.json +++ b/test/cli-tests/package.json @@ -7,7 +7,7 @@ "chai": "^4.3.6", "dotenv": "^16.0.3", "mocha": "^10.1.0", - "superagent": "8.0.0" + "superagent": "9.0.1" }, "scripts": { "test": "mocha --require @babel/register tests/ --require dotenv/config --timeout 30000 --parallel" From d7de000e46fa66ac116b7132adbcf8d8a2882623 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 12:49:49 +0200 Subject: [PATCH 36/39] chore(deps): bump peter-evans/repository-dispatch from 2 to 3 (#5515) Bumps [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) from 2 to 3. - [Release notes](https://github.com/peter-evans/repository-dispatch/releases) - [Commits](https://github.com/peter-evans/repository-dispatch/compare/v2...v3) --- updated-dependencies: - dependency-name: peter-evans/repository-dispatch dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/agent-test-update-dispatch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/agent-test-update-dispatch.yaml b/.github/workflows/agent-test-update-dispatch.yaml index 3840af44863..eae721d322d 100644 --- a/.github/workflows/agent-test-update-dispatch.yaml +++ b/.github/workflows/agent-test-update-dispatch.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Update tests at dev agent - uses: peter-evans/repository-dispatch@v2 + uses: peter-evans/repository-dispatch@v3 with: repository: kubeshop/testkube-cloud-api event-type: create_update_tests From 477895b036e2da9be7f1161aa352b7f80cdde067 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 May 2024 12:50:05 +0200 Subject: [PATCH 37/39] --- (#5465) updated-dependencies: - dependency-name: anchore/sbom-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../docker-build-api-executors-tag.yaml | 22 +++++++++---------- .github/workflows/release-dev.yaml | 2 +- .github/workflows/release-log-server.yaml | 2 +- .github/workflows/release-log-sidecar.yaml | 2 +- .github/workflows/release.yaml | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker-build-api-executors-tag.yaml b/.github/workflows/docker-build-api-executors-tag.yaml index 6492b05c80e..0318c007c58 100644 --- a/.github/workflows/docker-build-api-executors-tag.yaml +++ b/.github/workflows/docker-build-api-executors-tag.yaml @@ -19,7 +19,7 @@ jobs: uses: actions/checkout@v4 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up Docker Buildx id: buildx @@ -86,7 +86,7 @@ jobs: uses: actions/checkout@v4 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up Docker Buildx id: buildx @@ -142,7 +142,7 @@ jobs: uses: actions/checkout@v4 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up Docker Buildx id: buildx @@ -224,7 +224,7 @@ jobs: uses: actions/checkout@v4 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -295,7 +295,7 @@ jobs: uses: actions/checkout@v4 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -363,7 +363,7 @@ jobs: uses: actions/checkout@v4 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -488,7 +488,7 @@ jobs: uses: actions/checkout@v4 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -556,7 +556,7 @@ jobs: uses: actions/checkout@v4 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -715,7 +715,7 @@ jobs: uses: actions/checkout@v4 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -787,7 +787,7 @@ jobs: uses: docker/setup-qemu-action@v3 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up Docker Buildx id: buildx @@ -836,7 +836,7 @@ jobs: uses: actions/checkout@v4 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/.github/workflows/release-dev.yaml b/.github/workflows/release-dev.yaml index 63e31e7f9b6..31a8e419a6a 100644 --- a/.github/workflows/release-dev.yaml +++ b/.github/workflows/release-dev.yaml @@ -131,7 +131,7 @@ jobs: with: fetch-depth: 0 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Download Artifacts for Linux uses: actions/download-artifact@master with: diff --git a/.github/workflows/release-log-server.yaml b/.github/workflows/release-log-server.yaml index 5d8fb7eed6c..f06a6334fee 100644 --- a/.github/workflows/release-log-server.yaml +++ b/.github/workflows/release-log-server.yaml @@ -31,7 +31,7 @@ jobs: uses: docker/setup-buildx-action@v3 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up Go uses: actions/setup-go@v5 diff --git a/.github/workflows/release-log-sidecar.yaml b/.github/workflows/release-log-sidecar.yaml index 1220c3f80e4..fe5bf9e32ec 100644 --- a/.github/workflows/release-log-sidecar.yaml +++ b/.github/workflows/release-log-sidecar.yaml @@ -31,7 +31,7 @@ jobs: uses: docker/setup-buildx-action@v3 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Set up Go uses: actions/setup-go@v5 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e4ed72bb46f..f498ef04b96 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -121,7 +121,7 @@ jobs: with: fetch-depth: 0 - uses: sigstore/cosign-installer@v3.5.0 - - uses: anchore/sbom-action/download-syft@v0.15.11 + - uses: anchore/sbom-action/download-syft@v0.16.0 - name: Download Artifacts for Linux uses: actions/download-artifact@master with: From 7f6f4210f4fd741f9a31303ebae82a220c9ebd64 Mon Sep 17 00:00:00 2001 From: ypoplavs Date: Thu, 30 May 2024 14:00:02 +0300 Subject: [PATCH 38/39] fix in endpoints --- docs/docs/articles/install/install-with-helm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/articles/install/install-with-helm.md b/docs/docs/articles/install/install-with-helm.md index 6a69c514237..aa6fa0859f5 100644 --- a/docs/docs/articles/install/install-with-helm.md +++ b/docs/docs/articles/install/install-with-helm.md @@ -71,8 +71,8 @@ By default, the following services will be exposed. You can also choose to overr | REST API | api.$domain | global.restApiSubdomain | | gRPC API | agent.$domain | global.grpcApiSubdomain | | WebSockets API | websockets.$domain | global.websocketsApiSubdomain | -| Status Pages API | status.$domain | global.statusPagesApiSubdomain | | Storage API | storage.$domain | global.storageApiSubdomain | +| Dex | api.$domain | global.restApiSubdomain | TLS can either be handled through cert-manager or a manually defined secret. While custom TLS certificates are possible, we strongly recommend using `cert-manager` for simplified certificate manager. From bec7c5d420a53a88dc448efc15e09908b70a725f Mon Sep 17 00:00:00 2001 From: Vladislav Sukhin Date: Thu, 30 May 2024 15:47:19 +0300 Subject: [PATCH 39/39] fix: slaves env name --- contrib/executor/jmeterd/scripts/jmeter-slaves.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/executor/jmeterd/scripts/jmeter-slaves.sh b/contrib/executor/jmeterd/scripts/jmeter-slaves.sh index bf5ff6be4d9..3fe9b45dbc6 100644 --- a/contrib/executor/jmeterd/scripts/jmeter-slaves.sh +++ b/contrib/executor/jmeterd/scripts/jmeter-slaves.sh @@ -31,14 +31,14 @@ freeMem=`awk '/MemAvailable/ { print int($2/1024) }' /proc/meminfo` echo "Setting dynamically heap size based on available resources JVM_ARGS=-Xmn${JVM_XMN}m -Xms${JVM_XMS}m -Xmx${JVM_XMX}m" export JVM_ARGS="-Xmn${JVM_XMN}m -Xms${JVM_XMS}m -Xmx${JVM_XMX}m" -if [ -n "$OVERRIDE_JVM_ARGS" ]; then - echo "Overriding JVM_ARGS=${OVERRIDE_JVM_ARGS}" - export JVM_ARGS="${OVERRIDE_JVM_ARGS}" +if [ -n "$SLAVES_OVERRIDE_JVM_ARGS" ]; then + echo "Overriding JVM_ARGS=${SLAVES_OVERRIDE_JVM_ARGS}" + export JVM_ARGS="${SLAVES_OVERRIDE_JVM_ARGS}" fi -if [ -n "$ADDITIONAL_JVM_ARGS" ]; then - echo "Appending additional JVM args: ${ADDITIONAL_JVM_ARGS}" - export JVM_ARGS="${JVM_ARGS} ${ADDITIONAL_JVM_ARGS}" +if [ -n "$SLAVES_ADDITIONAL_JVM_ARGS" ]; then + echo "Appending additional JVM args: ${SLAVES_ADDITIONAL_JVM_ARGS}" + export JVM_ARGS="${JVM_ARGS} ${SLAVES_ADDITIONAL_JVM_ARGS}" fi echo "Available memory: ${freeMem} MB"