diff --git a/.github/workflows/pr-workflow.yaml b/.github/workflows/pr-workflow.yaml index f23707fa..9c24d0ef 100644 --- a/.github/workflows/pr-workflow.yaml +++ b/.github/workflows/pr-workflow.yaml @@ -32,6 +32,9 @@ jobs: with: application-id: D6uz-lhAGBYuTTc6Jj_w0Q-a environment-id: I9tfo2dWd7WSigXcO91feA-e + # Intentionally trigger deprecation warning + uri: 'https://sandbox.mabl.com' + app-url: 'https://storage.googleapis.com/public-test-pages/uptime/canary.html' browser-types: | chrome plan-labels: | diff --git a/.github/workflows/push-workflow.yaml b/.github/workflows/push-workflow.yaml index 44d567cc..e539346d 100644 --- a/.github/workflows/push-workflow.yaml +++ b/.github/workflows/push-workflow.yaml @@ -33,6 +33,9 @@ jobs: with: application-id: D6uz-lhAGBYuTTc6Jj_w0Q-a environment-id: I9tfo2dWd7WSigXcO91feA-e + # Intentionally trigger deprecation warning + uri: 'https://sandbox.mabl.com' + app-url: 'https://storage.googleapis.com/public-test-pages/uptime/canary.html' browser-types: | chrome plan-labels: | diff --git a/README.md b/README.md index e34e1945..b7c57f05 100644 --- a/README.md +++ b/README.md @@ -107,8 +107,12 @@ jobs: types to test e.g. `chrome, firefox, safari, internet_explorer`. If not provided, mabl will test the browsers configured on the triggered test. - `plan-labels` {string} (optional): comma or new line separated plan labels to test. Plans matching **any** label will be run. e.g. `smoke-test, beta-feature`. Note: additional selection criteria must also be met like application-id or environment-id, if supplied. -- `uri` {string} (optional) the base uri to test against. If provided, this will +- `uri` {string} (optional, DEPRECATED - use app_url) the base uri to run browser based tests against. If provided, this will override the default uri associated with the environment in mabl +- `app-url` {string} (optional) the base uri to run **Web Browser tests** against. If provided, this will + override the default web browser uri associated with the environment in mabl (note, this replaces `uri`, and will supersede the value in `uri` if both are provided) +- `api-url` {string} (optional) the base uri to run **API tests** against. If provided, this will + override the default API uri associated with the environment in mabl - `mabl-branch` {string} (optional) run tests on the mabl branch of tests with this name. Defaults to `master`. - `http-headers` {string} (optional) Headers to add to all requests e.g. "My-Header:the-value" (comma or new line delimited). - `rebaseline-images` {boolean} (optional) - Set `true` to reset the visual diff --git a/action.yml b/action.yml index ab25c0df..45e776d0 100644 --- a/action.yml +++ b/action.yml @@ -27,8 +27,19 @@ inputs: required: false uri: description: ^ - 'Base URI to test against. If provided, this will override the default URI - associated with the environment in mabl' + 'The base uri to test browser based tests against. If provided, this will + override the default uri associated with the environment in mabl' + deprecationMessage: "use 'app-url' instead" + required: false + app-url: + description: ^ + 'The base uri to run WEB BROWSER TESTS against. If provided, this will + override the default web browser uri associated with the environment in mabl (note, this replaces `uri`, and will override the value in `uri` if both are provided)' + required: false + api-url: + description: ^ + 'The base uri to run API TESTS against. If provided, this will + override the default API uri associated with the environment in mabl' required: false mabl-branch: description: ^ @@ -42,19 +53,19 @@ inputs: description: ^ 'Set to true to reset the visual baseline to the current deployment' required: false - default: false + default: 'false' set-static-baseline: description: ^ 'Set to true to use the current deployment as an exact static baseline. If this is set, mabl will not model dynamic areas and will use the current deployment as a pixel-exact visual baseline.' required: false - default: false + default: 'false' continue-on-failure: description: ^ 'Set to true to continue the build even if there are test failures' required: false - default: false + default: 'false' event-time: description: "Event time the deployment occurred. Defaults to now." required: false diff --git a/package-lock.json b/package-lock.json index 92b7fab5..9d15c67e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "mabl-github-deployments-action", - "version": "1.13.1", + "version": "1.14.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mabl-github-deployments-action", - "version": "1.13.1", + "version": "1.14.0", "dependencies": { - "@actions/core": "1.10.1", + "@actions/core": "1.11.1", "@actions/github": "6.0.0", "async-retry": "1.3.3", - "axios": "1.7.1", + "axios": "1.7.9", "cli-table3": "0.6.5", "moment": "2.30.1" }, @@ -23,21 +23,29 @@ "@typescript-eslint/parser": "5.19.0", "eslint": "8.13.0", "eslint-plugin-import": "2.26.0", - "eslint-plugin-jsdoc": "39.1.0", + "eslint-plugin-jsdoc": "50.6.1", "eslint-plugin-no-null": "1.0.2", "jest": "29.2.1", "prettier": "2.6.2", - "ts-jest": "29.0.3", - "typescript": "4.8.4" + "ts-jest": "29.2.5", + "typescript": "5.7.2" } }, "node_modules/@actions/core": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz", - "integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz", + "integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==", "dependencies": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" + "@actions/exec": "^1.1.1", + "@actions/http-client": "^2.0.1" + } + }, + "node_modules/@actions/exec": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.1.tgz", + "integrity": "sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==", + "dependencies": { + "@actions/io": "^1.0.1" } }, "node_modules/@actions/github": { @@ -60,6 +68,11 @@ "undici": "^5.25.4" } }, + "node_modules/@actions/io": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.1.3.tgz", + "integrity": "sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==" + }, "node_modules/@ampproject/remapping": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", @@ -690,17 +703,17 @@ } }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.22.1", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.22.1.tgz", - "integrity": "sha512-/WMkqLYfwCf0waCAMC8Eddt3iAOdghkDF5vmyKEu8pfO66KRFY1L15yks8mfgURiwOAOJpAQ3blvB3Znj6ZwBw==", + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.49.0.tgz", + "integrity": "sha512-xjZTSFgECpb9Ohuk5yMX5RhUEbfeQcuOp8IF60e+wyzWEF0M5xeSgqsfLtvPEX8BIyOX9saZqzuGPmZ8oWc+5Q==", "dev": true, "dependencies": { - "comment-parser": "1.3.1", - "esquery": "^1.4.0", - "jsdoc-type-pratt-parser": "~2.2.5" + "comment-parser": "1.4.1", + "esquery": "^1.6.0", + "jsdoc-type-pratt-parser": "~4.1.0" }, "engines": { - "node": "^12 || ^14 || ^16 || ^17" + "node": ">=16" } }, "node_modules/@eslint/eslintrc": { @@ -1381,6 +1394,18 @@ "@octokit/openapi-types": "^22.2.0" } }, + "node_modules/@pkgr/core": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", + "integrity": "sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, "node_modules/@sinclair/typebox": { "version": "0.24.47", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.47.tgz", @@ -1737,9 +1762,9 @@ } }, "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1836,6 +1861,15 @@ "node": ">= 8" } }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1887,6 +1921,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true + }, "node_modules/async-retry": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", @@ -1901,9 +1941,9 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "node_modules/axios": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.1.tgz", - "integrity": "sha512-+LV37nQcd1EpFalkXksWNBiA17NZ5m5/WspmHGmZmdx1qBOg/VNq/c4eRJiA9VQQHBOs+N0ZhhdU10h2TyNK7Q==", + "version": "1.7.9", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", + "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -2036,12 +2076,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -2260,9 +2300,9 @@ } }, "node_modules/comment-parser": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.1.tgz", - "integrity": "sha512-B52sN2VNghyq5ofvUsqZjmk6YkihBX5vMSChmSK9v4ShjKf3Vk5Xcmgpw4o+iIgtrnM/u5FiMpz9VKb8lpBveA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", "dev": true, "engines": { "node": ">= 12.0.0" @@ -2281,9 +2321,9 @@ "dev": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "dependencies": { "path-key": "^3.1.0", @@ -2295,12 +2335,12 @@ } }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -2399,6 +2439,21 @@ "node": ">=6.0.0" } }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dev": true, + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/electron-to-chromium": { "version": "1.4.284", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz", @@ -2465,6 +2520,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-module-lexer": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.6.0.tgz", + "integrity": "sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ==", + "dev": true + }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -2651,24 +2712,57 @@ "dev": true }, "node_modules/eslint-plugin-jsdoc": { - "version": "39.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-39.1.0.tgz", - "integrity": "sha512-KgpoLbeSEL3yv6T3QMErelPy+WFJSQkDoUOZTRmqCcsvQ4bmA02Vmw6WbC5cdYQ6P52iUIsAxtXTT66EF/Xzeg==", + "version": "50.6.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.6.1.tgz", + "integrity": "sha512-UWyaYi6iURdSfdVVqvfOs2vdCVz0J40O/z/HTsv2sFjdjmdlUI/qlKLOTmwbPQ2tAfQnE5F9vqx+B+poF71DBQ==", "dev": true, "dependencies": { - "@es-joy/jsdoccomment": "~0.22.1", - "comment-parser": "1.3.1", - "debug": "^4.3.4", + "@es-joy/jsdoccomment": "~0.49.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.6", "escape-string-regexp": "^4.0.0", - "esquery": "^1.4.0", - "semver": "^7.3.6", - "spdx-expression-parse": "^3.0.1" + "espree": "^10.1.0", + "esquery": "^1.6.0", + "parse-imports": "^2.1.1", + "semver": "^7.6.3", + "spdx-expression-parse": "^4.0.0", + "synckit": "^0.9.1" }, "engines": { - "node": "^14 || ^16 || ^17" + "node": ">=18" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/eslint-plugin-no-null": { @@ -2794,9 +2888,9 @@ } }, "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -2965,10 +3059,40 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dev": true, + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -3666,6 +3790,24 @@ "node": ">=8" } }, + "node_modules/jake": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", + "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", + "dev": true, + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jest": { "version": "29.2.1", "resolved": "https://registry.npmjs.org/jest/-/jest-29.2.1.tgz", @@ -4297,9 +4439,9 @@ } }, "node_modules/jsdoc-type-pratt-parser": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-2.2.5.tgz", - "integrity": "sha512-2a6eRxSxp1BW040hFvaJxhsCMI9lT8QB8t14t+NY5tC5rckIR0U9cr2tjOeaFirmEOy6MHvmJnY7zTBHq431Lw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.1.0.tgz", + "integrity": "sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==", "dev": true, "engines": { "node": ">=12.0.0" @@ -4464,12 +4606,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -4531,9 +4673,9 @@ } }, "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/natural-compare": { @@ -4713,6 +4855,19 @@ "node": ">=6" } }, + "node_modules/parse-imports": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/parse-imports/-/parse-imports-2.2.1.tgz", + "integrity": "sha512-OL/zLggRp8mFhKL0rNORUTR4yBYujK/uU+xZL+/0Rgm2QE4nLO9v8PzEweSJEbMGKmDRjJE4R3IMJlL2di4JeQ==", + "dev": true, + "dependencies": { + "es-module-lexer": "^1.5.3", + "slashes": "^3.0.12" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -5119,9 +5274,9 @@ } }, "node_modules/semver": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", - "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -5186,6 +5341,12 @@ "node": ">=8" } }, + "node_modules/slashes": { + "version": "3.0.12", + "resolved": "https://registry.npmjs.org/slashes/-/slashes-3.0.12.tgz", + "integrity": "sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==", + "dev": true + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -5206,15 +5367,15 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", "dev": true }, "node_modules/spdx-expression-parse": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", "dev": true, "dependencies": { "spdx-exceptions": "^2.1.0", @@ -5222,9 +5383,9 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", - "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==", + "version": "3.0.20", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.20.tgz", + "integrity": "sha512-jg25NiDV/1fLtSgEgyvVyDunvaNHbuwF9lfNV17gSmPFAlYzdfNBlLtLzXTevwkPj7DhGbmN9VnmJIgLnhvaBw==", "dev": true }, "node_modules/sprintf-js": { @@ -5371,6 +5532,28 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/synckit": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.9.2.tgz", + "integrity": "sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==", + "dev": true, + "dependencies": { + "@pkgr/core": "^0.1.0", + "tslib": "^2.6.2" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/synckit/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -5419,37 +5602,42 @@ } }, "node_modules/ts-jest": { - "version": "29.0.3", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.3.tgz", - "integrity": "sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==", + "version": "29.2.5", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.2.5.tgz", + "integrity": "sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA==", "dev": true, "dependencies": { - "bs-logger": "0.x", - "fast-json-stable-stringify": "2.x", + "bs-logger": "^0.2.6", + "ejs": "^3.1.10", + "fast-json-stable-stringify": "^2.1.0", "jest-util": "^29.0.0", - "json5": "^2.2.1", - "lodash.memoize": "4.x", - "make-error": "1.x", - "semver": "7.x", - "yargs-parser": "^21.0.1" + "json5": "^2.2.3", + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.6.3", + "yargs-parser": "^21.1.1" }, "bin": { "ts-jest": "cli.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0", "@jest/types": "^29.0.0", "babel-jest": "^29.0.0", "jest": "^29.0.0", - "typescript": ">=4.3" + "typescript": ">=4.3 <6" }, "peerDependenciesMeta": { "@babel/core": { "optional": true }, + "@jest/transform": { + "optional": true + }, "@jest/types": { "optional": true }, @@ -5548,16 +5736,16 @@ } }, "node_modules/typescript": { - "version": "4.8.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.4.tgz", - "integrity": "sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/unbox-primitive": { @@ -5632,14 +5820,6 @@ "punycode": "^2.1.0" } }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", diff --git a/package.json b/package.json index 72eb8376..d443a002 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mabl-github-deployments-action", - "version": "1.14.0", + "version": "1.15.0", "description": "mabl github action for GitHub pipelines integration", "main": "lib/src/entrypoint.js", "scripts": { @@ -16,10 +16,10 @@ }, "author": "mabl", "dependencies": { - "@actions/core": "1.10.1", + "@actions/core": "1.11.1", "@actions/github": "6.0.0", "async-retry": "1.3.3", - "axios": "1.7.1", + "axios": "1.7.9", "cli-table3": "0.6.5", "moment": "2.30.1" }, @@ -31,11 +31,11 @@ "@typescript-eslint/parser": "5.19.0", "eslint": "8.13.0", "eslint-plugin-import": "2.26.0", - "eslint-plugin-jsdoc": "39.1.0", + "eslint-plugin-jsdoc": "50.6.1", "eslint-plugin-no-null": "1.0.2", "jest": "29.2.1", "prettier": "2.6.2", - "ts-jest": "29.0.3", - "typescript": "4.8.4" + "ts-jest": "29.2.5", + "typescript": "5.7.2" } } diff --git a/src/constants.ts b/src/constants.ts index 5fd2a2e4..526fd5dc 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -12,6 +12,8 @@ export enum ActionInputs { RebaselineImages = 'rebaseline-images', SetStaticBaseline = 'set-static-baseline', Uri = 'uri', + UrlApi = 'api-url', + UrlApp = 'app-url', } export enum ActionOutputs { diff --git a/src/entities/Application.ts b/src/entities/Application.ts index e7d6c25b..5a5ce9b5 100644 --- a/src/entities/Application.ts +++ b/src/entities/Application.ts @@ -5,5 +5,6 @@ export interface Application { last_updated_time: number; last_updated_by_id: string; organization_id: string; + workspace_id: string; name: string; } diff --git a/src/entities/Environment.ts b/src/entities/Environment.ts index 687192a0..a76c8266 100644 --- a/src/entities/Environment.ts +++ b/src/entities/Environment.ts @@ -5,5 +5,6 @@ export interface Environment { last_updated_time: number; last_updated_by_id: string; organization_id: string; + workspace_id: string; name: string; } diff --git a/src/index.ts b/src/index.ts index 365ae4c5..0d25621b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -82,6 +82,8 @@ export async function run(enableFailureExitCodes = true): Promise { const browserTypes = optionalArrayInput(ActionInputs.BrowserTypes); const httpHeaders = optionalArrayInput(ActionInputs.HttpHeaders); const uri = optionalInput(ActionInputs.Uri); + const apiUrl = optionalInput(ActionInputs.UrlApi); + const appUrl = optionalInput(ActionInputs.UrlApp); const mablBranch = optionalInput(ActionInputs.MablBranch); // deployment action options @@ -93,6 +95,21 @@ export async function run(enableFailureExitCodes = true): Promise { const eventTimeString = optionalInput(ActionInputs.EventTime); const eventTime = eventTimeString ? parseInt(eventTimeString) : Date.now(); + // Helpful warning notices + if (uri) { + core.warning( + `[${ActionInputs.Uri}] has been deprecated. Please use [${ActionInputs.UrlApp}] instead.`, + ); + } + + if (uri && appUrl) { + core.warning( + `Both [${ActionInputs.Uri}] and [${ActionInputs.UrlApp}] were set. The value for [${ActionInputs.UrlApp}] will be used`, + ); + } + + const effectiveAppUrl = appUrl ?? uri; + let properties: DeploymentProperties = { triggering_event_name: process.env.GITHUB_EVENT_NAME, repository_commit_username: process.env.GITHUB_ACTOR, @@ -143,7 +160,8 @@ export async function run(enableFailureExitCodes = true): Promise { properties, applicationId, environmentId, - uri, + effectiveAppUrl, + apiUrl, revision, mablBranch, ); @@ -165,7 +183,10 @@ export async function run(enableFailureExitCodes = true): Promise { return; // exit } - const outputLink = `${baseAppUrl}/workspaces/${appOrEnv.organization_id}/events/${deployment.id}`; + const effectiveWorkspaceId = + appOrEnv.workspace_id ?? appOrEnv.organization_id; + + const outputLink = `${baseAppUrl}/workspaces/${effectiveWorkspaceId}/events/${deployment.id}`; core.info(`Deployment triggered. View output at: ${outputLink}`); core.startGroup('Await completion of tests'); diff --git a/src/mablApiClient.ts b/src/mablApiClient.ts index cbeadb58..6be20358 100644 --- a/src/mablApiClient.ts +++ b/src/mablApiClient.ts @@ -135,7 +135,8 @@ export class MablApiClient { properties: DeploymentProperties, applicationId?: string, environmentId?: string, - uri?: string, + appUrl?: string, + apiUrl?: string, revision?: string, mablBranch?: string, ): Promise { @@ -150,7 +151,8 @@ export class MablApiClient { properties, applicationId, environmentId, - uri, + appUrl, + apiUrl, revision, mablBranch, ); @@ -173,7 +175,8 @@ export class MablApiClient { properties: DeploymentProperties, applicationId?: string, environmentId?: string, - uri?: string, + appUrl?: string, + apiUrl?: string, revision?: string, mablBranch?: string, ): any { @@ -195,8 +198,11 @@ export class MablApiClient { planOverrides.browser_types = browserTypes; } - if (uri) { - planOverrides.uri = uri; + if (appUrl) { + planOverrides.web_url = appUrl; + } + if (apiUrl) { + planOverrides.api_url = apiUrl; } if (httpHeaders.length) { diff --git a/test/suite.test.ts b/test/suite.test.ts index 84ad4a79..7f34e63d 100644 --- a/test/suite.test.ts +++ b/test/suite.test.ts @@ -124,7 +124,8 @@ describe('GitHub Action tests', () => { application_id: 'app', plan_overrides: { browser_types: ['firefox', 'chrome', 'internet_explorer'], - uri: 'uri', + web_url: 'fake-app-url', + api_url: 'fake-api-url', }, actions: {rebaseline_images: true, set_static_baseline: true}, revision: 'abcs', @@ -166,7 +167,8 @@ describe('GitHub Action tests', () => { }, 'app', 'env', - 'uri', + 'fake-app-url', + 'fake-api-url', 'abcs', ); expect(expected).toStrictEqual(requestBody); @@ -177,7 +179,7 @@ describe('GitHub Action tests', () => { application_id: 'app', plan_labels: ['alpha', 'beta'], plan_overrides: { - uri: 'uri', + web_url: 'fake-app-url', browser_types: ['chrome', 'firefox'], http_headers: [{ name: 'Header-Uno', @@ -230,7 +232,73 @@ describe('GitHub Action tests', () => { }, 'app', '', - 'uri', + 'fake-app-url', + undefined, + 'abcs', + ); + expect(expected).toStrictEqual(requestBody); + }); + + it('builds the request correctly with some options API test override', () => { + const expected = { + application_id: 'app', + plan_labels: ['alpha', 'beta'], + plan_overrides: { + api_url: 'fake-api-url', + browser_types: ['chrome', 'firefox'], + http_headers: [{ + name: 'Header-Uno', + value: 'value-uno', + log_header_value: false, + }, { + name: 'Header-Dos', + value: 'value-dos', + log_header_value: false, + }], + http_headers_required: true + }, + actions: {}, + revision: 'abcs', + properties: { + repository_branch_name: 'master', + repository_commit_username: 'gcooney', + repository_action: 'mabl-tests', + repository_name: 'github-mabl-actions', + repository_url: 'git@github.com:mablhq/github-mabl-actions.git', + triggering_event_name: 'push', + repository_pull_request_url: 'https://github.com/mablhq/repo/pr/1', + repository_pull_request_number: 5, + repository_pull_request_title: 'good pr', + repository_pull_request_merged_at: '2019', + repository_pull_request_created_at: '2019', + }, + }; + const apiClient = new MablApiClient('test'); + const requestBody = apiClient.buildRequestBody( + ['chrome', 'firefox'], + ['alpha', 'beta'], + ['Header-Uno:value-uno', 'Header-Dos:value-dos'], + false, + false, + + 0, + { + repository_branch_name: 'master', + repository_commit_username: 'gcooney', + repository_action: 'mabl-tests', + repository_name: 'github-mabl-actions', + repository_url: 'git@github.com:mablhq/github-mabl-actions.git', + triggering_event_name: 'push', + repository_pull_request_url: 'https://github.com/mablhq/repo/pr/1', + repository_pull_request_number: 5, + repository_pull_request_title: 'good pr', + repository_pull_request_merged_at: '2019', + repository_pull_request_created_at: '2019', + }, + 'app', + '', + undefined, + 'fake-api-url', 'abcs', ); expect(expected).toStrictEqual(requestBody);