From 440bfd1e27f1e168d9425b7a3677f2bc4b7dd863 Mon Sep 17 00:00:00 2001 From: Enrique Mingorance Cano Date: Mon, 21 Jun 2021 12:50:22 +0200 Subject: [PATCH] build-chain-configuration-reader upgraded to ^2.2.0 (#4) Co-authored-by: root --- dist/index.js | 184 ++++++++++++++++------- package-lock.json | 178 ++++++++++++++-------- package.json | 4 +- project-dependencies.yaml | 32 ++-- test/resources/definition-file-prod.yaml | 32 ++-- test/resources/definition-file.yaml | 32 ++-- 6 files changed, 303 insertions(+), 159 deletions(-) diff --git a/dist/index.js b/dist/index.js index 2356a61..3925158 100755 --- a/dist/index.js +++ b/dist/index.js @@ -1008,8 +1008,11 @@ const { validateNode } = __webpack_require__(127); * @param {string} file - The definition file. It can be a URL or a in the filesystem. * @param {Object} urlPlaceHolders the url place holders to replace url. This is needed in case either the definition file or the dependencies file are loaded from a URL */ -async function getTree(file, urlPlaceHolders = {}) { - const definition = await readDefinitionFile(file, urlPlaceHolders); +async function getTree( + file, + options = { urlPlaceHolders: {}, token: undefined } +) { + const definition = await readDefinitionFile(file, options); return dependencyListToTree(definition.dependencies, definition); } @@ -1020,12 +1023,12 @@ async function getTree(file, urlPlaceHolders = {}) { * @param {string} project - The project name to look for. * @param {Object} urlPlaceHolders the url place holders to replace url. This is needed in case either the definition file or the dependencies file are loaded from a URL */ -async function getTreeForProject(file, project, urlPlaceHolders = {}) { - return lookForProject( - await getTree(file, urlPlaceHolders), - project, - undefined - ); +async function getTreeForProject( + file, + project, + options = { urlPlaceHolders: {}, token: undefined } +) { + return lookForProject(await getTree(file, options), project); } /** @@ -1072,6 +1075,11 @@ function dependencyListToTree(dependencyList, buildConfiguration) { if (node.dependencies && node.dependencies.length > 0) { node.dependencies.forEach(dependency => { + if ([null, undefined].includes(map[dependency.project])) { + const errorMessage = `The project ${dependency.project} does not exist on project list. Please review your project definition file`; + console.error(errorMessage); + throw new Error(errorMessage); + } dependencyList[map[dependency.project].index].children.push({ ...map[node.project].node }); @@ -1171,7 +1179,7 @@ module.exports = { generateImage }; const assert = __webpack_require__(357); -const allowedVersions = ["2.0"]; +const allowedVersions = ["2.1"]; function validateDefinition(definition) { assert( @@ -1684,8 +1692,11 @@ const { parentChainFromNode } = __webpack_require__(636); * @param {string} file - The definition file. It can be a URL or a in the filesystem. * @param {string} project - The project name to look for. */ -async function getOrderedListForTree(file, urlPlaceHolders = {}) { - const tree = await getTree(file, urlPlaceHolders); +async function getOrderedListForTree( + file, + options = { urlPlaceHolders: {}, token: undefined } +) { + const tree = await getTree(file, options); return getOrderedList(tree); } @@ -1694,8 +1705,12 @@ async function getOrderedListForTree(file, urlPlaceHolders = {}) { * @param {string} file - The definition file. It can be a URL or a in the filesystem. * @param {string} project - The project name to look for. */ -async function getOrderedListForProject(file, project, urlPlaceHolders = {}) { - const tree = await getTreeForProject(file, project, urlPlaceHolders); +async function getOrderedListForProject( + file, + project, + options = { urlPlaceHolders: {}, token: undefined } +) { + const tree = await getTreeForProject(file, project, options); return getOrderedList([tree]); } @@ -2236,7 +2251,7 @@ function getBuild(project, buildConfiguration) { * @param {Object} target * @param {Object} source */ -function overrideProperties(target, source) { +function overrideProperties(target, source, merge = false) { const targetClone = { ...target }; const sourceClone = { ...source }; Object.entries(targetClone) @@ -2245,10 +2260,14 @@ function overrideProperties(target, source) { if (typeof value === "object") { targetClone[key] = overrideProperties( targetClone[key], - sourceClone[key] + sourceClone[key], + merge || (sourceClone.merge && sourceClone.merge.includes(key)) ); } else { - targetClone[key] = sourceClone[key]; + targetClone[key] = + merge || (sourceClone.merge && sourceClone.merge.includes(key)) + ? mergeElements(targetClone[key], sourceClone[key], key) + : sourceClone[key]; } }); @@ -2258,6 +2277,14 @@ function overrideProperties(target, source) { return targetClone; } +function mergeElements(target, source) { + const treatedTarget = + typeof target === "string" ? [...target.split("\n")] : [...target]; + const treatedSource = + typeof source === "string" ? [...source.split("\n")] : [...source]; + return [...treatedTarget, ...treatedSource]; +} + /** * manipulates certains properties from an object. It basically converts String lists to Arrays * @param {Object} properties the properties to manipulate @@ -4877,22 +4904,27 @@ module.exports = new Schema({ const http = __webpack_require__(605); const https = __webpack_require__(211); -function requestUrl(url) { +function requestUrl(url, token) { + const options = token ? { headers: { Authorization: `token ${token}` } } : {}; return new Promise((resolve, reject) => { - (url.startsWith("https://") ? https : http).get(url, response => { - let chunks_of_data = []; - response.on("data", fragments => chunks_of_data.push(fragments)); - response.on("end", () => - resolve(Buffer.concat(chunks_of_data).toString()) - ); - response.on("error", error => reject(error)); - }); + (url.startsWith("https://") ? https : http) + .get(url, options, response => { + if (response.statusCode < 200 || response.statusCode > 299) { + reject(`Status: ${response.statusCode}. ${response.statusMessage}`); + } + let chunks_of_data = []; + response.on("data", fragments => chunks_of_data.push(fragments)); + response.on("end", () => + resolve(Buffer.concat(chunks_of_data).toString()) + ); + }) + .on("error", error => reject(error)); }); } -async function getUrlContent(url) { +async function getUrlContent(url, token = undefined) { try { - return await requestUrl(url); + return await requestUrl(url, token); } catch (error) { throw new Error(`Error getting ${url}. Error: ${error}`); } @@ -5215,9 +5247,9 @@ function read(fileContent) { try { return yaml.safeLoad(fileContent); } catch (e) { - throw new ReadYamlException( - `error reading yaml file content. Error: ${e.message}` - ); + const errorMessage = `error reading yaml file content. Error: ${e.message}`; + console.error(errorMessage); + throw new ReadYamlException(errorMessage); } } @@ -6392,7 +6424,7 @@ module.exports = require("process"); const fs = __webpack_require__(747); const { getUrlContent } = __webpack_require__(593); -const { treatUrl } = __webpack_require__(824); +const { treatUrl, treatMapping } = __webpack_require__(824); const { validateDefinition, validateDependencies @@ -6405,10 +6437,13 @@ const { read: readYaml } = __webpack_require__(674); * @param {string} file - The definition file. It can be a URL or a in the filesystem. * @param {Object} urlPlaceHolders the url place holders to replace url. This is needed in case either the definition file or the dependencies file are loaded from a URL */ -async function readDefinitionFile(file, urlPlaceHolders = {}) { +async function readDefinitionFile( + file, + options = { urlPlaceHolders: {}, token: undefined } +) { return file.startsWith("http") - ? readDefinitionFileFromUrl(file, urlPlaceHolders) - : readDefinitionFileFromFile(file, urlPlaceHolders); + ? readDefinitionFileFromUrl(file, options) + : readDefinitionFileFromFile(file, options.urlPlaceHolders); } /** @@ -6416,13 +6451,16 @@ async function readDefinitionFile(file, urlPlaceHolders = {}) { * @param {String} filePath the definition file path * @param {Object} urlPlaceHolders the url place holders to replace url */ -async function readDefinitionFileFromFile(filePath, urlPlaceHolders) { +async function readDefinitionFileFromFile( + filePath, + options = { urlPlaceHolders: {}, token: undefined } +) { const defintionFileContent = fs.readFileSync(filePath, "utf8"); return loadYaml( readYaml(defintionFileContent), filePath.substring(0, filePath.lastIndexOf("/")), defintionFileContent, - urlPlaceHolders + options ); } @@ -6431,13 +6469,16 @@ async function readDefinitionFileFromFile(filePath, urlPlaceHolders) { * @param {String} url the url to the definition file * @param {Object} urlPlaceHolders the url place holders to replace url */ -async function readDefinitionFileFromUrl(url, urlPlaceHolders) { - const treatedUrl = treatUrl(url, urlPlaceHolders); +async function readDefinitionFileFromUrl( + url, + options = { urlPlaceHolders: {}, token: undefined } +) { + const treatedUrl = treatUrl(url, options.urlPlaceHolders); return loadYaml( - readYaml(await getUrlContent(treatedUrl)), + readYaml(await getUrlContent(treatedUrl, options.token)), "./", url, - urlPlaceHolders + options ); } @@ -6452,15 +6493,21 @@ async function loadYaml( definitionYaml, definitionFileFolder, containerPath, - urlPlaceHolders + options = { urlPlaceHolders: {}, token: undefined } ) { validateDefinition(definitionYaml); definitionYaml.dependencies = await loadDependencies( definitionYaml.dependencies, definitionFileFolder, containerPath, - urlPlaceHolders + options ); + if (definitionYaml.dependencies) { + definitionYaml.dependencies + .filter(dependency => dependency.mapping) + .map(dependency => dependency.mapping) + .forEach(mapping => treatMapping(mapping)); + } return definitionYaml; } @@ -6475,7 +6522,7 @@ async function loadDependencies( dependencies, definitionFileFolder, containerPath, - urlPlaceHolders + options = { urlPlaceHolders: {}, token: undefined } ) { let dependenciesFinalPath = dependencies; if (dependencies) { @@ -6484,24 +6531,26 @@ async function loadDependencies( !Array.isArray(dependencies) && !dependencies.startsWith("http") ) { - const treatedUrl = treatUrl(containerPath, urlPlaceHolders); + const treatedUrl = treatUrl(containerPath, options.urlPlaceHolders); dependenciesFinalPath = `${treatedUrl.substring( 0, treatedUrl.lastIndexOf("/") )}/${dependencies}`; - const dependenciesContent = await getUrlContent(dependenciesFinalPath); + const dependenciesContent = await getUrlContent( + dependenciesFinalPath, + options.token + ); fs.writeFileSync(dependencies, dependenciesContent); } if (!Array.isArray(dependencies)) { const dependenciesFilePath = dependencies.startsWith("http") - ? treatUrl(dependencies, urlPlaceHolders) + ? treatUrl(dependencies, options.urlPlaceHolders) : `${definitionFileFolder}/${dependencies}`; const dependenciesFileContent = dependencies.startsWith("http") - ? await getUrlContent(dependenciesFilePath) + ? await getUrlContent(dependenciesFilePath, options.token) : fs.readFileSync(dependenciesFilePath, "utf8"); const dependenciesYaml = readYaml(dependenciesFileContent); - // console.log(`dependenciesFilePath ${dependenciesFilePath}`, dependenciesYaml, urlPlaceHolders) validateDependencies(dependenciesYaml); // Once the dependencies are loaded, the `extends` proporty is concatenated to the current dependencies return ( @@ -6512,7 +6561,7 @@ async function loadDependencies( dependenciesFilePath.lastIndexOf("/") ), dependenciesFinalPath, - urlPlaceHolders + options ) ).concat(dependenciesYaml.dependencies); } else { @@ -6682,13 +6731,40 @@ module.exports = new Type('tag:yaml.org,2002:null', { */ function treatUrl(url, placeHolders) { let result = url; - Object.entries(placeHolders).forEach( - ([key, value]) => (result = result.replace(`$\{${key}}`, value)) - ); + if (placeHolders) { + Object.entries(placeHolders).forEach( + ([key, value]) => (result = result.replace(`$\{${key}}`, value)) + ); + } return result; } -module.exports = { treatUrl }; +function treatMapping(mapping) { + if (mapping) { + treatMappingDependencies(mapping.dependencies); + treatMappingDependencies(mapping.dependant); + } +} + +function treatMappingDependencies(mappingDependencies) { + Object.values(mappingDependencies || []).forEach(mappingElement => + mappingElement + .filter(mapping => mapping.targetExpression) + .forEach(mapping => { + try { + mapping.target = eval(mapping.targetExpression); + } catch (ex) { + console.error( + `Error evaluating expression \`${mapping.targetExpression}\` for source: \`${mapping.source}\``, + ex + ); + mapping.target = undefined; + } + }) + ); +} + +module.exports = { treatUrl, treatMapping }; /***/ }), @@ -7110,7 +7186,7 @@ module.exports = { generateRepositoryList }; /***/ 896: /***/ (function(module) { -module.exports = {"name":"canvas","description":"Canvas graphics API backed by Cairo","version":"2.6.1","author":"TJ Holowaychuk ","main":"index.js","browser":"browser.js","contributors":["Nathan Rajlich ","Rod Vagg ","Juriy Zaytsev "],"keywords":["canvas","graphic","graphics","pixman","cairo","image","images","pdf"],"homepage":"https://github.com/Automattic/node-canvas","repository":"git://github.com/Automattic/node-canvas.git","scripts":{"prebenchmark":"node-gyp build","benchmark":"node benchmarks/run.js","pretest":"standard examples/*.js test/server.js test/public/*.js benchmarks/run.js lib/context2d.js util/has_lib.js browser.js index.js && node-gyp build","test":"mocha test/*.test.js","pretest-server":"node-gyp build","test-server":"node test/server.js","install":"node-pre-gyp install --fallback-to-build","dtslint":"dtslint types"},"binary":{"module_name":"canvas","module_path":"build/Release","host":"https://github.com/node-gfx/node-canvas-prebuilt/releases/download/","remote_path":"v{version}","package_name":"{module_name}-v{version}-{node_abi}-{platform}-{libc}-{arch}.tar.gz"},"files":["binding.gyp","lib/","src/","util/","types/index.d.ts"],"types":"types/index.d.ts","dependencies":{"nan":"^2.14.0","node-pre-gyp":"^0.11.0","simple-get":"^3.0.3"},"devDependencies":{"@types/node":"^10.12.18","assert-rejects":"^1.0.0","dtslint":"^0.5.3","express":"^4.16.3","mocha":"^5.2.0","pixelmatch":"^4.0.2","standard":"^12.0.1"},"engines":{"node":">=6"},"license":"MIT","_resolved":"https://registry.npmjs.org/canvas/-/canvas-2.6.1.tgz","_integrity":"sha512-S98rKsPcuhfTcYbtF53UIJhcbgIAK533d1kJKMwsMwAIFgfd58MOyxRud3kktlzWiEkFliaJtvyZCBtud/XVEA==","_from":"canvas@2.6.1"}; +module.exports = {"_args":[["canvas@2.6.1","/home/emingora/development/projects/RedHat/issues/BXMSPROD-1363/build-chain-files-generator"]],"_from":"canvas@2.6.1","_id":"canvas@2.6.1","_inBundle":false,"_integrity":"sha512-S98rKsPcuhfTcYbtF53UIJhcbgIAK533d1kJKMwsMwAIFgfd58MOyxRud3kktlzWiEkFliaJtvyZCBtud/XVEA==","_location":"/canvas","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"canvas@2.6.1","name":"canvas","escapedName":"canvas","rawSpec":"2.6.1","saveSpec":null,"fetchSpec":"2.6.1"},"_requiredBy":["/tree-image-drawer"],"_resolved":"https://registry.npmjs.org/canvas/-/canvas-2.6.1.tgz","_spec":"2.6.1","_where":"/home/emingora/development/projects/RedHat/issues/BXMSPROD-1363/build-chain-files-generator","author":{"name":"TJ Holowaychuk","email":"tj@learnboost.com"},"binary":{"module_name":"canvas","module_path":"build/Release","host":"https://github.com/node-gfx/node-canvas-prebuilt/releases/download/","remote_path":"v{version}","package_name":"{module_name}-v{version}-{node_abi}-{platform}-{libc}-{arch}.tar.gz"},"browser":"browser.js","bugs":{"url":"https://github.com/Automattic/node-canvas/issues"},"contributors":[{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},{"name":"Rod Vagg","email":"r@va.gg"},{"name":"Juriy Zaytsev","email":"kangax@gmail.com"}],"dependencies":{"nan":"^2.14.0","node-pre-gyp":"^0.11.0","simple-get":"^3.0.3"},"description":"Canvas graphics API backed by Cairo","devDependencies":{"@types/node":"^10.12.18","assert-rejects":"^1.0.0","dtslint":"^0.5.3","express":"^4.16.3","mocha":"^5.2.0","pixelmatch":"^4.0.2","standard":"^12.0.1"},"engines":{"node":">=6"},"files":["binding.gyp","lib/","src/","util/","types/index.d.ts"],"homepage":"https://github.com/Automattic/node-canvas","keywords":["canvas","graphic","graphics","pixman","cairo","image","images","pdf"],"license":"MIT","main":"index.js","name":"canvas","repository":{"type":"git","url":"git://github.com/Automattic/node-canvas.git"},"scripts":{"benchmark":"node benchmarks/run.js","dtslint":"dtslint types","install":"node-pre-gyp install --fallback-to-build","prebenchmark":"node-gyp build","pretest":"standard examples/*.js test/server.js test/public/*.js benchmarks/run.js lib/context2d.js util/has_lib.js browser.js index.js && node-gyp build","pretest-server":"node-gyp build","test":"mocha test/*.test.js","test-server":"node test/server.js"},"types":"types/index.d.ts","version":"2.6.1"}; /***/ }), diff --git a/package-lock.json b/package-lock.json index 311d2d3..073ee9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@kie/build-chain-files-generator", - "version": "1.0.0", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -32,26 +32,26 @@ "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" }, "@actions/exec": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.4.tgz", - "integrity": "sha512-4DPChWow9yc9W3WqEbUj8Nr86xkpyE29ZzWjXucHItclLbEW6jr80Zx4nqv18QL6KK65+cifiQZXvnqgTV6oHw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.1.0.tgz", + "integrity": "sha512-LImpN9AY0J1R1mEYJjVJfSZWU4zYOlEcwSTgPve1rFQqK5AwrEs6uWW5Rv70gbDIQIAUwI86z6B+9mPK4w9Sbg==", "requires": { "@actions/io": "^1.0.1" } }, "@actions/glob": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.1.tgz", - "integrity": "sha512-ikM4GVZOgSGDNTjv0ECJ8AOqmDqQwtO4K1M4P465C9iikRq34+FwCjUVSwzgOYDP85qtddyWpzBw5lTub/9Xmg==", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz", + "integrity": "sha512-SclLR7Ia5sEqjkJTPs7Sd86maMDw43p769YxBOxvPvEWuPEhpAnBsQfENOpXjFYMmhCqd127bmf+YdvJqVqR4A==", "requires": { "@actions/core": "^1.2.6", "minimatch": "^3.0.4" } }, "@actions/http-client": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.9.tgz", - "integrity": "sha512-0O4SsJ7q+MK0ycvXPl2e6bMXV7dxAXOGjrXS1eTF9s2S401Tp6c/P3c3Joz04QefC1J6Gt942Wl2jbm3f4mLcg==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", + "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", "requires": { "tunnel": "0.0.6" } @@ -987,9 +987,9 @@ } }, "@kie/build-chain-configuration-reader": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@kie/build-chain-configuration-reader/-/build-chain-configuration-reader-2.0.2.tgz", - "integrity": "sha512-pYjSA8QlON/VEuahzgUbDyeAey2XwUn/BYasJmjEdeDnQ6ltMiTTJK29v6HAuh/umgXOIbu172gzR/qIO4gAZA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@kie/build-chain-configuration-reader/-/build-chain-configuration-reader-2.2.0.tgz", + "integrity": "sha512-5WN0QbA7egqcC3w/l8aXhABlHdoBBrryvQTvG2UQAG6KGu1or185XpF5/JOqRPiomtQpKFRnclMhJhv0XfJ9pQ==", "requires": { "@actions/artifact": "^0.3.5", "@actions/core": "^1.1.3", @@ -1013,11 +1013,21 @@ } }, "@octokit/auth-token": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.3.tgz", - "integrity": "sha512-fdGoOQ3kQJh+hrilc0Plg50xSfaCKOeYN9t6dpJKXN9BxhhfquL0OzoQXg3spLYymL5rm29uPeI3KEXRaZQ9zg==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.5.tgz", + "integrity": "sha512-BpGYsPgJt05M7/L/5FoE1PiAbdxXFZkX/3kDYcsvd1v6UhlnE5e96dTDr0ezX/EFwciQxf3cNV0loipsURU+WA==", "requires": { - "@octokit/types": "^5.0.0" + "@octokit/types": "^6.0.3" + }, + "dependencies": { + "@octokit/types": { + "version": "6.16.4", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.16.4.tgz", + "integrity": "sha512-UxhWCdSzloULfUyamfOg4dJxV9B+XjgrIZscI0VCbp4eNrjmorGEw+4qdwcpTsu6DIrm9tQsFQS2pK5QkqQ04A==", + "requires": { + "@octokit/openapi-types": "^7.3.2" + } + } } }, "@octokit/core": { @@ -1034,15 +1044,23 @@ } }, "@octokit/endpoint": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.9.tgz", - "integrity": "sha512-3VPLbcCuqji4IFTclNUtGdp9v7g+nspWdiCUbK3+iPMjJCZ6LEhn1ts626bWLOn0GiDb6j+uqGvPpqLnY7pBgw==", + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", + "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", "requires": { - "@octokit/types": "^5.0.0", + "@octokit/types": "^6.0.3", "is-plain-object": "^5.0.0", "universal-user-agent": "^6.0.0" }, "dependencies": { + "@octokit/types": { + "version": "6.16.4", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.16.4.tgz", + "integrity": "sha512-UxhWCdSzloULfUyamfOg4dJxV9B+XjgrIZscI0VCbp4eNrjmorGEw+4qdwcpTsu6DIrm9tQsFQS2pK5QkqQ04A==", + "requires": { + "@octokit/openapi-types": "^7.3.2" + } + }, "universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", @@ -1051,15 +1069,23 @@ } }, "@octokit/graphql": { - "version": "4.5.7", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.5.7.tgz", - "integrity": "sha512-Gk0AR+DcwIK/lK/GX+OQ99UqtenQhcbrhHHfOYlrCQe17ADnX3EKAOKRsAZ9qZvpi5MuwWm/Nm+9aO2kTDSdyA==", + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.6.4.tgz", + "integrity": "sha512-SWTdXsVheRmlotWNjKzPOb6Js6tjSqA2a8z9+glDJng0Aqjzti8MEWOtuT8ZSu6wHnci7LZNuarE87+WJBG4vg==", "requires": { - "@octokit/request": "^5.3.0", - "@octokit/types": "^5.0.0", + "@octokit/request": "^5.6.0", + "@octokit/types": "^6.0.3", "universal-user-agent": "^6.0.0" }, "dependencies": { + "@octokit/types": { + "version": "6.16.4", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.16.4.tgz", + "integrity": "sha512-UxhWCdSzloULfUyamfOg4dJxV9B+XjgrIZscI0VCbp4eNrjmorGEw+4qdwcpTsu6DIrm9tQsFQS2pK5QkqQ04A==", + "requires": { + "@octokit/openapi-types": "^7.3.2" + } + }, "universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", @@ -1067,18 +1093,33 @@ } } }, + "@octokit/openapi-types": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-7.3.2.tgz", + "integrity": "sha512-oJhK/yhl9Gt430OrZOzAl2wJqR0No9445vmZ9Ey8GjUZUpwuu/vmEFP0TDhDXdpGDoxD6/EIFHJEcY8nHXpDTA==" + }, "@octokit/plugin-paginate-rest": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.6.0.tgz", - "integrity": "sha512-o+O8c1PqsC5++BHXfMZabRRsBIVb34tXPWyQLyp2IXq5MmkxdipS7TXM4Y9ldL1PzY9CTrCsn/lzFFJGM3oRRA==", + "version": "2.13.5", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.13.5.tgz", + "integrity": "sha512-3WSAKBLa1RaR/7GG+LQR/tAZ9fp9H9waE9aPXallidyci9oZsfgsLn5M836d3LuDC6Fcym+2idRTBpssHZePVg==", "requires": { - "@octokit/types": "^5.5.0" + "@octokit/types": "^6.13.0" + }, + "dependencies": { + "@octokit/types": { + "version": "6.16.4", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.16.4.tgz", + "integrity": "sha512-UxhWCdSzloULfUyamfOg4dJxV9B+XjgrIZscI0VCbp4eNrjmorGEw+4qdwcpTsu6DIrm9tQsFQS2pK5QkqQ04A==", + "requires": { + "@octokit/openapi-types": "^7.3.2" + } + } } }, "@octokit/plugin-request-log": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.2.tgz", - "integrity": "sha512-oTJSNAmBqyDR41uSMunLQKMX0jmEXbwD1fpz8FG27lScV3RhtGfBa1/BBLym+PxcC16IBlF7KH9vP1BUYxA+Eg==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==" }, "@octokit/plugin-rest-endpoint-methods": { "version": "3.17.0", @@ -1100,20 +1141,26 @@ } }, "@octokit/request": { - "version": "5.4.10", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.10.tgz", - "integrity": "sha512-egA49HkqEORVGDZGav1mh+VD+7uLgOxtn5oODj6guJk0HCy+YBSYapFkSLFgeYj3Fr18ZULKGURkjyhkAChylw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.0.tgz", + "integrity": "sha512-4cPp/N+NqmaGQwbh3vUsYqokQIzt7VjsgTYVXiwpUP2pxd5YiZB2XuTedbb0SPtv9XS7nzAKjAuQxmY8/aZkiA==", "requires": { "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.0.0", - "@octokit/types": "^5.0.0", - "deprecation": "^2.0.0", + "@octokit/request-error": "^2.1.0", + "@octokit/types": "^6.16.1", "is-plain-object": "^5.0.0", "node-fetch": "^2.6.1", - "once": "^1.4.0", "universal-user-agent": "^6.0.0" }, "dependencies": { + "@octokit/types": { + "version": "6.16.4", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.16.4.tgz", + "integrity": "sha512-UxhWCdSzloULfUyamfOg4dJxV9B+XjgrIZscI0VCbp4eNrjmorGEw+4qdwcpTsu6DIrm9tQsFQS2pK5QkqQ04A==", + "requires": { + "@octokit/openapi-types": "^7.3.2" + } + }, "universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", @@ -1122,13 +1169,23 @@ } }, "@octokit/request-error": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.3.tgz", - "integrity": "sha512-GgD5z8Btm301i2zfvJLk/mkhvGCdjQ7wT8xF9ov5noQY8WbKZDH9cOBqXzoeKd1mLr1xH2FwbtGso135zGBgTA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", + "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", "requires": { - "@octokit/types": "^5.0.1", + "@octokit/types": "^6.0.3", "deprecation": "^2.0.0", "once": "^1.4.0" + }, + "dependencies": { + "@octokit/types": { + "version": "6.16.4", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.16.4.tgz", + "integrity": "sha512-UxhWCdSzloULfUyamfOg4dJxV9B+XjgrIZscI0VCbp4eNrjmorGEw+4qdwcpTsu6DIrm9tQsFQS2pK5QkqQ04A==", + "requires": { + "@octokit/openapi-types": "^7.3.2" + } + } } }, "@octokit/rest": { @@ -1826,9 +1883,9 @@ } }, "before-after-hook": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", - "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==" + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" }, "bl": { "version": "1.2.3", @@ -3624,14 +3681,14 @@ "dev": true }, "fs-extra": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.1.tgz", - "integrity": "sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", "requires": { "at-least-node": "^1.0.0", "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", - "universalify": "^1.0.0" + "universalify": "^2.0.0" } }, "fs-minipass": { @@ -6009,13 +6066,6 @@ "requires": { "graceful-fs": "^4.1.6", "universalify": "^2.0.0" - }, - "dependencies": { - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" - } } }, "jsprim": { @@ -6135,9 +6185,9 @@ "dev": true }, "macos-release": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.4.1.tgz", - "integrity": "sha512-H/QHeBIN1fIGJX517pvK8IEK53yQOW7YcEI55oYtgjDdoCQQz7eJS94qt5kNrscReEyuD/JcdFCm2XBEcGOITg==" + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.5.0.tgz", + "integrity": "sha512-EIgv+QZ9r+814gjJj0Bt5vSLJLzswGmSUbUpbi9AIr/fsN2IWFBl2NucV9PAiek+U1STK468tEkxmVYUtuAN3g==" }, "make-dir": { "version": "3.1.0", @@ -8384,9 +8434,9 @@ } }, "universalify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", - "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" }, "unset-value": { "version": "1.0.0", diff --git a/package.json b/package.json index 377f6d4..e0c9142 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kie/build-chain-files-generator", - "version": "1.0.1", + "version": "1.1.0", "description": "NodeJS tool to create files based on build configuration", "repository": { "type": "git", @@ -36,7 +36,7 @@ }, "dependencies": { "@actions/core": "^1.1.3", - "@kie/build-chain-configuration-reader": "^2.0.2", + "@kie/build-chain-configuration-reader": "^2.2.0", "argparse": "^2.0.1", "dotenv": "^8.2.0", "tree-image-drawer": "^1.2.0" diff --git a/project-dependencies.yaml b/project-dependencies.yaml index c021f53..380125f 100644 --- a/project-dependencies.yaml +++ b/project-dependencies.yaml @@ -1,4 +1,4 @@ -version: "2.0" +version: "2.1" dependencies: - project: kiegroup/lienzo-core @@ -39,10 +39,12 @@ dependencies: mapping: dependencies: default: - source: 7.x - target: master - source: master - target: 7.x + - source: 7.x + target: master + dependant: + default: + - source: master + target: 7.x exclude: - kiegroup/optaweb-employee-rostering - kiegroup/optaweb-vehicle-routing @@ -115,10 +117,12 @@ dependencies: mapping: dependencies: default: - source: 7.x - target: master - source: master - target: 7.x + - source: 7.x + target: master + dependant: + default: + - source: master + target: 7.x exclude: - kiegroup/optaweb-vehicle-routing - kiegroup/optaplanner @@ -129,10 +133,12 @@ dependencies: mapping: dependencies: default: - source: 7.x - target: master - source: master - target: 7.x + - source: 7.x + target: master + dependant: + default: + - source: master + target: 7.x exclude: - kiegroup/optaweb-employee-rostering - kiegroup/optaplanner diff --git a/test/resources/definition-file-prod.yaml b/test/resources/definition-file-prod.yaml index 2340c83..ff1ff55 100644 --- a/test/resources/definition-file-prod.yaml +++ b/test/resources/definition-file-prod.yaml @@ -1,4 +1,4 @@ -version: "2.0" +version: "2.1" dependencies: - project: kiegroup/lienzo-core @@ -40,10 +40,12 @@ dependencies: mapping: dependencies: default: - source: 7.x - target: master - source: master - target: 7.x + - source: 7.x + target: master + dependant: + default: + - source: master + target: 7.x exclude: - kiegroup/optaweb-employee-rostering - kiegroup/optaweb-vehicle-routing @@ -116,10 +118,12 @@ dependencies: mapping: dependencies: default: - source: 7.x - target: master - source: master - target: 7.x + - source: 7.x + target: master + dependant: + default: + - source: master + target: 7.x exclude: - kiegroup/optaweb-vehicle-routing - kiegroup/optaplanner @@ -130,10 +134,12 @@ dependencies: mapping: dependencies: default: - source: 7.x - target: master - source: master - target: 7.x + - source: 7.x + target: master + dependant: + default: + - source: master + target: 7.x exclude: - kiegroup/optaweb-employee-rostering - kiegroup/optaplanner diff --git a/test/resources/definition-file.yaml b/test/resources/definition-file.yaml index 211f632..c221122 100644 --- a/test/resources/definition-file.yaml +++ b/test/resources/definition-file.yaml @@ -1,4 +1,4 @@ -version: "2.0" +version: "2.1" dependencies: - project: kiegroup/lienzo-core @@ -40,10 +40,12 @@ dependencies: mapping: dependencies: default: - source: 7.x - target: master - source: master - target: 7.x + - source: 7.x + target: master + dependant: + default: + - source: master + target: 7.x exclude: - kiegroup/optaweb-employee-rostering - kiegroup/optaweb-vehicle-routing @@ -116,10 +118,12 @@ dependencies: mapping: dependencies: default: - source: 7.x - target: master - source: master - target: 7.x + - source: 7.x + target: master + dependant: + default: + - source: master + target: 7.x exclude: - kiegroup/optaweb-vehicle-routing - kiegroup/optaplanner @@ -130,10 +134,12 @@ dependencies: mapping: dependencies: default: - source: 7.x - target: master - source: master - target: 7.x + - source: 7.x + target: master + dependant: + default: + - source: master + target: 7.x exclude: - kiegroup/optaweb-employee-rostering - kiegroup/optaplanner