From 24435d6b6906f10b5f62285cb76b0295df0cfc10 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Tue, 26 Sep 2023 15:03:41 -0700 Subject: [PATCH 01/39] adding functionality to check if all orgs are the same in foreman.toml --- __tests__/hello.test.ts | 28 ++ package-lock.json | 807 +++++++++++++++++++++------------------- package.json | 7 +- src/configFile.ts | 89 +++++ src/main.ts | 8 + 5 files changed, 549 insertions(+), 390 deletions(-) create mode 100644 src/configFile.ts diff --git a/__tests__/hello.test.ts b/__tests__/hello.test.ts index 9c194c5..0a805c6 100644 --- a/__tests__/hello.test.ts +++ b/__tests__/hello.test.ts @@ -1,5 +1,33 @@ // who needs tests? +import configFile from "../src/configFile"; +import { parse } from "toml"; test("get off my back, Jest", () => { expect(5).toEqual(5); }); + +test("checkSameOrgToolSpec same org", () => { + let config = ` + [tools]\n + rojo = { source = "Roblox/Rojo-rbx-rojo", version = "6.2.0" }\n + selene = { source = "Roblox/Kampfkarren-selene", version = "0.18" }\n + stylua = { source = "Roblox/JohnnyMorganz-StyLua", version = "0.13" }\n + luau-analyze = { source = "Roblox/JohnnyMorganz-luau-analyze-rojo", version = "0.527" }\n + darklua = { gitlab = "Roblox/seaofvoices-darklua", version = "0.7.0" }\n + `; + let manifestContent = parse(config); + expect(configFile.checkSameOrgToolSpecs(manifestContent)).toEqual(true); +}); + +test("checkSameOrgToolSpec different org", () => { + let config = ` + [tools]\n + rojo = { source = "Rojo-rbx/rojo", version = "6.2.0" }\n + selene = { source = "Roblox/Kampfkarren-selene", version = "0.18" }\n + stylua = { source = "Roblox/JohnnyMorganz-StyLua", version = "0.13" }\n + luau-analyze = { source = "Roblox/JohnnyMorganz-luau-analyze-rojo", version = "0.527" }\n + darklua = { gitlab = "Roblox/seaofvoices-darklua", version = "0.7.0" }\n + `; + let manifestContent = parse(config); + expect(configFile.checkSameOrgToolSpecs(manifestContent)).toEqual(false); +}); diff --git a/package-lock.json b/package-lock.json index 5e129fa..c7e5bc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,8 @@ "@actions/github": "^2.1.1", "@actions/tool-cache": "^1.3.1", "axios": "^0.21.2", - "semver": "^7.1.3" + "semver": "^7.1.3", + "toml": "^3.0.0" }, "devDependencies": { "@types/jest": "29.x.x", @@ -25,11 +26,11 @@ "eslint": "^8.15.0", "eslint-plugin-github": "^4.3.6", "eslint-plugin-jest": "^26.1.5", - "jest": "29.x.x", + "jest": "^29.7.0", "jest-circus": "29.x.x", "js-yaml": "^3.13.1", "prettier": "^2.6.2", - "ts-jest": "29.x.x", + "ts-jest": "^29.1.1", "typescript": "^4.3.0" } }, @@ -930,16 +931,16 @@ } }, "node_modules/@jest/console": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.5.0.tgz", - "integrity": "sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0" }, "engines": { @@ -947,37 +948,37 @@ } }, "node_modules/@jest/core": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.5.0.tgz", - "integrity": "sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "dependencies": { - "@jest/console": "^29.5.0", - "@jest/reporters": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "ci-info": "^3.2.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.5.0", - "jest-config": "^29.5.0", - "jest-haste-map": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.5.0", - "jest-resolve-dependencies": "^29.5.0", - "jest-runner": "^29.5.0", - "jest-runtime": "^29.5.0", - "jest-snapshot": "^29.5.0", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", - "jest-watcher": "^29.5.0", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", "micromatch": "^4.0.4", - "pretty-format": "^29.5.0", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" }, @@ -994,89 +995,89 @@ } }, "node_modules/@jest/environment": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.5.0.tgz", - "integrity": "sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "dependencies": { - "@jest/fake-timers": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.5.0" + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.5.0.tgz", - "integrity": "sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, "dependencies": { - "expect": "^29.5.0", - "jest-snapshot": "^29.5.0" + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/expect-utils": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.5.0.tgz", - "integrity": "sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, "dependencies": { - "jest-get-type": "^29.4.3" + "jest-get-type": "^29.6.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/fake-timers": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.5.0.tgz", - "integrity": "sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^29.5.0", - "jest-mock": "^29.5.0", - "jest-util": "^29.5.0" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/globals": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.5.0.tgz", - "integrity": "sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "dependencies": { - "@jest/environment": "^29.5.0", - "@jest/expect": "^29.5.0", - "@jest/types": "^29.5.0", - "jest-mock": "^29.5.0" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/reporters": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.5.0.tgz", - "integrity": "sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "dependencies": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", - "@jridgewell/trace-mapping": "^0.3.15", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", "@types/node": "*", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", @@ -1084,13 +1085,13 @@ "glob": "^7.1.3", "graceful-fs": "^4.2.9", "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^5.1.0", + "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0", - "jest-worker": "^29.5.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "slash": "^3.0.0", "string-length": "^4.0.1", "strip-ansi": "^6.0.0", @@ -1108,25 +1109,41 @@ } } }, + "node_modules/@jest/reporters/node_modules/istanbul-lib-instrument": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.0.tgz", + "integrity": "sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@jest/schemas": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.4.3.tgz", - "integrity": "sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "dependencies": { - "@sinclair/typebox": "^0.25.16" + "@sinclair/typebox": "^0.27.8" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/@jest/source-map": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.4.3.tgz", - "integrity": "sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.15", + "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", "graceful-fs": "^4.2.9" }, @@ -1135,13 +1152,13 @@ } }, "node_modules/@jest/test-result": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.5.0.tgz", - "integrity": "sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "dependencies": { - "@jest/console": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" }, @@ -1150,14 +1167,14 @@ } }, "node_modules/@jest/test-sequencer": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.5.0.tgz", - "integrity": "sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "dependencies": { - "@jest/test-result": "^29.5.0", + "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", + "jest-haste-map": "^29.7.0", "slash": "^3.0.0" }, "engines": { @@ -1165,22 +1182,22 @@ } }, "node_modules/@jest/transform": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.5.0.tgz", - "integrity": "sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/types": "^29.5.0", - "@jridgewell/trace-mapping": "^0.3.15", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.5.0", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", @@ -1191,12 +1208,12 @@ } }, "node_modules/@jest/types": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.5.0.tgz", - "integrity": "sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "dependencies": { - "@jest/schemas": "^29.4.3", + "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", @@ -1555,33 +1572,33 @@ } }, "node_modules/@sinclair/typebox": { - "version": "0.25.24", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.24.tgz", - "integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==", + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, "node_modules/@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", "dev": true, "dependencies": { "type-detect": "4.0.8" } }, "node_modules/@sinonjs/fake-timers": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", - "integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "dependencies": { - "@sinonjs/commons": "^2.0.0" + "@sinonjs/commons": "^3.0.0" } }, "node_modules/@types/babel__core": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", - "integrity": "sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.2.tgz", + "integrity": "sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==", "dev": true, "dependencies": { "@babel/parser": "^7.20.7", @@ -1592,18 +1609,18 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "version": "7.6.5", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.5.tgz", + "integrity": "sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.2.tgz", + "integrity": "sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -1611,12 +1628,12 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.3.tgz", - "integrity": "sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==", + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.2.tgz", + "integrity": "sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw==", "dev": true, "dependencies": { - "@babel/types": "^7.3.0" + "@babel/types": "^7.20.7" } }, "node_modules/@types/graceful-fs": { @@ -1679,12 +1696,6 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==" }, - "node_modules/@types/prettier": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", - "integrity": "sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==", - "dev": true - }, "node_modules/@types/semver": { "version": "7.3.13", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", @@ -2178,15 +2189,15 @@ } }, "node_modules/babel-jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.5.0.tgz", - "integrity": "sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "dependencies": { - "@jest/transform": "^29.5.0", + "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.5.0", + "babel-preset-jest": "^29.6.3", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "slash": "^3.0.0" @@ -2215,9 +2226,9 @@ } }, "node_modules/babel-plugin-jest-hoist": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz", - "integrity": "sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "dependencies": { "@babel/template": "^7.3.3", @@ -2253,12 +2264,12 @@ } }, "node_modules/babel-preset-jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz", - "integrity": "sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "dependencies": { - "babel-plugin-jest-hoist": "^29.5.0", + "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" }, "engines": { @@ -2518,6 +2529,27 @@ "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -2556,10 +2588,18 @@ } }, "node_modules/dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", - "dev": true + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } }, "node_modules/deep-equal": { "version": "2.2.0", @@ -2635,9 +2675,9 @@ } }, "node_modules/diff-sequences": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", - "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -3359,16 +3399,16 @@ } }, "node_modules/expect": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.5.0.tgz", - "integrity": "sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "dependencies": { - "@jest/expect-utils": "^29.5.0", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0" + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -4320,17 +4360,17 @@ } }, "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "dependencies": { "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", + "make-dir": "^4.0.0", "supports-color": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" } }, "node_modules/istanbul-lib-source-maps": { @@ -4348,9 +4388,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", - "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", @@ -4361,15 +4401,15 @@ } }, "node_modules/jest": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.5.0.tgz", - "integrity": "sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "dependencies": { - "@jest/core": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", "import-local": "^3.0.2", - "jest-cli": "^29.5.0" + "jest-cli": "^29.7.0" }, "bin": { "jest": "bin/jest.js" @@ -4387,12 +4427,13 @@ } }, "node_modules/jest-changed-files": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.5.0.tgz", - "integrity": "sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "dependencies": { "execa": "^5.0.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0" }, "engines": { @@ -4400,28 +4441,28 @@ } }, "node_modules/jest-circus": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.5.0.tgz", - "integrity": "sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "dependencies": { - "@jest/environment": "^29.5.0", - "@jest/expect": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "dedent": "^0.7.0", + "dedent": "^1.0.0", "is-generator-fn": "^2.0.0", - "jest-each": "^29.5.0", - "jest-matcher-utils": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-runtime": "^29.5.0", - "jest-snapshot": "^29.5.0", - "jest-util": "^29.5.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0", - "pretty-format": "^29.5.0", + "pretty-format": "^29.7.0", "pure-rand": "^6.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" @@ -4431,22 +4472,21 @@ } }, "node_modules/jest-cli": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.5.0.tgz", - "integrity": "sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "dependencies": { - "@jest/core": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", + "create-jest": "^29.7.0", "exit": "^0.1.2", - "graceful-fs": "^4.2.9", "import-local": "^3.0.2", - "jest-config": "^29.5.0", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", - "prompts": "^2.0.1", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "yargs": "^17.3.1" }, "bin": { @@ -4465,31 +4505,31 @@ } }, "node_modules/jest-config": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.5.0.tgz", - "integrity": "sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.5.0", - "@jest/types": "^29.5.0", - "babel-jest": "^29.5.0", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^29.5.0", - "jest-environment-node": "^29.5.0", - "jest-get-type": "^29.4.3", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.5.0", - "jest-runner": "^29.5.0", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^29.5.0", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, @@ -4510,24 +4550,24 @@ } }, "node_modules/jest-diff": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.5.0.tgz", - "integrity": "sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "diff-sequences": "^29.4.3", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.5.0" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-docblock": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.3.tgz", - "integrity": "sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "dependencies": { "detect-newline": "^3.0.0" @@ -4537,62 +4577,62 @@ } }, "node_modules/jest-each": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.5.0.tgz", - "integrity": "sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", - "jest-get-type": "^29.4.3", - "jest-util": "^29.5.0", - "pretty-format": "^29.5.0" + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-environment-node": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.5.0.tgz", - "integrity": "sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, "dependencies": { - "@jest/environment": "^29.5.0", - "@jest/fake-timers": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.5.0", - "jest-util": "^29.5.0" + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-get-type": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.3.tgz", - "integrity": "sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-haste-map": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.5.0.tgz", - "integrity": "sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.4.3", - "jest-util": "^29.5.0", - "jest-worker": "^29.5.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "walker": "^1.0.8" }, @@ -4604,46 +4644,46 @@ } }, "node_modules/jest-leak-detector": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.5.0.tgz", - "integrity": "sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "dependencies": { - "jest-get-type": "^29.4.3", - "pretty-format": "^29.5.0" + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-matcher-utils": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz", - "integrity": "sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "dependencies": { "chalk": "^4.0.0", - "jest-diff": "^29.5.0", - "jest-get-type": "^29.4.3", - "pretty-format": "^29.5.0" + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-message-util": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.5.0.tgz", - "integrity": "sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.5.0", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -4652,14 +4692,14 @@ } }, "node_modules/jest-mock": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.5.0.tgz", - "integrity": "sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-util": "^29.5.0" + "jest-util": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -4683,26 +4723,26 @@ } }, "node_modules/jest-regex-util": { - "version": "29.4.3", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.4.3.tgz", - "integrity": "sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-resolve": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.5.0.tgz", - "integrity": "sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "dependencies": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", + "jest-haste-map": "^29.7.0", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.5.0", - "jest-validate": "^29.5.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "resolve": "^1.20.0", "resolve.exports": "^2.0.0", "slash": "^3.0.0" @@ -4712,43 +4752,43 @@ } }, "node_modules/jest-resolve-dependencies": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.5.0.tgz", - "integrity": "sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "dependencies": { - "jest-regex-util": "^29.4.3", - "jest-snapshot": "^29.5.0" + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-runner": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.5.0.tgz", - "integrity": "sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "dependencies": { - "@jest/console": "^29.5.0", - "@jest/environment": "^29.5.0", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-docblock": "^29.4.3", - "jest-environment-node": "^29.5.0", - "jest-haste-map": "^29.5.0", - "jest-leak-detector": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-resolve": "^29.5.0", - "jest-runtime": "^29.5.0", - "jest-util": "^29.5.0", - "jest-watcher": "^29.5.0", - "jest-worker": "^29.5.0", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", "p-limit": "^3.1.0", "source-map-support": "0.5.13" }, @@ -4757,31 +4797,31 @@ } }, "node_modules/jest-runtime": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.5.0.tgz", - "integrity": "sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.5.0", - "@jest/fake-timers": "^29.5.0", - "@jest/globals": "^29.5.0", - "@jest/source-map": "^29.4.3", - "@jest/test-result": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-mock": "^29.5.0", - "jest-regex-util": "^29.4.3", - "jest-resolve": "^29.5.0", - "jest-snapshot": "^29.5.0", - "jest-util": "^29.5.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, @@ -4790,46 +4830,43 @@ } }, "node_modules/jest-snapshot": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.5.0.tgz", - "integrity": "sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "dependencies": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/traverse": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.5.0", - "@jest/transform": "^29.5.0", - "@jest/types": "^29.5.0", - "@types/babel__traverse": "^7.0.6", - "@types/prettier": "^2.1.5", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.5.0", + "expect": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-diff": "^29.5.0", - "jest-get-type": "^29.4.3", - "jest-matcher-utils": "^29.5.0", - "jest-message-util": "^29.5.0", - "jest-util": "^29.5.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^29.5.0", - "semver": "^7.3.5" + "pretty-format": "^29.7.0", + "semver": "^7.5.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-util": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.5.0.tgz", - "integrity": "sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -4841,17 +4878,17 @@ } }, "node_modules/jest-validate": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.5.0.tgz", - "integrity": "sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "dependencies": { - "@jest/types": "^29.5.0", + "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", - "jest-get-type": "^29.4.3", + "jest-get-type": "^29.6.3", "leven": "^3.1.0", - "pretty-format": "^29.5.0" + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -4870,18 +4907,18 @@ } }, "node_modules/jest-watcher": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.5.0.tgz", - "integrity": "sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "dependencies": { - "@jest/test-result": "^29.5.0", - "@jest/types": "^29.5.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "emittery": "^0.13.1", - "jest-util": "^29.5.0", + "jest-util": "^29.7.0", "string-length": "^4.0.1" }, "engines": { @@ -4889,13 +4926,13 @@ } }, "node_modules/jest-worker": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.5.0.tgz", - "integrity": "sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "dependencies": { "@types/node": "*", - "jest-util": "^29.5.0", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -5141,29 +5178,20 @@ } }, "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "dependencies": { - "semver": "^6.0.0" + "semver": "^7.5.3" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -5716,12 +5744,12 @@ } }, "node_modules/pretty-format": { - "version": "29.5.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.5.0.tgz", - "integrity": "sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.4.3", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -5965,9 +5993,9 @@ } }, "node_modules/semver": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.0.tgz", - "integrity": "sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dependencies": { "lru-cache": "^6.0.0" }, @@ -6316,15 +6344,20 @@ "node": ">=8.0" } }, + "node_modules/toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==" + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, "node_modules/ts-jest": { - "version": "29.1.0", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.0.tgz", - "integrity": "sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==", + "version": "29.1.1", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.1.tgz", + "integrity": "sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==", "dev": true, "dependencies": { "bs-logger": "0.x", @@ -6333,7 +6366,7 @@ "json5": "^2.2.3", "lodash.memoize": "4.x", "make-error": "1.x", - "semver": "7.x", + "semver": "^7.5.3", "yargs-parser": "^21.0.1" }, "bin": { @@ -6844,9 +6877,9 @@ "dev": true }, "node_modules/yargs": { - "version": "17.7.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz", - "integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "dependencies": { "cliui": "^8.0.1", diff --git a/package.json b/package.json index f9e0613..38e7f1a 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "@actions/github": "^2.1.1", "@actions/tool-cache": "^1.3.1", "axios": "^0.21.2", - "semver": "^7.1.3" + "semver": "^7.1.3", + "toml": "^3.0.0" }, "devDependencies": { "@types/jest": "29.x.x", @@ -32,11 +33,11 @@ "eslint": "^8.15.0", "eslint-plugin-github": "^4.3.6", "eslint-plugin-jest": "^26.1.5", - "jest": "29.x.x", + "jest": "^29.7.0", "jest-circus": "29.x.x", "js-yaml": "^3.13.1", "prettier": "^2.6.2", - "ts-jest": "29.x.x", + "ts-jest": "^29.1.1", "typescript": "^4.3.0" } } diff --git a/src/configFile.ts b/src/configFile.ts new file mode 100644 index 0000000..7ad1c19 --- /dev/null +++ b/src/configFile.ts @@ -0,0 +1,89 @@ +import {join, dirname} from "path"; +import {parse} from "toml"; +import {readFile, existsSync} from "fs"; +interface foremanConfig { + tools: foremanTool[]; +} + +interface foremanTool { + source?: string; + github?: string; + gitlab?: string; + version: string; +} + +const MANIFEST = "foreman.toml"; + +function findManifestPath(): string | null { + let directory = __dirname; + while (true) { + if (!directory) { + break; + } + const configFilePath = join(directory, MANIFEST); + if (existsSync(configFilePath)) { + return configFilePath; + } else { + directory = dirname(directory); + } + } + return null; +} + +function checkSameOrgToolSpecs(manifestContent: foremanConfig): boolean { + const tools = manifestContent.tools; + if (tools == null) { + throw new Error("Tools section in Foreman config not found"); + } + + const orgs: string[] = []; + for (const tool_name in tools) { + const tool_spec = tools[tool_name]; + let source = tool_spec["source"]; + if (source == null) { + source = tool_spec["github"]; + } + if (source == null) { + continue; + } + + const source_array = source.split("/"); + const org = source_array[0]; + + if (org == null) { + throw new Error( + `Org not found in tool spec definition for: ${tool_name}` + ); + } + orgs.push(org.toLowerCase()); + } + if (orgs.length == 0) { + return true; + } + return orgs.every(val => val === orgs[0]); +} + +async function checkSameOrgInConfig(): Promise { + const manifestPath = findManifestPath(); + if (manifestPath == null) { + throw new Error("Foreman config file could not be found"); + } + + await readFile(manifestPath, "utf8", (err, data) => { + if (err) { + throw new Error("Could not read Foreman config file"); + } + { + const manifestContent = parse(data); + const sameGithubOrgSource = checkSameOrgToolSpecs(manifestContent); + if (sameGithubOrgSource == false) { + throw new Error("Not all GitHub orgs are the same"); + } + } + }); +} + +export default { + checkSameOrgInConfig, + checkSameOrgToolSpecs +}; diff --git a/src/main.ts b/src/main.ts index 2e6e27e..f4e04ea 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,6 +3,7 @@ import {downloadTool, extractZip} from "@actions/tool-cache"; import {GitHub} from "@actions/github"; import {resolve} from "path"; import {exec} from "@actions/exec"; +import configFile from "./configFile"; import foreman from "./foreman"; async function run(): Promise { @@ -10,6 +11,13 @@ async function run(): Promise { const versionReq: string = getInput("version"); const githubToken: string = getInput("token"); const workingDir: string = getInput("working-directory"); + const allowExternalGithubOrgs: string = getInput( + "allow-external-github-orgs" + ).toLowerCase(); + + if (allowExternalGithubOrgs == null || allowExternalGithubOrgs != "true") { + configFile.checkSameOrgInConfig(); + } const octokit = new GitHub(githubToken); const releases = await foreman.getReleases(octokit); From 62407c79ba608d0229f6b0a60c667b0cba83c0e1 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Tue, 26 Sep 2023 15:06:57 -0700 Subject: [PATCH 02/39] enable flag to allow external github orgs --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0da7dc6..203238b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,6 +30,7 @@ jobs: with: version: "*" token: ${{ secrets.GITHUB_TOKEN }} + allow-external-github-orgs: true - run: foreman --version - run: rojo --version @@ -54,5 +55,6 @@ jobs: version: "*" token: ${{ secrets.GITHUB_TOKEN }} working-directory: tests + allow-external-github-orgs: true - run: foreman --version - run: selene --version From 689c538b752cb249b2da15012cbf5c518565c805 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Tue, 26 Sep 2023 15:11:13 -0700 Subject: [PATCH 03/39] whitelist afujiwara-roblox for CLA bot --- .github/workflows/clabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clabot.yml b/.github/workflows/clabot.yml index edb6034..50164a1 100644 --- a/.github/workflows/clabot.yml +++ b/.github/workflows/clabot.yml @@ -9,7 +9,7 @@ jobs: call-clabot-workflow: uses: Roblox/cla-signature-bot/.github/workflows/clabot-workflow.yml@master with: - whitelist: "LPGhatguy,ZoteTheMighty,cliffchapmanrbx,MagiMaster,MisterUncloaked,amatosov-rbx,dependabot[bot]" + whitelist: "LPGhatguy,ZoteTheMighty,cliffchapmanrbx,MagiMaster,MisterUncloaked,amatosov-rbx,dependabot[bot],afujiwara-roblox" use-remote-repo: true remote-repo-name: "roblox/cla-bot-store" secrets: inherit From 55eca193caf0d93a215f61509d9a15cf425b5096 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Tue, 26 Sep 2023 15:18:48 -0700 Subject: [PATCH 04/39] removed infinite loop --- src/configFile.ts | 126 +++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 64 deletions(-) diff --git a/src/configFile.ts b/src/configFile.ts index 7ad1c19..9824464 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -1,89 +1,87 @@ -import {join, dirname} from "path"; -import {parse} from "toml"; -import {readFile, existsSync} from "fs"; +import { join, dirname } from "path"; +import { parse } from "toml"; +import { readFile, existsSync } from "fs"; +import { dir } from "console"; interface foremanConfig { - tools: foremanTool[]; + tools: foremanTool[]; } interface foremanTool { - source?: string; - github?: string; - gitlab?: string; - version: string; + source?: string; + github?: string; + gitlab?: string; + version: string; } const MANIFEST = "foreman.toml"; function findManifestPath(): string | null { - let directory = __dirname; - while (true) { - if (!directory) { - break; + let directory = __dirname; + while (directory != "/") { + const configFilePath = join(directory, MANIFEST); + if (existsSync(configFilePath)) { + return configFilePath; + } else { + directory = dirname(directory); + } } - const configFilePath = join(directory, MANIFEST); - if (existsSync(configFilePath)) { - return configFilePath; - } else { - directory = dirname(directory); - } - } - return null; + return null; } function checkSameOrgToolSpecs(manifestContent: foremanConfig): boolean { - const tools = manifestContent.tools; - if (tools == null) { - throw new Error("Tools section in Foreman config not found"); - } - - const orgs: string[] = []; - for (const tool_name in tools) { - const tool_spec = tools[tool_name]; - let source = tool_spec["source"]; - if (source == null) { - source = tool_spec["github"]; - } - if (source == null) { - continue; + const tools = manifestContent.tools; + if (tools == null) { + throw new Error("Tools section in Foreman config not found"); } - const source_array = source.split("/"); - const org = source_array[0]; + const orgs: string[] = []; + for (const tool_name in tools) { + const tool_spec = tools[tool_name]; + let source = tool_spec["source"]; + if (source == null) { + source = tool_spec["github"]; + } + if (source == null) { + continue; + } + + const source_array = source.split("/"); + const org = source_array[0]; - if (org == null) { - throw new Error( - `Org not found in tool spec definition for: ${tool_name}` - ); + if (org == null) { + throw new Error( + `Org not found in tool spec definition for: ${tool_name}` + ); + } + orgs.push(org.toLowerCase()); } - orgs.push(org.toLowerCase()); - } - if (orgs.length == 0) { - return true; - } - return orgs.every(val => val === orgs[0]); + if (orgs.length == 0) { + return true; + } + return orgs.every(val => val === orgs[0]); } async function checkSameOrgInConfig(): Promise { - const manifestPath = findManifestPath(); - if (manifestPath == null) { - throw new Error("Foreman config file could not be found"); - } - - await readFile(manifestPath, "utf8", (err, data) => { - if (err) { - throw new Error("Could not read Foreman config file"); + const manifestPath = findManifestPath(); + if (manifestPath == null) { + throw new Error("Foreman config file could not be found"); } - { - const manifestContent = parse(data); - const sameGithubOrgSource = checkSameOrgToolSpecs(manifestContent); - if (sameGithubOrgSource == false) { - throw new Error("Not all GitHub orgs are the same"); - } - } - }); + + await readFile(manifestPath, "utf8", (err, data) => { + if (err) { + throw new Error("Could not read Foreman config file"); + } + { + const manifestContent = parse(data); + const sameGithubOrgSource = checkSameOrgToolSpecs(manifestContent); + if (sameGithubOrgSource == false) { + throw new Error("Not all GitHub orgs are the same"); + } + } + }); } export default { - checkSameOrgInConfig, - checkSameOrgToolSpecs + checkSameOrgInConfig, + checkSameOrgToolSpecs }; From 7fc360669139ddf2fb0cf93a7d009a62108bf42d Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Tue, 26 Sep 2023 15:21:18 -0700 Subject: [PATCH 05/39] typo --- __tests__/hello.test.ts | 2 +- package.json | 2 +- src/configFile.ts | 123 ++++++++++++++++++++-------------------- 3 files changed, 63 insertions(+), 64 deletions(-) diff --git a/__tests__/hello.test.ts b/__tests__/hello.test.ts index 0a805c6..478885b 100644 --- a/__tests__/hello.test.ts +++ b/__tests__/hello.test.ts @@ -1,6 +1,6 @@ // who needs tests? import configFile from "../src/configFile"; -import { parse } from "toml"; +import {parse} from "toml"; test("get off my back, Jest", () => { expect(5).toEqual(5); diff --git a/package.json b/package.json index 38e7f1a..0432d82 100644 --- a/package.json +++ b/package.json @@ -40,4 +40,4 @@ "ts-jest": "^29.1.1", "typescript": "^4.3.0" } -} +} \ No newline at end of file diff --git a/src/configFile.ts b/src/configFile.ts index 9824464..dded0dd 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -1,87 +1,86 @@ -import { join, dirname } from "path"; -import { parse } from "toml"; -import { readFile, existsSync } from "fs"; -import { dir } from "console"; +import {join, dirname} from "path"; +import {parse} from "toml"; +import {readFile, existsSync} from "fs"; interface foremanConfig { - tools: foremanTool[]; + tools: foremanTool[]; } interface foremanTool { - source?: string; - github?: string; - gitlab?: string; - version: string; + source?: string; + github?: string; + gitlab?: string; + version: string; } const MANIFEST = "foreman.toml"; function findManifestPath(): string | null { - let directory = __dirname; - while (directory != "/") { - const configFilePath = join(directory, MANIFEST); - if (existsSync(configFilePath)) { - return configFilePath; - } else { - directory = dirname(directory); - } + let directory = __dirname; + while (directory != "/") { + const configFilePath = join(directory, MANIFEST); + if (existsSync(configFilePath)) { + return configFilePath; + } else { + directory = dirname(directory); } - return null; + } + return null; } function checkSameOrgToolSpecs(manifestContent: foremanConfig): boolean { - const tools = manifestContent.tools; - if (tools == null) { - throw new Error("Tools section in Foreman config not found"); - } + const tools = manifestContent.tools; + if (tools == null) { + throw new Error("Tools section in Foreman config not found"); + } - const orgs: string[] = []; - for (const tool_name in tools) { - const tool_spec = tools[tool_name]; - let source = tool_spec["source"]; - if (source == null) { - source = tool_spec["github"]; - } - if (source == null) { - continue; - } + const orgs: string[] = []; + for (const tool_name in tools) { + const tool_spec = tools[tool_name]; + let source = tool_spec["source"]; + if (source == null) { + source = tool_spec["github"]; + } + if (source == null) { + continue; + } - const source_array = source.split("/"); - const org = source_array[0]; + const source_array = source.split("/"); + const org = source_array[0]; - if (org == null) { - throw new Error( - `Org not found in tool spec definition for: ${tool_name}` - ); - } - orgs.push(org.toLowerCase()); - } - if (orgs.length == 0) { - return true; + if (org == null) { + throw new Error( + `Org not found in tool spec definition for: ${tool_name}` + ); } - return orgs.every(val => val === orgs[0]); + orgs.push(org.toLowerCase()); + } + if (orgs.length == 0) { + return true; + } + return orgs.every(val => val === orgs[0]); } async function checkSameOrgInConfig(): Promise { - const manifestPath = findManifestPath(); - if (manifestPath == null) { - throw new Error("Foreman config file could not be found"); - } + const manifestPath = findManifestPath(); + if (manifestPath == null) { + throw new Error("Foreman config file could not be found"); + } - await readFile(manifestPath, "utf8", (err, data) => { - if (err) { - throw new Error("Could not read Foreman config file"); - } - { - const manifestContent = parse(data); - const sameGithubOrgSource = checkSameOrgToolSpecs(manifestContent); - if (sameGithubOrgSource == false) { - throw new Error("Not all GitHub orgs are the same"); - } - } - }); + await readFile(manifestPath, "utf8", (err, data) => { + if (err) { + throw new Error("Could not read Foreman config file"); + } + { + const manifestContent = parse(data); + const sameGithubOrgSource = checkSameOrgToolSpecs(manifestContent); + if (sameGithubOrgSource == false) { + throw new Error("Not all GitHub orgs are the same"); + } + } + }); } export default { - checkSameOrgInConfig, - checkSameOrgToolSpecs + checkSameOrgInConfig, + checkSameOrgToolSpecs }; From eb6c4eaa1ef81d82fc3be86275dfec96d3ba6c48 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Wed, 27 Sep 2023 11:09:15 -0700 Subject: [PATCH 06/39] updated tests --- __tests__/hello.test.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/__tests__/hello.test.ts b/__tests__/hello.test.ts index 478885b..fc90be7 100644 --- a/__tests__/hello.test.ts +++ b/__tests__/hello.test.ts @@ -1,6 +1,6 @@ // who needs tests? import configFile from "../src/configFile"; -import {parse} from "toml"; +import { parse } from "toml"; test("get off my back, Jest", () => { expect(5).toEqual(5); @@ -9,11 +9,9 @@ test("get off my back, Jest", () => { test("checkSameOrgToolSpec same org", () => { let config = ` [tools]\n - rojo = { source = "Roblox/Rojo-rbx-rojo", version = "6.2.0" }\n - selene = { source = "Roblox/Kampfkarren-selene", version = "0.18" }\n - stylua = { source = "Roblox/JohnnyMorganz-StyLua", version = "0.13" }\n - luau-analyze = { source = "Roblox/JohnnyMorganz-luau-analyze-rojo", version = "0.527" }\n - darklua = { gitlab = "Roblox/seaofvoices-darklua", version = "0.7.0" }\n + tool1 = { source = "org1/tool1", version = "1.0.0" }\n + tool2 = { source = "org1/tool2", version = "1.0.0" }\n + tool3 = { source = "org1/tool3", version = "1.0.0" }\n `; let manifestContent = parse(config); expect(configFile.checkSameOrgToolSpecs(manifestContent)).toEqual(true); @@ -22,11 +20,9 @@ test("checkSameOrgToolSpec same org", () => { test("checkSameOrgToolSpec different org", () => { let config = ` [tools]\n - rojo = { source = "Rojo-rbx/rojo", version = "6.2.0" }\n - selene = { source = "Roblox/Kampfkarren-selene", version = "0.18" }\n - stylua = { source = "Roblox/JohnnyMorganz-StyLua", version = "0.13" }\n - luau-analyze = { source = "Roblox/JohnnyMorganz-luau-analyze-rojo", version = "0.527" }\n - darklua = { gitlab = "Roblox/seaofvoices-darklua", version = "0.7.0" }\n + tool1 = { source = "org1/tool1", version = "1.0.0" }\n + tool2 = { source = "org2/tool2", version = "1.0.0" }\n + tool3 = { source = "org1/tool3", version = "1.0.0" }\n `; let manifestContent = parse(config); expect(configFile.checkSameOrgToolSpecs(manifestContent)).toEqual(false); From ba6fdd5a323518965aa126da89917f95687ba196 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Wed, 27 Sep 2023 22:00:23 -0700 Subject: [PATCH 07/39] use find-up library instead of going up parent directories ourselves --- __tests__/hello.test.ts | 2 +- package-lock.json | 55 +++++++++++++++++++---------------------- package.json | 1 + src/configFile.ts | 31 ++++++----------------- src/main.ts | 10 ++++---- 5 files changed, 40 insertions(+), 59 deletions(-) diff --git a/__tests__/hello.test.ts b/__tests__/hello.test.ts index fc90be7..597fa4b 100644 --- a/__tests__/hello.test.ts +++ b/__tests__/hello.test.ts @@ -1,6 +1,6 @@ // who needs tests? import configFile from "../src/configFile"; -import { parse } from "toml"; +import {parse} from "toml"; test("get off my back, Jest", () => { expect(5).toEqual(5); diff --git a/package-lock.json b/package-lock.json index c7e5bc6..14aac99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@actions/github": "^2.1.1", "@actions/tool-cache": "^1.3.1", "axios": "^0.21.2", + "find-up": "5.0.0", "semver": "^7.1.3", "toml": "^3.0.0" }, @@ -104,9 +105,9 @@ } }, "node_modules/@actions/tool-cache/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -191,9 +192,9 @@ "dev": true }, "node_modules/@babel/core/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -234,9 +235,9 @@ } }, "node_modules/@babel/helper-compilation-targets/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -3138,9 +3139,9 @@ } }, "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -3201,9 +3202,9 @@ } }, "node_modules/eslint-plugin-jsx-a11y/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -3512,7 +3513,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -4351,9 +4351,9 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -5095,7 +5095,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -5509,7 +5508,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -5524,7 +5522,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -5578,7 +5575,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, "engines": { "node": ">=8" } @@ -6780,9 +6776,9 @@ } }, "node_modules/windows-release/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "bin": { "semver": "bin/semver" } @@ -6818,9 +6814,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -6907,7 +6903,6 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, "engines": { "node": ">=10" }, diff --git a/package.json b/package.json index 0432d82..3f596b2 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "@actions/github": "^2.1.1", "@actions/tool-cache": "^1.3.1", "axios": "^0.21.2", + "find-up": "5.0.0", "semver": "^7.1.3", "toml": "^3.0.0" }, diff --git a/src/configFile.ts b/src/configFile.ts index dded0dd..c4d51bc 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -1,6 +1,6 @@ -import {join, dirname} from "path"; -import {parse} from "toml"; -import {readFile, existsSync} from "fs"; +import { parse } from "toml"; +import { readFile } from "fs"; +let findUp = require("find-up"); interface foremanConfig { tools: foremanTool[]; } @@ -14,19 +14,6 @@ interface foremanTool { const MANIFEST = "foreman.toml"; -function findManifestPath(): string | null { - let directory = __dirname; - while (directory != "/") { - const configFilePath = join(directory, MANIFEST); - if (existsSync(configFilePath)) { - return configFilePath; - } else { - directory = dirname(directory); - } - } - return null; -} - function checkSameOrgToolSpecs(manifestContent: foremanConfig): boolean { const tools = manifestContent.tools; if (tools == null) { @@ -61,7 +48,7 @@ function checkSameOrgToolSpecs(manifestContent: foremanConfig): boolean { } async function checkSameOrgInConfig(): Promise { - const manifestPath = findManifestPath(); + const manifestPath = await findUp(MANIFEST); if (manifestPath == null) { throw new Error("Foreman config file could not be found"); } @@ -70,12 +57,10 @@ async function checkSameOrgInConfig(): Promise { if (err) { throw new Error("Could not read Foreman config file"); } - { - const manifestContent = parse(data); - const sameGithubOrgSource = checkSameOrgToolSpecs(manifestContent); - if (sameGithubOrgSource == false) { - throw new Error("Not all GitHub orgs are the same"); - } + const manifestContent = parse(data); + const sameGithubOrgSource = checkSameOrgToolSpecs(manifestContent); + if (sameGithubOrgSource == false) { + throw new Error("Not all GitHub orgs are the same"); } }); } diff --git a/src/main.ts b/src/main.ts index f4e04ea..d7cdf74 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,8 @@ -import {getInput, debug, addPath, setFailed} from "@actions/core"; -import {downloadTool, extractZip} from "@actions/tool-cache"; -import {GitHub} from "@actions/github"; -import {resolve} from "path"; -import {exec} from "@actions/exec"; +import { getInput, debug, addPath, setFailed } from "@actions/core"; +import { downloadTool, extractZip } from "@actions/tool-cache"; +import { GitHub } from "@actions/github"; +import { resolve } from "path"; +import { exec } from "@actions/exec"; import configFile from "./configFile"; import foreman from "./foreman"; From d4456542a664e3b45bc0648b497a1f1f527f3e45 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Wed, 27 Sep 2023 22:07:35 -0700 Subject: [PATCH 08/39] lint --- src/configFile.ts | 2 +- src/main.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/configFile.ts b/src/configFile.ts index c4d51bc..9e47781 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -1,6 +1,6 @@ import { parse } from "toml"; import { readFile } from "fs"; -let findUp = require("find-up"); +import findUp = require("find-up"); interface foremanConfig { tools: foremanTool[]; } diff --git a/src/main.ts b/src/main.ts index d7cdf74..f4e04ea 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,8 @@ -import { getInput, debug, addPath, setFailed } from "@actions/core"; -import { downloadTool, extractZip } from "@actions/tool-cache"; -import { GitHub } from "@actions/github"; -import { resolve } from "path"; -import { exec } from "@actions/exec"; +import {getInput, debug, addPath, setFailed} from "@actions/core"; +import {downloadTool, extractZip} from "@actions/tool-cache"; +import {GitHub} from "@actions/github"; +import {resolve} from "path"; +import {exec} from "@actions/exec"; import configFile from "./configFile"; import foreman from "./foreman"; From adcfcb17f068f0302403e51083085d24c6cfaece Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Thu, 28 Sep 2023 10:26:20 -0700 Subject: [PATCH 09/39] updated import --- src/configFile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configFile.ts b/src/configFile.ts index 9e47781..e776794 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -1,6 +1,6 @@ import { parse } from "toml"; import { readFile } from "fs"; -import findUp = require("find-up"); +import findUp from "find-up"; interface foremanConfig { tools: foremanTool[]; } From 7ea2827043cbba0fb358ceff77a818d87dd784cc Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Thu, 28 Sep 2023 11:45:34 -0700 Subject: [PATCH 10/39] updated foremanConfig type definition --- src/configFile.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/configFile.ts b/src/configFile.ts index e776794..463d498 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -2,7 +2,9 @@ import { parse } from "toml"; import { readFile } from "fs"; import findUp from "find-up"; interface foremanConfig { - tools: foremanTool[]; + tools: { + [tool_name: string]: foremanTool + }; } interface foremanTool { From 3d08eabca6266951e699400df0ba5e8b1258d26a Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara <106630142+afujiwara-roblox@users.noreply.github.com> Date: Fri, 29 Sep 2023 10:05:40 -0700 Subject: [PATCH 11/39] Remove redundant condition main.ts Co-authored-by: Paul Doyle <37384169+ZoteTheMighty@users.noreply.github.com> --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index f4e04ea..0c1f514 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,7 +15,7 @@ async function run(): Promise { "allow-external-github-orgs" ).toLowerCase(); - if (allowExternalGithubOrgs == null || allowExternalGithubOrgs != "true") { + if (allowExternalGithubOrgs != "true") { configFile.checkSameOrgInConfig(); } From ac51b7c901ae89cbac43a8da197ebedb226aff9e Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Fri, 29 Sep 2023 10:53:31 -0700 Subject: [PATCH 12/39] check tool sources come from same org setup-foreman runs in --- .github/workflows/test.yml | 4 +-- .../{hello.test.ts => configFile.test.ts} | 7 +++-- src/configFile.ts | 27 +++++++++---------- src/foreman.ts | 6 ++--- src/main.ts | 25 ++++++++++++----- 5 files changed, 39 insertions(+), 30 deletions(-) rename __tests__/{hello.test.ts => configFile.test.ts} (78%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 203238b..3da178e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: with: version: "*" token: ${{ secrets.GITHUB_TOKEN }} - allow-external-github-orgs: true + # allow-external-github-orgs: true - run: foreman --version - run: rojo --version @@ -55,6 +55,6 @@ jobs: version: "*" token: ${{ secrets.GITHUB_TOKEN }} working-directory: tests - allow-external-github-orgs: true + # allow-external-github-orgs: true - run: foreman --version - run: selene --version diff --git a/__tests__/hello.test.ts b/__tests__/configFile.test.ts similarity index 78% rename from __tests__/hello.test.ts rename to __tests__/configFile.test.ts index 597fa4b..89fd09e 100644 --- a/__tests__/hello.test.ts +++ b/__tests__/configFile.test.ts @@ -1,6 +1,5 @@ -// who needs tests? import configFile from "../src/configFile"; -import {parse} from "toml"; +import { parse } from "toml"; test("get off my back, Jest", () => { expect(5).toEqual(5); @@ -14,7 +13,7 @@ test("checkSameOrgToolSpec same org", () => { tool3 = { source = "org1/tool3", version = "1.0.0" }\n `; let manifestContent = parse(config); - expect(configFile.checkSameOrgToolSpecs(manifestContent)).toEqual(true); + expect(configFile.checkSameOrgToolSpecs(manifestContent, "org1")).toEqual(true); }); test("checkSameOrgToolSpec different org", () => { @@ -25,5 +24,5 @@ test("checkSameOrgToolSpec different org", () => { tool3 = { source = "org1/tool3", version = "1.0.0" }\n `; let manifestContent = parse(config); - expect(configFile.checkSameOrgToolSpecs(manifestContent)).toEqual(false); + expect(configFile.checkSameOrgToolSpecs(manifestContent, "org1")).toEqual(false); }); diff --git a/src/configFile.ts b/src/configFile.ts index 463d498..a0fdcb0 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -16,13 +16,12 @@ interface foremanTool { const MANIFEST = "foreman.toml"; -function checkSameOrgToolSpecs(manifestContent: foremanConfig): boolean { +function checkSameOrgToolSpecs(manifestContent: foremanConfig, org: string): boolean { const tools = manifestContent.tools; if (tools == null) { throw new Error("Tools section in Foreman config not found"); } - const orgs: string[] = []; for (const tool_name in tools) { const tool_spec = tools[tool_name]; let source = tool_spec["source"]; @@ -34,35 +33,35 @@ function checkSameOrgToolSpecs(manifestContent: foremanConfig): boolean { } const source_array = source.split("/"); - const org = source_array[0]; + const tool_org = source_array[0]; - if (org == null) { + if (tool_org == null) { throw new Error( `Org not found in tool spec definition for: ${tool_name}` ); } - orgs.push(org.toLowerCase()); - } - if (orgs.length == 0) { - return true; + + if (tool_org != org) { + return false + } } - return orgs.every(val => val === orgs[0]); + return true } -async function checkSameOrgInConfig(): Promise { +async function checkSameOrgInConfig(org: string): Promise { const manifestPath = await findUp(MANIFEST); if (manifestPath == null) { - throw new Error("Foreman config file could not be found"); + throw new Error("setup-foreman could not find Foreman config file"); } await readFile(manifestPath, "utf8", (err, data) => { if (err) { - throw new Error("Could not read Foreman config file"); + throw new Error("setup-foreman Could not read Foreman config file"); } const manifestContent = parse(data); - const sameGithubOrgSource = checkSameOrgToolSpecs(manifestContent); + const sameGithubOrgSource = checkSameOrgToolSpecs(manifestContent, org); if (sameGithubOrgSource == false) { - throw new Error("Not all GitHub orgs are the same"); + throw new Error(`All GitHub orgs in Foreman config must match the org setup-foreman runs in: ${org}. To disable this check, set the \"allow-external-github-orgs\" option to true.`); } }); } diff --git a/src/foreman.ts b/src/foreman.ts index 718a5c9..6120e2e 100644 --- a/src/foreman.ts +++ b/src/foreman.ts @@ -1,6 +1,6 @@ -import {addPath} from "@actions/core"; -import {exec} from "@actions/exec"; -import {GitHub} from "@actions/github"; +import { addPath } from "@actions/core"; +import { exec } from "@actions/exec"; +import { GitHub } from "@actions/github"; import semver from "semver"; import os from "os"; diff --git a/src/main.ts b/src/main.ts index 0c1f514..f0cabb9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,8 @@ -import {getInput, debug, addPath, setFailed} from "@actions/core"; -import {downloadTool, extractZip} from "@actions/tool-cache"; -import {GitHub} from "@actions/github"; -import {resolve} from "path"; -import {exec} from "@actions/exec"; +import { getInput, debug, addPath, setFailed } from "@actions/core"; +import { downloadTool, extractZip } from "@actions/tool-cache"; +import { GitHub, context } from "@actions/github"; +import { resolve } from "path"; +import { exec } from "@actions/exec"; import configFile from "./configFile"; import foreman from "./foreman"; @@ -16,12 +16,23 @@ async function run(): Promise { ).toLowerCase(); if (allowExternalGithubOrgs != "true") { - configFile.checkSameOrgInConfig(); + let repo = context.payload.repository; + if (repo == null) { + throw new Error( + `Could not find repository` + ) + } + let org = repo.owner.name; + if (org == null) { + throw new Error( + `Could not find owner of the repository` + ) + } + configFile.checkSameOrgInConfig(org); } const octokit = new GitHub(githubToken); const releases = await foreman.getReleases(octokit); - debug("Choosing release from GitHub API"); const release = foreman.chooseRelease(versionReq, releases); From daebee8ddfa8f253dba294111b05224274a31966 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Fri, 29 Sep 2023 10:54:50 -0700 Subject: [PATCH 13/39] lint --- __tests__/configFile.test.ts | 10 +++++++--- src/configFile.ts | 19 ++++++++++++------- src/foreman.ts | 6 +++--- src/main.ts | 12 ++++-------- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/__tests__/configFile.test.ts b/__tests__/configFile.test.ts index 89fd09e..3b772eb 100644 --- a/__tests__/configFile.test.ts +++ b/__tests__/configFile.test.ts @@ -1,5 +1,5 @@ import configFile from "../src/configFile"; -import { parse } from "toml"; +import {parse} from "toml"; test("get off my back, Jest", () => { expect(5).toEqual(5); @@ -13,7 +13,9 @@ test("checkSameOrgToolSpec same org", () => { tool3 = { source = "org1/tool3", version = "1.0.0" }\n `; let manifestContent = parse(config); - expect(configFile.checkSameOrgToolSpecs(manifestContent, "org1")).toEqual(true); + expect(configFile.checkSameOrgToolSpecs(manifestContent, "org1")).toEqual( + true + ); }); test("checkSameOrgToolSpec different org", () => { @@ -24,5 +26,7 @@ test("checkSameOrgToolSpec different org", () => { tool3 = { source = "org1/tool3", version = "1.0.0" }\n `; let manifestContent = parse(config); - expect(configFile.checkSameOrgToolSpecs(manifestContent, "org1")).toEqual(false); + expect(configFile.checkSameOrgToolSpecs(manifestContent, "org1")).toEqual( + false + ); }); diff --git a/src/configFile.ts b/src/configFile.ts index a0fdcb0..c86bcb8 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -1,9 +1,9 @@ -import { parse } from "toml"; -import { readFile } from "fs"; +import {parse} from "toml"; +import {readFile} from "fs"; import findUp from "find-up"; interface foremanConfig { tools: { - [tool_name: string]: foremanTool + [tool_name: string]: foremanTool; }; } @@ -16,7 +16,10 @@ interface foremanTool { const MANIFEST = "foreman.toml"; -function checkSameOrgToolSpecs(manifestContent: foremanConfig, org: string): boolean { +function checkSameOrgToolSpecs( + manifestContent: foremanConfig, + org: string +): boolean { const tools = manifestContent.tools; if (tools == null) { throw new Error("Tools section in Foreman config not found"); @@ -42,10 +45,10 @@ function checkSameOrgToolSpecs(manifestContent: foremanConfig, org: string): boo } if (tool_org != org) { - return false + return false; } } - return true + return true; } async function checkSameOrgInConfig(org: string): Promise { @@ -61,7 +64,9 @@ async function checkSameOrgInConfig(org: string): Promise { const manifestContent = parse(data); const sameGithubOrgSource = checkSameOrgToolSpecs(manifestContent, org); if (sameGithubOrgSource == false) { - throw new Error(`All GitHub orgs in Foreman config must match the org setup-foreman runs in: ${org}. To disable this check, set the \"allow-external-github-orgs\" option to true.`); + throw new Error( + `All GitHub orgs in Foreman config must match the org setup-foreman runs in: ${org}. To disable this check, set the \"allow-external-github-orgs\" option to true.` + ); } }); } diff --git a/src/foreman.ts b/src/foreman.ts index 6120e2e..718a5c9 100644 --- a/src/foreman.ts +++ b/src/foreman.ts @@ -1,6 +1,6 @@ -import { addPath } from "@actions/core"; -import { exec } from "@actions/exec"; -import { GitHub } from "@actions/github"; +import {addPath} from "@actions/core"; +import {exec} from "@actions/exec"; +import {GitHub} from "@actions/github"; import semver from "semver"; import os from "os"; diff --git a/src/main.ts b/src/main.ts index f0cabb9..9297566 100644 --- a/src/main.ts +++ b/src/main.ts @@ -16,17 +16,13 @@ async function run(): Promise { ).toLowerCase(); if (allowExternalGithubOrgs != "true") { - let repo = context.payload.repository; + const repo = context.payload.repository; if (repo == null) { - throw new Error( - `Could not find repository` - ) + throw new Error(`Could not find repository`); } - let org = repo.owner.name; + const org = repo.owner.name; if (org == null) { - throw new Error( - `Could not find owner of the repository` - ) + throw new Error(`Could not find owner of the repository`); } configFile.checkSameOrgInConfig(org); } From 4697abef8e4b28b7540239ba0128e4e33b2e0909 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Fri, 29 Sep 2023 10:57:06 -0700 Subject: [PATCH 14/39] print owner --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 9297566..c8638fb 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,7 +22,7 @@ async function run(): Promise { } const org = repo.owner.name; if (org == null) { - throw new Error(`Could not find owner of the repository`); + throw new Error(`Could not find owner of the repository. owner: ${repo.owner}`); } configFile.checkSameOrgInConfig(org); } From e222860de02dd037f0b9bc5cf444cb8a5ce6f2fd Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Fri, 29 Sep 2023 11:00:17 -0700 Subject: [PATCH 15/39] print owner --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index c8638fb..1b95bb6 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,7 +22,7 @@ async function run(): Promise { } const org = repo.owner.name; if (org == null) { - throw new Error(`Could not find owner of the repository. owner: ${repo.owner}`); + throw new Error(`Could not find owner of the repository. owner: ${JSON.stringify(repo.owner)}`); } configFile.checkSameOrgInConfig(org); } From f8060a3a9033d1abfa1a640b608972a158f4ac0d Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Fri, 29 Sep 2023 11:02:42 -0700 Subject: [PATCH 16/39] print repo --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 1b95bb6..06b9e30 100644 --- a/src/main.ts +++ b/src/main.ts @@ -22,7 +22,7 @@ async function run(): Promise { } const org = repo.owner.name; if (org == null) { - throw new Error(`Could not find owner of the repository. owner: ${JSON.stringify(repo.owner)}`); + throw new Error(`Could not find owner of the repository. repo: ${JSON.stringify(repo)}`); } configFile.checkSameOrgInConfig(org); } From 835e0cc524620257f7fa9450f41e2eebe83051ea Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Fri, 29 Sep 2023 11:15:14 -0700 Subject: [PATCH 17/39] print repo --- src/main.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main.ts b/src/main.ts index 06b9e30..9aa2674 100644 --- a/src/main.ts +++ b/src/main.ts @@ -16,14 +16,16 @@ async function run(): Promise { ).toLowerCase(); if (allowExternalGithubOrgs != "true") { - const repo = context.payload.repository; - if (repo == null) { - throw new Error(`Could not find repository`); + // const repo = new Context(); + if (!process.env.GITHUB_REPOSITORY) { + throw new Error(`Could not find repository setup-foreman is running in`); } - const org = repo.owner.name; - if (org == null) { - throw new Error(`Could not find owner of the repository. repo: ${JSON.stringify(repo)}`); + const repository = process.env.GITHUB_REPOSITORY.split('/'); + if (repository.length == 0) { + throw new Error(`Could not find owner of repository setup-foreman is running in`) } + const org = repository[0] + console.log(org); configFile.checkSameOrgInConfig(org); } From 5273acc929d335f848a86217269d2aee387aa01c Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Fri, 29 Sep 2023 11:17:04 -0700 Subject: [PATCH 18/39] lint --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 9aa2674..b158eb2 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ import { getInput, debug, addPath, setFailed } from "@actions/core"; import { downloadTool, extractZip } from "@actions/tool-cache"; -import { GitHub, context } from "@actions/github"; +import { GitHub } from "@actions/github"; import { resolve } from "path"; import { exec } from "@actions/exec"; import configFile from "./configFile"; From 50e36c83072040cab649ea308d791264b5cbd6a5 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Fri, 29 Sep 2023 11:23:08 -0700 Subject: [PATCH 19/39] fixed ci --- .github/workflows/test.yml | 4 ++-- src/main.ts | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3da178e..203238b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: with: version: "*" token: ${{ secrets.GITHUB_TOKEN }} - # allow-external-github-orgs: true + allow-external-github-orgs: true - run: foreman --version - run: rojo --version @@ -55,6 +55,6 @@ jobs: version: "*" token: ${{ secrets.GITHUB_TOKEN }} working-directory: tests - # allow-external-github-orgs: true + allow-external-github-orgs: true - run: foreman --version - run: selene --version diff --git a/src/main.ts b/src/main.ts index b158eb2..311c4c1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -16,17 +16,20 @@ async function run(): Promise { ).toLowerCase(); if (allowExternalGithubOrgs != "true") { - // const repo = new Context(); + debug("Checking tools in Foreman Config come from source org"); if (!process.env.GITHUB_REPOSITORY) { - throw new Error(`Could not find repository setup-foreman is running in`); + throw new Error( + `Could not find repository setup-foreman is running in` + ); } - const repository = process.env.GITHUB_REPOSITORY.split('/'); + const repository = process.env.GITHUB_REPOSITORY.split("/"); if (repository.length == 0) { - throw new Error(`Could not find owner of repository setup-foreman is running in`) + throw new Error( + `Could not find owner of repository setup-foreman is running in` + ); } - const org = repository[0] - console.log(org); - configFile.checkSameOrgInConfig(org); + const org = repository[0]; + configFile.checkSameOrgInConfig(org.toLowerCase()); } const octokit = new GitHub(githubToken); From 3f24462f63b7df37174e0ae7afc4a38cca2b4270 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Fri, 29 Sep 2023 11:32:59 -0700 Subject: [PATCH 20/39] better error message for org not found --- src/configFile.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/configFile.ts b/src/configFile.ts index c86bcb8..ad4de54 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -1,5 +1,5 @@ -import {parse} from "toml"; -import {readFile} from "fs"; +import { parse } from "toml"; +import { readFile } from "fs"; import findUp from "find-up"; interface foremanConfig { tools: { @@ -40,7 +40,7 @@ function checkSameOrgToolSpecs( if (tool_org == null) { throw new Error( - `Org not found in tool spec definition for: ${tool_name}` + `Org not found in tool spec definition for: ${tool_name}. Foreman config is likely defined incorrectly.` ); } From a56fd9f70ecf6f81738c22db18a1af33df403536 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 14:08:47 -0700 Subject: [PATCH 21/39] style and added test --- .github/workflows/test.yml | 25 ++++++++++++++++++++++++- src/configFile.ts | 14 +++++++------- src/main.ts | 14 ++++---------- 3 files changed, 35 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 203238b..5b30c8e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,7 +39,6 @@ jobs: strategy: matrix: os: ["ubuntu-latest", "windows-latest", "macos-latest"] - runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -58,3 +57,27 @@ jobs: allow-external-github-orgs: true - run: foreman --version - run: selene --version + + build-in-dir-external-org-false: + name: Test setup-foreman action with working-directory + strategy: + matrix: + os: ["ubuntu-latest"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm install + - run: npm run all + - run: npm run pack + - name: setup-foreman with working-directory + uses: ./ + with: + version: "*" + token: ${{ secrets.GITHUB_TOKEN }} + working-directory: tests + allow-external-github-orgs: false + - run: foreman --version + - run: selene --version \ No newline at end of file diff --git a/src/configFile.ts b/src/configFile.ts index ad4de54..a4509a8 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -21,24 +21,24 @@ function checkSameOrgToolSpecs( org: string ): boolean { const tools = manifestContent.tools; - if (tools == null) { + if (!tools) { throw new Error("Tools section in Foreman config not found"); } for (const tool_name in tools) { const tool_spec = tools[tool_name]; let source = tool_spec["source"]; - if (source == null) { + if (!source) { source = tool_spec["github"]; } - if (source == null) { + if (!source) { continue; } const source_array = source.split("/"); const tool_org = source_array[0]; - if (tool_org == null) { + if (!tool_org) { throw new Error( `Org not found in tool spec definition for: ${tool_name}. Foreman config is likely defined incorrectly.` ); @@ -53,17 +53,17 @@ function checkSameOrgToolSpecs( async function checkSameOrgInConfig(org: string): Promise { const manifestPath = await findUp(MANIFEST); - if (manifestPath == null) { + if (!manifestPath) { throw new Error("setup-foreman could not find Foreman config file"); } await readFile(manifestPath, "utf8", (err, data) => { if (err) { - throw new Error("setup-foreman Could not read Foreman config file"); + throw new Error(`setup-foreman Could not read Foreman config file. err: ${err}`); } const manifestContent = parse(data); const sameGithubOrgSource = checkSameOrgToolSpecs(manifestContent, org); - if (sameGithubOrgSource == false) { + if (!sameGithubOrgSource) { throw new Error( `All GitHub orgs in Foreman config must match the org setup-foreman runs in: ${org}. To disable this check, set the \"allow-external-github-orgs\" option to true.` ); diff --git a/src/main.ts b/src/main.ts index 311c4c1..f1cbc15 100644 --- a/src/main.ts +++ b/src/main.ts @@ -17,19 +17,13 @@ async function run(): Promise { if (allowExternalGithubOrgs != "true") { debug("Checking tools in Foreman Config come from source org"); - if (!process.env.GITHUB_REPOSITORY) { + const owner = process.env.GITHUB_REPOSITORY_OWNER; + if (!owner) { throw new Error( - `Could not find repository setup-foreman is running in` + `Could not find repository owner setup-foreman is running in` ); } - const repository = process.env.GITHUB_REPOSITORY.split("/"); - if (repository.length == 0) { - throw new Error( - `Could not find owner of repository setup-foreman is running in` - ); - } - const org = repository[0]; - configFile.checkSameOrgInConfig(org.toLowerCase()); + configFile.checkSameOrgInConfig(owner.toLowerCase()); } const octokit = new GitHub(githubToken); From 83d8a1b156c480a25f0c611e08eab2f26818022f Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 14:27:03 -0700 Subject: [PATCH 22/39] continue on error expecting an error --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b30c8e..797fe7a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,12 +72,12 @@ jobs: - run: npm install - run: npm run all - run: npm run pack - - name: setup-foreman with working-directory + + - name: setup-foreman with working-directory expect failure uses: ./ with: version: "*" token: ${{ secrets.GITHUB_TOKEN }} working-directory: tests allow-external-github-orgs: false - - run: foreman --version - - run: selene --version \ No newline at end of file + continue-on-error: true From a5ad8512db99cd2e3c528d3aee850d6685de5cee Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 14:31:02 -0700 Subject: [PATCH 23/39] add failure on success to exepcted failure test case --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 797fe7a..790b4bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,7 +59,7 @@ jobs: - run: selene --version build-in-dir-external-org-false: - name: Test setup-foreman action with working-directory + name: Test setup-foreman action allow-external-gitub-org false strategy: matrix: os: ["ubuntu-latest"] @@ -81,3 +81,7 @@ jobs: working-directory: tests allow-external-github-orgs: false continue-on-error: true + + - name: fail on success + if: ${{ failure() }} + run: exit 1 From 421e4cbe0f8408af5ff44f776602ae8ecc004139 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 14:43:11 -0700 Subject: [PATCH 24/39] fail on success, succeed on failure --- .github/workflows/test.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 790b4bc..f73eed1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -73,15 +73,18 @@ jobs: - run: npm run all - run: npm run pack - - name: setup-foreman with working-directory expect failure + - name: setup-foreman-failure uses: ./ with: version: "*" token: ${{ secrets.GITHUB_TOKEN }} working-directory: tests allow-external-github-orgs: false - continue-on-error: true - + - name: fail on success - if: ${{ failure() }} + if: always() && steps.setup-foreman-failiure.outcome == 'success' run: exit 1 + + - name: succeed of failure + if: always() + run: exit 0 \ No newline at end of file From 237aa9fcb7c1430380c9002a4b82753e14e54100 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 14:45:16 -0700 Subject: [PATCH 25/39] continue on error --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f73eed1..58746fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -80,7 +80,8 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} working-directory: tests allow-external-github-orgs: false - + continue-on-error: true + - name: fail on success if: always() && steps.setup-foreman-failiure.outcome == 'success' run: exit 1 From 2657c201aee67f77f90d8b37a04e7dadee56283d Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 14:47:59 -0700 Subject: [PATCH 26/39] test fail case --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 58746fa..70ed7b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -79,9 +79,9 @@ jobs: version: "*" token: ${{ secrets.GITHUB_TOKEN }} working-directory: tests - allow-external-github-orgs: false + allow-external-github-orgs: true continue-on-error: true - + - name: fail on success if: always() && steps.setup-foreman-failiure.outcome == 'success' run: exit 1 From 671140f8c4203b7983c223a44af09537781694c6 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 14:52:49 -0700 Subject: [PATCH 27/39] typo --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 70ed7b7..51653dd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,7 +83,7 @@ jobs: continue-on-error: true - name: fail on success - if: always() && steps.setup-foreman-failiure.outcome == 'success' + if: always() && steps.setup-foreman-failure.outcome == 'success' run: exit 1 - name: succeed of failure From 9971f2f2049dc50d841a606784c5084d6b1a4f7c Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 14:55:55 -0700 Subject: [PATCH 28/39] added id --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 51653dd..8f8b7ad 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -75,6 +75,7 @@ jobs: - name: setup-foreman-failure uses: ./ + id: setup-foreman-failure with: version: "*" token: ${{ secrets.GITHUB_TOKEN }} @@ -83,7 +84,7 @@ jobs: continue-on-error: true - name: fail on success - if: always() && steps.setup-foreman-failure.outcome == 'success' + if: always() && steps.id.setup-foreman-failure.outcome == 'success' run: exit 1 - name: succeed of failure From d95983203e6f07d07dc4a3365a6f243f8c0505ab Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 14:58:02 -0700 Subject: [PATCH 29/39] typo --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f8b7ad..ce724d3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -84,7 +84,7 @@ jobs: continue-on-error: true - name: fail on success - if: always() && steps.id.setup-foreman-failure.outcome == 'success' + if: always() && steps.setup-foreman-failure.outcome == 'success' run: exit 1 - name: succeed of failure From 437c835b3eac98d284a40863d0ba3e4cc6c0b8df Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 15:03:55 -0700 Subject: [PATCH 30/39] test success case --- .github/workflows/test.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce724d3..4e5e767 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -80,13 +80,12 @@ jobs: version: "*" token: ${{ secrets.GITHUB_TOKEN }} working-directory: tests - allow-external-github-orgs: true + allow-external-github-orgs: false continue-on-error: true - name: fail on success - if: always() && steps.setup-foreman-failure.outcome == 'success' + if: steps.setup-foreman-failure.outcome == 'success' run: exit 1 - - name: succeed of failure - if: always() + - name: succeed on failure run: exit 0 \ No newline at end of file From 1f5147cd7e3ef4b5da4add04705d3875aaa5bde0 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 15:07:03 -0700 Subject: [PATCH 31/39] add test to check same org success --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4e5e767..40d5c9d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,7 +58,7 @@ jobs: - run: foreman --version - run: selene --version - build-in-dir-external-org-false: + external-org-false-failure: name: Test setup-foreman action allow-external-gitub-org false strategy: matrix: @@ -88,4 +88,28 @@ jobs: run: exit 1 - name: succeed on failure - run: exit 0 \ No newline at end of file + run: exit 0 + + external-org-false-success: + name: Test setup-foreman action allow-external-gitub-org false + strategy: + matrix: + os: ["ubuntu-latest"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm install + - run: npm run all + - run: npm run pack + + - name: setup-foreman-failure + uses: ./ + id: setup-foreman-failure + with: + version: "*" + token: ${{ secrets.GITHUB_TOKEN }} + working-directory: tests-external-org + allow-external-github-orgs: false \ No newline at end of file From 3c12b46aab07d8a275f54106feeb9d7637d19410 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 15:11:43 -0700 Subject: [PATCH 32/39] added all files --- .github/workflows/test.yml | 7 +++---- tests-external-org/foreman.toml | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 tests-external-org/foreman.toml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40d5c9d..2ff5f32 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,7 +59,7 @@ jobs: - run: selene --version external-org-false-failure: - name: Test setup-foreman action allow-external-gitub-org false + name: Test allow-external-gitub-org false expect failure strategy: matrix: os: ["ubuntu-latest"] @@ -91,7 +91,7 @@ jobs: run: exit 0 external-org-false-success: - name: Test setup-foreman action allow-external-gitub-org false + name: Test allow-external-gitub-org false expect success strategy: matrix: os: ["ubuntu-latest"] @@ -105,9 +105,8 @@ jobs: - run: npm run all - run: npm run pack - - name: setup-foreman-failure + - name: setup-foreman-success uses: ./ - id: setup-foreman-failure with: version: "*" token: ${{ secrets.GITHUB_TOKEN }} diff --git a/tests-external-org/foreman.toml b/tests-external-org/foreman.toml new file mode 100644 index 0000000..4bbf278 --- /dev/null +++ b/tests-external-org/foreman.toml @@ -0,0 +1,5 @@ +# This file is used as a way to make sure that setup-foreman is functioning. + +[tools] +selene = { source = "Roblox/Kampfkarren-selene", version = "0.15.0" } +stylua = { source = "Roblox/JohnnyMorganz-stylua", version = "0.18.1" } From 525304888467f73ad419e22c6df812af6f768354 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 15:16:38 -0700 Subject: [PATCH 33/39] fix org comparison --- src/configFile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configFile.ts b/src/configFile.ts index a4509a8..e8f16e7 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -44,7 +44,7 @@ function checkSameOrgToolSpecs( ); } - if (tool_org != org) { + if (tool_org.toLowerCase() != org) { return false; } } From 00b0f7a66ccbe96b6594713926064c0b07300324 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 15:22:10 -0700 Subject: [PATCH 34/39] print org --- src/configFile.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configFile.ts b/src/configFile.ts index e8f16e7..0dfa8ce 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -43,7 +43,7 @@ function checkSameOrgToolSpecs( `Org not found in tool spec definition for: ${tool_name}. Foreman config is likely defined incorrectly.` ); } - + console.log(tool_org); if (tool_org.toLowerCase() != org) { return false; } From d3d58f66797aa0083fbe8943147bb38de07ef125 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 15:36:03 -0700 Subject: [PATCH 35/39] print dirname --- src/main.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.ts b/src/main.ts index f1cbc15..e7e1ffd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -61,6 +61,7 @@ async function run(): Promise { if (workingDir !== undefined && workingDir !== null && workingDir !== "") { process.chdir(workingDir); + console.log(__dirname) } await foreman.installTools(); } catch (error) { From 046a9936a13e1c8f526159386c2239c99f42a550 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 15:38:42 -0700 Subject: [PATCH 36/39] change directory before checking for foreman config --- src/configFile.ts | 1 - src/main.ts | 23 ++++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/configFile.ts b/src/configFile.ts index 0dfa8ce..4ca4cac 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -43,7 +43,6 @@ function checkSameOrgToolSpecs( `Org not found in tool spec definition for: ${tool_name}. Foreman config is likely defined incorrectly.` ); } - console.log(tool_org); if (tool_org.toLowerCase() != org) { return false; } diff --git a/src/main.ts b/src/main.ts index e7e1ffd..e77e5d4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -15,16 +15,6 @@ async function run(): Promise { "allow-external-github-orgs" ).toLowerCase(); - if (allowExternalGithubOrgs != "true") { - debug("Checking tools in Foreman Config come from source org"); - const owner = process.env.GITHUB_REPOSITORY_OWNER; - if (!owner) { - throw new Error( - `Could not find repository owner setup-foreman is running in` - ); - } - configFile.checkSameOrgInConfig(owner.toLowerCase()); - } const octokit = new GitHub(githubToken); const releases = await foreman.getReleases(octokit); @@ -61,8 +51,19 @@ async function run(): Promise { if (workingDir !== undefined && workingDir !== null && workingDir !== "") { process.chdir(workingDir); - console.log(__dirname) } + + if (allowExternalGithubOrgs != "true") { + debug("Checking tools in Foreman Config come from source org"); + const owner = process.env.GITHUB_REPOSITORY_OWNER; + if (!owner) { + throw new Error( + `Could not find repository owner setup-foreman is running in` + ); + } + configFile.checkSameOrgInConfig(owner.toLowerCase()); + } + await foreman.installTools(); } catch (error) { if (error instanceof Error) { From 714bec19a16e651e376a32babedb6ab2bcb67cd0 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Mon, 2 Oct 2023 15:43:56 -0700 Subject: [PATCH 37/39] changed tools for testing --- tests-external-org/foreman.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests-external-org/foreman.toml b/tests-external-org/foreman.toml index 4bbf278..51f8f77 100644 --- a/tests-external-org/foreman.toml +++ b/tests-external-org/foreman.toml @@ -1,5 +1,5 @@ # This file is used as a way to make sure that setup-foreman is functioning. [tools] -selene = { source = "Roblox/Kampfkarren-selene", version = "0.15.0" } -stylua = { source = "Roblox/JohnnyMorganz-stylua", version = "0.18.1" } +selene = { source = "Roblox/tarmac", version = "0.7.0" } +stylua = { source = "Roblox/StyLua", version = "0.13.1" } From 4f326f08aa894d4b92db082ecfecb96b16e9dea9 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Tue, 3 Oct 2023 11:18:40 -0700 Subject: [PATCH 38/39] readd explicit null checks --- src/configFile.ts | 10 +++++----- src/main.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/configFile.ts b/src/configFile.ts index 4ca4cac..6b7b13d 100644 --- a/src/configFile.ts +++ b/src/configFile.ts @@ -21,24 +21,24 @@ function checkSameOrgToolSpecs( org: string ): boolean { const tools = manifestContent.tools; - if (!tools) { + if (tools == null) { throw new Error("Tools section in Foreman config not found"); } for (const tool_name in tools) { const tool_spec = tools[tool_name]; let source = tool_spec["source"]; - if (!source) { + if (source == undefined) { source = tool_spec["github"]; } - if (!source) { + if (source == undefined) { continue; } const source_array = source.split("/"); const tool_org = source_array[0]; - if (!tool_org) { + if (tool_org == null) { throw new Error( `Org not found in tool spec definition for: ${tool_name}. Foreman config is likely defined incorrectly.` ); @@ -52,7 +52,7 @@ function checkSameOrgToolSpecs( async function checkSameOrgInConfig(org: string): Promise { const manifestPath = await findUp(MANIFEST); - if (!manifestPath) { + if (manifestPath == undefined) { throw new Error("setup-foreman could not find Foreman config file"); } diff --git a/src/main.ts b/src/main.ts index e77e5d4..453abc9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -56,7 +56,7 @@ async function run(): Promise { if (allowExternalGithubOrgs != "true") { debug("Checking tools in Foreman Config come from source org"); const owner = process.env.GITHUB_REPOSITORY_OWNER; - if (!owner) { + if (owner == undefined) { throw new Error( `Could not find repository owner setup-foreman is running in` ); From b6d8c3939fe0b3b59fbfa6a3caad4f8d7370dc09 Mon Sep 17 00:00:00 2001 From: Aiden Fujiwara Date: Tue, 3 Oct 2023 16:21:33 -0700 Subject: [PATCH 39/39] updated readme to include 'allow-external-github-orgs' parameter --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fe624d0..de60544 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,11 @@ If not specified, the latest stable release will be installed. #### `working-directory` (optional) A working directory in which `foreman install` will be executed. -If not specified the root job folder will be used +If not specified the root job folder will be used. +#### `allow-external-github-orgs` (optional) +A boolean value to allow external github orgs in the foreman manifest file. + +If not specified, external github orgs will not be allowed. ## License setup-foreman is available under the MIT license. See [LICENSE.txt](LICENSE.txt) or for details.