From 998d630b4ba8da97edcab07abf7dfedf1397701e Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:39:55 +0200 Subject: [PATCH 1/4] Governance: Test Contributing to Plugins Docs --- Client/httpInterface.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index ebf8e9ea4..78a4e6f16 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1341,7 +1341,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE owner: owner, repo: repo, issue_number: pullRequest.number, - body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that a User Profile file... \n\n' + fileContentUrl + '\n\n...was submitted together with ' + (listResponse.data.length - 1)+ ' other file/s. User Profiles files as per the Governance System rules, must be the only file present at a Pull Request in order to pass all the validations and be automatically merged.' + body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that a User Profile file... \n\n' + fileContentUrl + '\n\n...was submitted together with ' + (listResponse.data.length - 1) + ' other file/s. User Profiles files as per the Governance System rules, must be the only file present at a Pull Request in order to pass all the validations and be automatically merged.' }); await sleep(GITHUB_API_WAITING_TIME) @@ -1365,7 +1365,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE if (fileContentUrl.indexOf('Governance/Plugins/User-Profiles') < 0) { console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Validation #2 Failed -> Pull Request "' + pullRequest.title + '" not merged because the file modified at the Pull Request it not a User Profile file. -> fileContentUrl = ' + fileContentUrl) continue - } + } let splittedURL = fileContentUrl.split('/') let fileName = splittedURL[splittedURL.length - 1] @@ -1375,7 +1375,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE if (githubUsername !== fileName) { console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Validation #2 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the File Name. -> Github Username = ' + githubUsername + '-> fileName = ' + fileName) - + await sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ owner: owner, @@ -1432,6 +1432,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE /* All validations passed, we will proceed an merge this Pull Request. */ + continue await sleep(GITHUB_API_WAITING_TIME) let mergeResponse = await octokit.rest.pulls.merge({ owner: owner, From 36e0d763f5d28937b08020b9e586b596c353227f Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:45:53 +0200 Subject: [PATCH 2/4] Governance: Bug Fixed on auto merging from other branches different to develop --- Client/httpInterface.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 78a4e6f16..a1ff41918 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1263,7 +1263,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE repo: repo, state: 'open', head: 'develop', - base: undefined, + base: 'develop', sort: undefined, direction: undefined, per_page: per_page, @@ -1432,7 +1432,6 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE /* All validations passed, we will proceed an merge this Pull Request. */ - continue await sleep(GITHUB_API_WAITING_TIME) let mergeResponse = await octokit.rest.pulls.merge({ owner: owner, From 256a412b7c7d1af8ce2ee2db03f8c1e1e993b3c4 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:46:48 +0200 Subject: [PATCH 3/4] Governance: Bug Fixed on auto merging from other branches different to develop --- Client/httpInterface.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index a1ff41918..e8a50a177 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1363,7 +1363,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE let fileContentUrl = pullRequestFile.raw_url if (fileContentUrl.indexOf('Governance/Plugins/User-Profiles') < 0) { - console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Validation #2 Failed -> Pull Request "' + pullRequest.title + '" not merged because the file modified at the Pull Request it not a User Profile file. -> fileContentUrl = ' + fileContentUrl) + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Validation #2 Failed -> Pull Request "' + pullRequest.title + '" not merged because the file modified at the Pull Request is not a User Profile file. -> fileContentUrl = ' + fileContentUrl) continue } From 6774e7b3591eb024bfe4b1a102ef43e0510c167e Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:50:22 +0200 Subject: [PATCH 4/4] Governance: Bug Fixed on auto merging from other branches different to develop 2 --- Client/httpInterface.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index e8a50a177..2389e5f7e 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1363,6 +1363,9 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE let fileContentUrl = pullRequestFile.raw_url if (fileContentUrl.indexOf('Governance/Plugins/User-Profiles') < 0) { + /* + If it is not a user profile then there is no need to auto merge. + */ console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Validation #2 Failed -> Pull Request "' + pullRequest.title + '" not merged because the file modified at the Pull Request is not a User Profile file. -> fileContentUrl = ' + fileContentUrl) continue }