Merge branch 'develop' of https://github.com/Superalgos/Superalgos into develop
This commit is contained in:
commit
80f8ffc81f
141 files changed
+35562
-29302
No files matched your search
@@ -34,7 +34,7 @@
|
||||
if (eventHandler === undefined) {
|
||||
/*
|
||||
We will only create event handlers which were not created before. Remember that someone trying to listen events
|
||||
at an event handler that does not exist, will create that eventhandler, so it is possible that the emitter
|
||||
at an event handler that does not exist, will create that event handler, so it is possible that the emitter
|
||||
when trying to create the event handler in fact was late and the event handler is already there if the listener
|
||||
arrived here first. An event handler created with this method is not destroyed if there are no listeners or they
|
||||
all leave.
|
||||
@@ -50,8 +50,8 @@
|
||||
let eventHandler = eventHandlers.get(command.eventHandlerName)
|
||||
if (eventHandler !== undefined) {
|
||||
/*
|
||||
We will only delete event handlers which have noone listening, allowing a listener to continue listening even
|
||||
when the event emitter is gone, asuming that it could come back at some point in time and resume emitting.
|
||||
We will only delete event handlers which have no one listening, allowing a listener to continue listening even
|
||||
when the event emitter is gone, assuming that it could come back at some point in time and resume emitting.
|
||||
*/
|
||||
if (eventHandler.listeners.length === 0) {
|
||||
eventHandlers.delete(command.eventHandlerName)
|
||||
@@ -68,8 +68,8 @@
|
||||
if (eventHandler === undefined) {
|
||||
/*
|
||||
We will create event handlers which were not created before if a listener tries to listen to a handler that does not
|
||||
exist before the emitter comes and create it. This is to aviod syncronization problems and also problems with emitters life
|
||||
cycles with higher frecuency that the ones of listeners. Created in this way, event handlers are marked for deletion if
|
||||
exist before the emitter comes and create it. This is to avoid synchronization problems and also problems with emitters life
|
||||
cycles with higher frequency that the ones of listeners. Created in this way, event handlers are marked for deletion if
|
||||
all listeners stop listening at one point in time.
|
||||
*/
|
||||
eventHandler = newEventHandler()
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
if (eventHandler === undefined) {
|
||||
|
||||
/* If the event handler does not exist anymore, then there is no need to perform further actiions. */
|
||||
/* If the event handler does not exist anymore, then there is no need to perform further actions. */
|
||||
sendResponse(global.DEFAULT_OK_RESPONSE)
|
||||
return
|
||||
}
|
||||
@@ -112,7 +112,7 @@
|
||||
eventHandler.stopListening(command.eventHandlerName, command.eventType, command.callerId, command.eventSubscriptionId)
|
||||
|
||||
/*
|
||||
We check here if there are no more listeners and the event handler original emmiter is also gone, then we need to delete
|
||||
We check here if there are no more listeners and the event handler original emitter is also gone, then we need to delete
|
||||
this event handlers since chances are that is not needed anymore.
|
||||
*/
|
||||
if (eventHandler.listeners.length === 0 && eventHandler.deleteWhenAllListenersAreGone === true) {
|
||||
@@ -130,7 +130,7 @@
|
||||
eventHandler = newEventHandler()
|
||||
eventHandlers.set(command.eventHandlerName, eventHandler)
|
||||
|
||||
/* No matter if it is the listener or the emiter the one that acts first, if an event handler does not exist we just create it acan keep it there. */
|
||||
/* No matter if it is the listener or the emitter the one that acts first, if an event handler does not exist we just create it and keep it there. */
|
||||
|
||||
}
|
||||
//console.log("[INFO] Client -> Events Server -> Raising Event " + command.eventHandlerName + " " + command.eventType)
|
||||
@@ -163,7 +163,7 @@
|
||||
let thisObject = {
|
||||
name: undefined, // This is for debugging purposes only.
|
||||
deleteWhenAllListenersAreGone: false,
|
||||
listeners: [], // Here we store all the functions we will call when an event is raiseed.
|
||||
listeners: [], // Here we store all the functions we will call when an event is raised.
|
||||
listenToEvent: listenToEvent,
|
||||
stopListening: stopListening,
|
||||
raiseEvent: raiseEvent,
|
||||
@@ -181,7 +181,7 @@
|
||||
|
||||
/*
|
||||
We can not allow to have the exact same listener more than once. In case that we find a listener trying to listen again, the first record will
|
||||
be deleted and we are just going to consider the last one comming in.
|
||||
be deleted and we are just going to consider the last one coming in.
|
||||
*/
|
||||
for (let i = 0; i < thisObject.listeners.length; i++) {
|
||||
if (eventHandlerName === thisObject.listeners[i][0] && eventType === thisObject.listeners[i][1] && callerId === thisObject.listeners[i][2]) {
|
||||
|
||||
@@ -316,7 +316,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
owner: owner,
|
||||
repo: repo,
|
||||
issue_number: pullRequest.number,
|
||||
body: 'This Pull Request was automatically merged by the Superalgos Governance System because it was detected that the Github User " ' + githubUsername + '" who submitted it, modified its own User Profile Plugin File and nothning else but that file. All validations were successfull.'
|
||||
body: 'This Pull Request was automatically merged by the Superalgos Governance System because it was detected that the Github User " ' + githubUsername + '" who submitted it, modified its own User Profile Plugin File and nothing else but that file. All validations were successful.'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
fileName = splittedFileName[0]
|
||||
githubUsername = pullRequest.user.login
|
||||
|
||||
if (githubUsername !== fileName) {
|
||||
if (githubUsername.toLowerCase() !== fileName.toLowerCase()) {
|
||||
console.log('[INFO] Github Server -> 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 PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
@@ -420,7 +420,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
*/
|
||||
let config = JSON.parse(userProfile.config)
|
||||
let messageSigned = config.signature.message
|
||||
if (messageSigned !== githubUsername) {
|
||||
if (messageSigned.toLowerCase() !== githubUsername.toLowerCase()) {
|
||||
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #4 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the Message Signed at the User Profile. -> Github Username = ' + githubUsername + '-> messageSigned = ' + messageSigned)
|
||||
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
@@ -480,7 +480,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
/*
|
||||
Validation #6: The name of the User Profile node is not the Github Username.
|
||||
*/
|
||||
if (userProfile.name !== githubUsername) {
|
||||
if (userProfile.name.toLowerCase() !== githubUsername.toLowerCase()) {
|
||||
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #6 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the User Profile node\'s name. -> Github Username = ' + githubUsername + '-> userProfile.name = ' + userProfile.name)
|
||||
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
@@ -628,7 +628,7 @@ exports.newGithubServer = function newGithubServer() {
|
||||
*/
|
||||
let messageSigned = config.signature.message
|
||||
|
||||
if (messageSigned !== githubUsername) {
|
||||
if (messageSigned.toLowerCase() !== githubUsername.toLowerCase()) {
|
||||
console.log('[INFO] Github Server -> mergeGithubPullRequests -> Validation #9 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Signing Account ' + signingAccount.name + ' has not signed the current Github User Account, but something else. -> messageSigned = ' + messageSigned + '-> githubUsername = ' + githubUsername)
|
||||
|
||||
await PL.projects.foundations.utilities.asyncFunctions.sleep(GITHUB_API_WAITING_TIME)
|
||||
|
||||
@@ -724,7 +724,7 @@ exports.newHttpInterface = function newHttpInterface() {
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> doGit -> currentBranch = ' + currentBranch)
|
||||
console.log('[ERROR] httpInterface -> App -> Contribute -> doGit -> contributionsBranch = ' + contributionsBranch)
|
||||
console.log('')
|
||||
console.log('Torubleshooting Tips:')
|
||||
console.log('Troubleshooting Tips:')
|
||||
console.log('')
|
||||
console.log('1. Make sure that you have set up your Github Username and Token at the APIs -> Github API node at the workspace.')
|
||||
console.log('2. Make sure you are running the latest version of Git available for your OS.')
|
||||
|
||||
Reference in new issue
Block a user