From 3276c8b8b94751c9f125d1dbc1f0c49edce43202 Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Fri, 6 Aug 2021 09:46:27 -0500 Subject: [PATCH 01/39] Update Action Docs topic --- ...-automating-actions-what-is-an-action.json | 12 ++++----- ...automating-actions-adding-a-menu-item.json | 20 +++++++++----- ...s-locating-the-right-function-library.json | 12 ++++----- ...tomating-actions-adding-your-function.json | 11 ++++---- ...05-automating-actions-using-utilities.json | 7 ++--- ...ting-actions-using-function-libraries.json | 27 ++++++++++--------- ...-actions-adding-an-action-switch-case.json | 16 ++++++----- ...utomating-actions-testing-your-action.json | 3 ++- 8 files changed, 61 insertions(+), 47 deletions(-) diff --git a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-001-automating-actions-what-is-an-action.json b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-001-automating-actions-what-is-an-action.json index 6c6a36c89..dee60b16d 100644 --- a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-001-automating-actions-what-is-an-action.json +++ b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-001-automating-actions-what-is-an-action.json @@ -14,8 +14,8 @@ }, { "style": "Text", - "text": "Maybe you realized that you are doing repetitive actions at the Design Space and you can benefit from automating them. If your actions are constrained to manipulating the nodes at the workspace, by either creating new nodes, deleting existing ones, changing nodes configs, establishing references or some other similar stuff, then you might be able to create an Action function that can automate all this. This will allow you to stop doing those repetitive tasks youself and the ones that will come after you if you contribute these changes to the project.", - "updated": 1614940379811 + "text": "Maybe you realized that you are doing repetitive actions at the Design Space and you can benefit from automating them. If your actions are constrained to manipulating the nodes at the workspace, by either creating new nodes, deleting existing ones, changing nodes configs, establishing references or something similar, then you might be able to create an Action function that can automate all this. This will allow you to complete the action with the click of a button and stop doing those repetitive tasks youself. Not to mention help make Superalgos easier to use for everyone once you contribute your action!", + "updated": 1628255167092 }, { "style": "Title", @@ -23,8 +23,8 @@ }, { "style": "Text", - "text": "New Actions are implemented as functions inside a Function Library. So the basic workflow to implement a new Action is the following:", - "updated": 1614940407806 + "text": "New Actions are implemented as functions inside a Function Library. So the basic workflow to implement a new Action is as follows:", + "updated": 1628255279553 }, { "style": "List", @@ -43,8 +43,8 @@ }, { "style": "List", - "text": "Connect Menu Item to your Code: Finally you will connect the Menu Item to that function you wrote.", - "updated": 1614940545908 + "text": "Connect Menu Item to your Code: Finally you will connect the Menu Item to the function you wrote.", + "updated": 1628255317721 } ] } \ No newline at end of file diff --git a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-002-automating-actions-adding-a-menu-item.json b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-002-automating-actions-adding-a-menu-item.json index ab80d8dd5..41854ab4f 100644 --- a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-002-automating-actions-adding-a-menu-item.json +++ b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-002-automating-actions-adding-a-menu-item.json @@ -14,17 +14,18 @@ }, { "style": "Text", - "text": "Check out the page of the App Schema concept. After that, locate the App Schema file you will need to edit at the Projects folder. There is one App Schema file for Project, pick the right one and edit it with VS Code." + "text": "Check out the page of the App Schema concept. After that, locate the App Schema file you will need to edit at the Projects folder. There is one App Schema file for each Project, pick the right one and edit it with VS Code.", + "updated": 1628255380671 }, { "style": "Warning", - "text": "Be carefull not to damage anything in the App Schema file while editing it. You will get into trouble if you do so. It can not only produce the UI not to load, but it can also damage the workspace you are working at.", - "updated": 1614940590024 + "text": "Be carefull not to damage anything in the App Schema file while editing it. You will get into trouble if you do. It can not only cause the UI to not load, but also damage the workspace you are working at.", + "updated": 1628255452468 }, { "style": "Success", - "text": "If you are not sure which project a certain node belongs to, there is a trick to find it out: close the Docs tab, and make focus on the node you want to add an Action to. While on focus, use Ctrl + Shift + Alt + F12 to log in the browser console the Node object. Inspect it to see the project property. Most likely it will be a Superalgos project's node.", - "updated": 1614940654950 + "text": "If you are not sure which project a certain node belongs to, there is a trick to find it: close the Docs tab, and make focus on the node you want to add an Action to. While on focus, use Ctrl + Shift + Alt + F12 to log in the browser console the Node object. Inspect it to see the project property. Most likely it will be a Foundations project's node.", + "updated": 1628255532030 }, { "style": "Title", @@ -37,8 +38,8 @@ }, { "style": "Json", - "text": "{\n \"action\": \"Add UI Object\",\n \"actionFunction\": \"payload.executeAction\",\n \"label\": \"Add Image\",\n \"relatedUiObject\": \"Image\"\n }", - "updated": 1614789262250 + "text": "{\n \"action\": \"Add Missing Workspace Projects\",\n \"label\": \"Add Missing Projects\",\n \"relatedUiObject\": \"Workspace\",\n \"actionFunction\": \"payload.executeAction\"\n}", + "updated": 1628255951872 }, { "style": "Text", @@ -90,6 +91,11 @@ { "style": "List", "text": "propertyToCheckFor: read the previous property." + }, + { + "style": "List", + "text": "workDoneLabel: text to display when action has completed", + "updated": 1628256114205 } ] } \ No newline at end of file diff --git a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-003-automating-actions-locating-the-right-function-library.json b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-003-automating-actions-locating-the-right-function-library.json index 86e1ce316..4cf66c441 100644 --- a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-003-automating-actions-locating-the-right-function-library.json +++ b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-003-automating-actions-locating-the-right-function-library.json @@ -9,18 +9,18 @@ "paragraphs": [ { "style": "Text", - "text": "The procedure to locate a suitable Function Library is very easy. Open the Projects folder, getting into the Project the Node where the action is going to be triggered at is defined. Inside that project Folder get into the UI folder and then into Function-Libraries folder.", - "updated": 1614940833232 + "text": "The procedure to locate a suitable Function Library is very easy. Open the Projects folder, then open the Project associated with the Node you are attaching your action to. Inside that project Folder open the UI folder and then you will see the Function-Libraries folder.", + "updated": 1628256668116 }, { "style": "Note", - "text": "Each file in there is a Function Library except for the one called ActionSwitch.js, which is the place where you connect the Action Function name you defined at the App Schema with the function that will host the code for the new Action.", - "updated": 1614928708817 + "text": "Each file within the Function Library folder is a set of functions. The only exception to this is ActionSwitch.js. This file is the place where you will connect the Action Function name you defined at the App Schema with the function that will host the code for the new Action.", + "updated": 1628256808055 }, { "style": "Text", - "text": "Inspect each of these files and see at their header the functions they already implement. After a quick scan over all of them you can decide which one is where your action belongs to. If you believe that your Action should be placed at a new Function Library, then you can try to add a new one and set it up at the Project Schema file, but that is out of the scope of this guide.", - "updated": 1614928780531 + "text": "Inspect each of these files and see at their header the functions they already implement. After a quick scan over all of them you can decide which one fits best with your new action. If you believe that your Action should be placed at a new Function Library, then you can try to add a new one and set it up at the Project Schema file, but that is out of the scope of this guide.", + "updated": 1628256858024 }, { "style": "Title", diff --git a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-004-automating-actions-adding-your-function.json b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-004-automating-actions-adding-your-function.json index 00bfbed75..68ab3d8e5 100644 --- a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-004-automating-actions-adding-your-function.json +++ b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-004-automating-actions-adding-your-function.json @@ -3,18 +3,19 @@ "pageNumber": 4, "type": "Automating Actions - Adding your Function", "definition": { - "text": "Take a look at how other functions are implemented in the Function Library and try to follow that way.", - "updated": 1614941850917 + "text": "Take a look at how other functions are implemented in the Function Library and try to follow the same format.", + "updated": 1628257476029 }, "paragraphs": [ { "style": "Text", - "text": "The basic procedure is quite straight forward. First add the function name to the thisObject and the write you function at the most appropiate place at the Function Library. ", - "updated": 1614941084806 + "text": "The basic procedure is quite straight forward. First add the function name to the thisObject and then write your function at the most appropiate place at the Function Library.", + "updated": 1628257461177 }, { "style": "Important", - "text": "Please document your function the best you can, even if you see the other functions implemented at the same library poorly documented. See if you can make your function the best documented in the whole library." + "text": "Please document your function the best you can, even if you see other functions implemented at the same library poorly documented. See if you can make your function the best documented in the whole library.", + "updated": 1628257493687 }, { "style": "Title", diff --git a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-005-automating-actions-using-utilities.json b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-005-automating-actions-using-utilities.json index 827da3839..1669f4620 100644 --- a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-005-automating-actions-using-utilities.json +++ b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-005-automating-actions-using-utilities.json @@ -9,8 +9,8 @@ "paragraphs": [ { "style": "Text", - "text": "It is a very good idea to invest some time at the Utilities folder, scaning the files in there to see what you already have available to use at your actions. You will see that other actions in Function Libraries heavily rely on utilities functions defined at one of the files at the Utilities folder.", - "updated": 1614930012933 + "text": "It is a very good idea to invest some time at the Utilities folder, scaning the files in there to see what you already have available to use at your actions. You will see that other actions in Function Libraries heavily rely on utilities functions defined at one of the files within the Utilities folder.", + "updated": 1628257595439 }, { "style": "Title", @@ -19,7 +19,8 @@ }, { "style": "Text", - "text": "At runtime, all utility objects will be already instantiated by the time your Action function code runs. You just need to get to the object that host the utility funtion you want to execute via the UI Global Object that is available to you. For exmaple:" + "text": "At runtime, all utility objects will be already instantiated by the time your Action function code runs. You just need to get to the object that hosts the utility function you want to execute via the UI Global Object that is available to you. For example:", + "updated": 1628257649169 }, { "style": "Javascript", diff --git a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-006-automating-actions-using-function-libraries.json b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-006-automating-actions-using-function-libraries.json index d92702bd0..11f902b85 100644 --- a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-006-automating-actions-using-function-libraries.json +++ b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-006-automating-actions-using-function-libraries.json @@ -3,14 +3,14 @@ "pageNumber": 6, "type": "Automating Actions - Using Function Libraries", "definition": { - "text": "You might also as well other functions located at Function Libraries from within your Action Function. In order to do this, you just need to locate the instance of the Function Library Object and call any of it's functions.", - "updated": 1614942828678 + "text": "You can also utilize other functions located within the Function Libraries to help build your Action Function. In order to do this, you just need to locate the instance of the Function Library Object and call any of it's functions.", + "updated": 1628257841959 }, "paragraphs": [ { "style": "Text", - "text": "It is a very good idea to invest some time at the Function-Libraries folder, scaning the files in there to see what you already have available to use at your actions. You will see that other actions in Function Libraries heavily rely on functions defined at one of the files at the Function-Libraries folder.", - "updated": 1614942900881 + "text": "It is a very good idea to invest some time at the Function-Libraries folder, scaning the files in there to see what you already have available to use at your actions. You will see that other actions in Function Libraries heavily rely on functions defined at one of the files within the Function-Libraries folder.", + "updated": 1628257873103 }, { "style": "Title", @@ -19,8 +19,8 @@ }, { "style": "Text", - "text": "At runtime, all Funtion Library objects will be already instantiated by the time your Action function code runs. You just need to get to the object that host the Function Library funtion you want to execute via the UI Global Object that is available to you. For exmaple:", - "updated": 1614942976608 + "text": "At runtime, all Function Library objects will be already instantiated by the time your Action function code runs. You just need to get to the object that host the Function Library funtion you want to execute via the UI Global Object that is available to you. For exmaple:", + "updated": 1628257884243 }, { "style": "Javascript", @@ -48,8 +48,8 @@ }, { "style": "Text", - "text": "At your own Action Function you might likely need to execute these functions, belonging to popular actions done at Action Functions:", - "updated": 1614943932540 + "text": "At your own Action Function you will likely need to execute these or similar functions, belonging to popular actions defined within other Action Functions:", + "updated": 1628257991399 }, { "style": "Subtitle", @@ -57,7 +57,8 @@ }, { "style": "Text", - "text": "The following is an example on how to add a new children to an existing Node:" + "text": "The following is an example on how to add a new child to an existing Node:", + "updated": 1628258008587 }, { "style": "Javascript", @@ -87,13 +88,13 @@ }, { "style": "Text", - "text": "Example of how to set the Reference Parent of a Node (in this case no Function Library is needed):", - "updated": 1614944033214 + "text": "Example of how to set the Reference Parent of a Node:", + "updated": 1628258163153 }, { "style": "Javascript", - "text": "node.payload.referenceParent = baseAsset\n", - "updated": 1614943688069 + "text": "UI.projects.foundations.functionLibraries.attachDetach.referenceAttachNode(timeMachine, session)", + "updated": 1628258141256 }, { "style": "Text", diff --git a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-008-automating-actions-adding-an-action-switch-case.json b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-008-automating-actions-adding-an-action-switch-case.json index 8357547a3..829842bbb 100644 --- a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-008-automating-actions-adding-an-action-switch-case.json +++ b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-008-automating-actions-adding-an-action-switch-case.json @@ -3,8 +3,8 @@ "pageNumber": 8, "type": "Automating Actions - Adding an Action Switch Case", "definition": { - "text": "This steps create the mapping betwheen the actionFunction name you defined at the Menu Item of the node that can trigger your Action, and the function you coded inside a Function Library that will execute the code for the new Action. ", - "updated": 1614941772231 + "text": "This step creates the mapping between the actionFunction name you defined at the Menu Item of the node to can trigger your Action, and the function you coded inside a Function Library that will execute the code for the new Action.", + "updated": 1628258863939 }, "paragraphs": [ { @@ -18,8 +18,8 @@ }, { "style": "Text", - "text": "Find within the list of cases some of the cases pointint to the same Function Library your new Action is hosted at, so that you can add a new case together with the rest.", - "updated": 1614937904095 + "text": "Find within the list of cases some of the cases pointing to the same Function Library your new Action is hosted at, so that you can add a new case together with the rest.", + "updated": 1628258889849 }, { "style": "Title", @@ -37,8 +37,12 @@ }, { "style": "Success", - "text": "As you can see will you most likely be sending the node and rootNodes parameters into your Action function. You might want to also send other parameters from data you might find into the action object available to you at that point.", - "updated": 1614938157839 + "text": "As you can see you will most likely be sending the node and rootNodes parameters into your Action function. However, you might want to also send other parameters with data you find available within the system at this point into the action object. ", + "updated": 1628259076042 + }, + { + "style": "Note", + "text": "Setting a breakpoint here within Chrome's devTools is a convenient way to check the system for available data. " }, { "style": "Text", diff --git a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-009-automating-actions-testing-your-action.json b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-009-automating-actions-testing-your-action.json index 4d00b6752..f811c9f56 100644 --- a/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-009-automating-actions-testing-your-action.json +++ b/Projects/Foundations/Schemas/Docs-Topics/H/How/How-to-Automate-Actions-at-The-Design-Space/how-to-automate-actions-at-the-design-space-009-automating-actions-testing-your-action.json @@ -14,7 +14,8 @@ }, { "style": "Text", - "text": "In order to debug your action, you will need to open the developer tool, and at the Sources tab, locate the Function Library file where you added your action, place a breakpoint at the begining of your function and go and click at the node Menu Item you added." + "text": "In order to debug your action, you will need to open the developer tool, and at the Sources tab, locate the Function Library file where you added your action, place a breakpoint at the beginning of your function and go and click at the node Menu Item you added.", + "updated": 1628261072790 }, { "style": "Success", From 9870d0135484823bc003999c36778a1636142b03 Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Fri, 6 Aug 2021 09:46:53 -0500 Subject: [PATCH 02/39] Basic Reference Check Action Mapping --- Projects/Foundations/Schemas/App-Schema/workspace.json | 7 +++++++ Projects/Foundations/UI/Function-Libraries/ActionSwitch.js | 5 +++++ .../UI/Function-Libraries/WorkspaceFunctions.js | 7 ++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Projects/Foundations/Schemas/App-Schema/workspace.json b/Projects/Foundations/Schemas/App-Schema/workspace.json index 64eb21205..7bfa79ca7 100644 --- a/Projects/Foundations/Schemas/App-Schema/workspace.json +++ b/Projects/Foundations/Schemas/App-Schema/workspace.json @@ -37,6 +37,13 @@ "workDoneLabel": "Done", "relatedUiObject": "Workspace", "actionFunction": "payload.executeAction" + }, + { + "action": "Check For Missing References", + "label": "Check For Missing References", + "workDoneLabel": "Done", + "relatedUiObject": "Workspace", + "actionFunction": "payload.executeAction" } ], "initialValues": { diff --git a/Projects/Foundations/UI/Function-Libraries/ActionSwitch.js b/Projects/Foundations/UI/Function-Libraries/ActionSwitch.js index be3df9094..1d3e14e67 100644 --- a/Projects/Foundations/UI/Function-Libraries/ActionSwitch.js +++ b/Projects/Foundations/UI/Function-Libraries/ActionSwitch.js @@ -724,6 +724,11 @@ function newFoundationsActionSwitch() { UI.projects.foundations.functionLibraries.workspaceFunctions.addMissingWorkspaceProjects(action.node, action.rootNodes) } break + case 'Check For Missing References': + { + UI.projects.foundations.functionLibraries.workspaceFunctions.checkForMissingReferences() + } + break case 'Switch To Forward Testing': { action.node.type = "Forward Testing Session" diff --git a/Projects/Foundations/UI/Function-Libraries/WorkspaceFunctions.js b/Projects/Foundations/UI/Function-Libraries/WorkspaceFunctions.js index 977b289f3..2f89d3cb3 100644 --- a/Projects/Foundations/UI/Function-Libraries/WorkspaceFunctions.js +++ b/Projects/Foundations/UI/Function-Libraries/WorkspaceFunctions.js @@ -1,6 +1,7 @@ function newFoundationsFunctionLibraryWorkspaceFunctions() { let thisObject = { - addMissingWorkspaceProjects: addMissingWorkspaceProjects + addMissingWorkspaceProjects: addMissingWorkspaceProjects, + checkForMissingReferences: checkForMissingReferences } return thisObject @@ -26,4 +27,8 @@ function newFoundationsFunctionLibraryWorkspaceFunctions() { } } } + + function checkForMissingReferences() { + console.log("this action is working") + } } From a5a9d933bf914d95dffd288058e0250198016fb6 Mon Sep 17 00:00:00 2001 From: Brenden Harrell Date: Fri, 6 Aug 2021 21:51:25 -0500 Subject: [PATCH 03/39] Implement Check for missing reference parent action --- .../Schemas/App-Schema/workspace.json | 1 - .../UI/Function-Libraries/ActionSwitch.js | 2 +- .../Function-Libraries/UiObjectsFromNodes.js | 3 --- .../Function-Libraries/WorkspaceFunctions.js | 24 +++++++++++++++++-- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Projects/Foundations/Schemas/App-Schema/workspace.json b/Projects/Foundations/Schemas/App-Schema/workspace.json index 7bfa79ca7..3d8838f08 100644 --- a/Projects/Foundations/Schemas/App-Schema/workspace.json +++ b/Projects/Foundations/Schemas/App-Schema/workspace.json @@ -41,7 +41,6 @@ { "action": "Check For Missing References", "label": "Check For Missing References", - "workDoneLabel": "Done", "relatedUiObject": "Workspace", "actionFunction": "payload.executeAction" } diff --git a/Projects/Foundations/UI/Function-Libraries/ActionSwitch.js b/Projects/Foundations/UI/Function-Libraries/ActionSwitch.js index 1d3e14e67..7f7a90d8f 100644 --- a/Projects/Foundations/UI/Function-Libraries/ActionSwitch.js +++ b/Projects/Foundations/UI/Function-Libraries/ActionSwitch.js @@ -726,7 +726,7 @@ function newFoundationsActionSwitch() { break case 'Check For Missing References': { - UI.projects.foundations.functionLibraries.workspaceFunctions.checkForMissingReferences() + UI.projects.foundations.functionLibraries.workspaceFunctions.checkForMissingReferences(action.rootNodes) } break case 'Switch To Forward Testing': diff --git a/Projects/Foundations/UI/Function-Libraries/UiObjectsFromNodes.js b/Projects/Foundations/UI/Function-Libraries/UiObjectsFromNodes.js index 09e342d08..9a93e5e21 100644 --- a/Projects/Foundations/UI/Function-Libraries/UiObjectsFromNodes.js +++ b/Projects/Foundations/UI/Function-Libraries/UiObjectsFromNodes.js @@ -383,9 +383,6 @@ function newFoundationsFunctionLibraryUiObjectsFromNodes() { } } } - } - if (node.payload.referenceParent === undefined) { - console.log('[WARN]' + node.type + ' ' + node.name + ' reference parent lost during re-binding phase.') } } diff --git a/Projects/Foundations/UI/Function-Libraries/WorkspaceFunctions.js b/Projects/Foundations/UI/Function-Libraries/WorkspaceFunctions.js index 2f89d3cb3..e3576dc9c 100644 --- a/Projects/Foundations/UI/Function-Libraries/WorkspaceFunctions.js +++ b/Projects/Foundations/UI/Function-Libraries/WorkspaceFunctions.js @@ -28,7 +28,27 @@ function newFoundationsFunctionLibraryWorkspaceFunctions() { } } - function checkForMissingReferences() { - console.log("this action is working") + // This function scales the current workspace and highlights any nodes that have unresolved references + function checkForMissingReferences(rootNodes) { + let nodes + for (let i = 0; i < rootNodes.length; i++) { + if (rootNodes[i] !== undefined) { + nodes = UI.projects.foundations.utilities.hierarchy.getHiriarchyMap(rootNodes[i]) + for (let [key, value] of nodes) { + // Check nodes that have a saved reference parent + if (value.savedPayload.referenceParent !== undefined) { + // Highlight nodes that do not have an active reference connected to their referance parent + if (value.payload.referenceParent === undefined) { + console.log("[WARN] Reference Parent not found in the current workspace.\n Node:", value.name, " Type:", value.type, " ID:", key, " Node Object:", value) + UI.projects.foundations.spaces.floatingSpace.inMapMode = true + value.payload.uiObject.setWarningMessage('Reference Parent not found in the current workspace.', 10) + } + + } + } + + } + } + } } From 925df2e54e14e3c9b9b945c47e39521d12851a4f Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 13:45:07 +0200 Subject: [PATCH 04/39] Governance gov.PRs command implemented at the Client --- Client/httpInterface.js | 280 +++++++++- Client/package.json | 3 +- .../User-Profiles/Luis-Fernando-Molina.json | 486 +++++++++++++----- ...1-gov-message-pull-requests-processed.json | 10 +- .../Spaces/Reports-Space/CommandInterface.js | 14 +- .../UI/Spaces/Reports-Space/FiltersHeader.js | 8 +- .../UI/Spaces/Reports-Space/ReportsSpace.js | 10 +- .../Spaces/User-Profile-Space/UserProfile.js | 4 +- 8 files changed, 661 insertions(+), 154 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 15363300d..0abf1ffa5 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1022,20 +1022,28 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE case 'Gov': { switch (requestParameters[2]) { // switch by command case 'getGithubStars': { - getProfiles('activity', 'listStargazersForRepo') + getGithubUsernames('activity', 'listStargazersForRepo') break } case 'getGithubWatchers': { - getProfiles('activity', 'listWatchersForRepo') + getGithubUsernames('activity', 'listWatchersForRepo') break } case 'getGithubForks': { - getProfiles('repos', 'listForks') + getGithubUsernames('repos', 'listForks') + break + } + case 'PRs': { + mergeGithubPullRequests() + break + } + case 'Pay': { + payToContributors() break } } - function getProfiles(endpoint, method) { + function getGithubUsernames(endpoint, method) { try { const GITHUB_API_WAITING_TIME = 250 const repository = unescape(requestParameters[3]) @@ -1099,13 +1107,13 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE for (let i = 0; i < listResponse.data.length; i++) { let listItem = listResponse.data[i] - let githubUsername - switch(endpoint) { - case 'activity' : { + let githubUsername + switch (endpoint) { + case 'activity': { githubUsername = listItem.login break } - case 'repos' : { + case 'repos': { githubUsername = listItem.owner.login break } @@ -1114,8 +1122,8 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE githubListArray.push(githubUsername) } - console.log('[INFO] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList -> ' + method + ' Page = ' + page) - console.log('[INFO] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList -> ' + method + ' Received = ' + listResponse.data.length) + console.log('[INFO] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList -> ' + method + ' Page = ' + page) + console.log('[INFO] httpInterface -> Gov -> getRepoInfo -> doGithub -> getList -> ' + method + ' Received = ' + listResponse.data.length) } catch (err) { console.log(err) @@ -1152,6 +1160,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE respondWithContent(JSON.stringify(error), httpResponse) } } + function respondWithDocsObject(docs, error) { if (error.message !== undefined) { @@ -1186,6 +1195,223 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE respondWithContent(JSON.stringify(customResponse), httpResponse) } + + function mergeGithubPullRequests() { + try { + let commitMessage = unescape(requestParameters[3]) + + /* Unsavping # */ + for (let i = 0; i < 10; i++) { + commitMessage = commitMessage.replace('_SLASH_', '/') + commitMessage = commitMessage.replace('_HASHTAG_', '#') + } + + const GITHUB_API_WAITING_TIME = 250 + const repository = 'Superalgos' + const username = unescape(requestParameters[4]) + const token = unescape(requestParameters[5]) + const currentBranch = unescape(requestParameters[6]) + const contributionsBranch = unescape(requestParameters[7]) + let error + let githubPrListArray = [] + + processOpenPullRequests() + + async function processOpenPullRequests() { + await doGithub() + if (error !== undefined) { + + let docs = { + project: 'Governance', + category: 'Topic', + type: 'Gov Error - Merge Pull Requests', + anchor: undefined, + placeholder: {} + } + + respondWithDocsObject(docs, error) + return + } + + respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), httpResponse) + } + + async function doGithub() { + try { + + const { Octokit } = require("@octokit/rest") + + const octokit = new Octokit({ + auth: token, + userAgent: 'Superalgos Beta 11' + }) + await getPrList() + await mergePrs() + + async function getPrList() { + const repo = repository + const owner = 'Superalgos' + const per_page = 100 // Max + let page = 0 + let lastPage = false + + while (lastPage === false) { + try { + page++ + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Requesting Page = ' + page) + + await sleep(GITHUB_API_WAITING_TIME) + let listResponse = await octokit.rest.pulls.list({ + owner: owner, + repo: repo, + state: 'open', + head: 'develop', + base: undefined, + sort: undefined, + direction: undefined, + per_page: per_page, + page: page + }); + + if (listResponse.data.length < 100) { + lastPage = true + } + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Receiving Page = ' + page) + for (let i = 0; i < listResponse.data.length; i++) { + let pullRequest = listResponse.data[i] + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Pull Request "' + pullRequest.title + '" found and added to the list to validate. ') + githubPrListArray.push(pullRequest) + } + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Received = ' + listResponse.data.length) + + } catch (err) { + console.log(err) + + if (err.stack.indexOf('last page') >= 0) { + return + } else { + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList ->Method call produced an error.') + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList ->err.stack = ' + err.stack) + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList ->repository = ' + repository) + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList ->username = ' + username) + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList ->token starts with = ' + token.substring(0, 10) + '...') + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList ->token ends with = ' + '...' + token.substring(token.length - 10)) + error = err + } + } + } + } + + async function mergePrs() { + /* + In order to automatically merge a PRs we will run several validations first. + We want to automate specifically the merging of Profile File changes at the + Governance System done by the same Github user name that matches the profile + changed. We will also not do the merge if there are more than one file at the + PR. + + We will go through the list of open PRs and run the validations at each one of them. + */ + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Ready to Validate ' + githubPrListArray.length + ' pull requests. ') + + for (let i = 0; i < githubPrListArray.length; i++) { + let pullRequest = githubPrListArray[i] + /* + Lets get the files changed at this Pull Request. + */ + await sleep(GITHUB_API_WAITING_TIME) + let listResponse = await octokit.rest.pulls.listFiles({ + owner: owner, + repo: repo, + pull_number: pullRequest.number + }); + /* + Validation #1: If the PR has more than one file, then we will not automatically + merge it. + */ + if (listResponse.data.length !== 1) { + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Validation #1 Failed -> Pull Request "' + pullRequest.title + '" not merged because it contains more than 1 file. -> fileCount = ' + listResponse.data.length) + continue + } + let pullRequestFile = listResponse.data[0] + /* + Validation #2: File Name must be the same to the Github Username of the PR owner. + */ + let fileContentUrl = pullRequestFile.raw_url + let splittedURL = fileContentUrl.split('/') + let fileName = splittedURL[splittedURL.length - 1] + let splittedFileName = fileName.split('.') + fileName = splittedFileName[0] + let githubUsername = pullRequest.user.login + + 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) + continue + } + await sleep(GITHUB_API_WAITING_TIME) + let fileContent = await fetchAPIDataFile(fileContentUrl) + + let userProfile = JSON.parse(fileContent) + /* + Validation #3: The file changed at the PR is a User Profile. + */ + if (userProfile.type !== 'User Profile') { + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Validation #3 Failed -> Pull Request "' + pullRequest.title + '" not merged because the file modified is not a User Profile. -> Type = ' + userProfile.type) + continue + } + /* + Validation #4: The message signed at the config is not the Github Username. + */ + let config = JSON.parser(userProfile.config) + let messageSigned = config.signature.message + if (messageSigned !== githubUsername) { + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Validation #4 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the Messaged Signed at the User Profile. -> Github Username = ' + githubUsername + '-> messageSigned = ' + messageSigned) + continue + } + /* + All validations passed, we will proceed an merge this Pull Request. + */ + await sleep(GITHUB_API_WAITING_TIME) + let mergeResponse = await octokit.rest.pulls.merge({ + owner: owner, + repo: repo, + pull_number: pullRequest.number, + commit_title: 'Changes in User Profile done by Profile Owner ' + githubUsername + ' automatically merged by Superalgos.' + }); + + if (mergeResponse.merged !== true) { + console.log('[WARN] httpInterface -> Gov -> mergeGithubPullRequests -> Merge Failed -> Pull Request "' + pullRequest.title + '" not merged because Github could not merge it. -> mergeResponse.message = ' + mergeResponse.message) + continue + } else { + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Merge Succed -> Pull Request "' + pullRequest.title + '" successfully merged. -> mergeResponse.message = ' + mergeResponse.message) + } + } + } + } catch (err) { + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> err.stack = ' + err.stack) + } + } + + } catch (err) { + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> Method call produced an error.') + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> err.stack = ' + err.stack) + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> repository = ' + repository) + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> username = ' + username) + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> token starts with = ' + token.substring(0, 10) + '...') + console.log('[ERROR] httpInterface -> Gov -> mergeGithubPullRequests -> token ends with = ' + '...' + token.substring(token.length - 10)) + + let error = { + result: 'Fail Because', + message: err.message, + stack: err.stack + } + respondWithContent(JSON.stringify(error), httpResponse) + } + } + + function payToContributors() { + + } } break @@ -2139,4 +2365,38 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE setTimeout(resolve, ms) }) } + + async function fetchAPIDataFile(url) { + let promise = new Promise((resolve, reject) => { + + const fetch = require('node-fetch') + /* + This is how we call the API. + */ + fetch(url) + .then((response) => { + + if (response.status !== 200) { + console.log('[ERROR] fetchAPIData -> then -> url =' + url) + reject() + return + } + getResponseBody() + + function getResponseBody() { + response.text().then(body => { + resolve(body) + }) + } + }) + .catch(err => { + console.log('[ERROR] fetchAPIData -> url =' + url) + reject() + }) + + } + ) + + return promise + } } diff --git a/Client/package.json b/Client/package.json index 78c439b0f..fe63a2483 100644 --- a/Client/package.json +++ b/Client/package.json @@ -15,6 +15,7 @@ "rimraf": "^3.0.2", "simple-git": "^2.42.0", "web3": "^1.5.0", - "ws": "^7.4.6" + "ws": "^7.4.6", + "node-fetch": "2.6.1" } } diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index ab7e9bdea..245c7569a 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -597,35 +597,51 @@ "referenceParentCombinedNodePath": [ [ "Luis-Fernando-Molina", - "User Profile" + "User Profile", + "Governance", + "148911b3-b2f3-44fb-8cb4-017991789132" ], [ "New Token Power Switch", - "Token Power Switch" + "Token Power Switch", + "Governance", + "f8182a9c-f830-4ec1-a238-ac3a5efd69e6" ], [ "New Votes And Claims Programs", - "Votes And Claims Programs" + "Votes And Claims Programs", + "Governance", + "bb390957-b8a2-4a8a-9fbf-963ea20f6eaf" ], [ "New Claims Program", - "Claims Program" + "Claims Program", + "Governance", + "796dd30f-c90d-4b8d-a63d-89867347407b" ], [ "Project Features Feature Class", - "Feature Claims Folder" + "Feature Claims Folder", + "Governance", + "f8a482c4-dee0-475a-831b-7514fd255ba6" ], [ "Superalgos Platform Feature Class", - "Feature Claims Folder" + "Feature Claims Folder", + "Governance", + "ba6b4ff8-396b-4a9d-95ba-a52d096ec9eb" ], [ "New Features Feature Class", - "Feature Claims Folder" + "Feature Claims Folder", + "Governance", + "c4815ebe-d3a8-47fd-b204-936242bd8f40" ], [ "Governance System New Features", - "Feature Contribution Claim" + "Feature Contribution Claim", + "Governance", + "92f0f22e-f631-482d-88b1-c16596bf951d" ] ] } @@ -664,35 +680,51 @@ "referenceParentCombinedNodePath": [ [ "Luis-Fernando-Molina", - "User Profile" + "User Profile", + "Governance", + "148911b3-b2f3-44fb-8cb4-017991789132" ], [ "New Token Power Switch", - "Token Power Switch" + "Token Power Switch", + "Governance", + "f8182a9c-f830-4ec1-a238-ac3a5efd69e6" ], [ "New Votes And Claims Programs", - "Votes And Claims Programs" + "Votes And Claims Programs", + "Governance", + "bb390957-b8a2-4a8a-9fbf-963ea20f6eaf" ], [ "New Claims Program", - "Claims Program" + "Claims Program", + "Governance", + "796dd30f-c90d-4b8d-a63d-89867347407b" ], [ "Project Features Feature Class", - "Feature Claims Folder" + "Feature Claims Folder", + "Governance", + "f8a482c4-dee0-475a-831b-7514fd255ba6" ], [ "Superalgos Platform Feature Class", - "Feature Claims Folder" + "Feature Claims Folder", + "Governance", + "ba6b4ff8-396b-4a9d-95ba-a52d096ec9eb" ], [ "New Features Feature Class", - "Feature Claims Folder" + "Feature Claims Folder", + "Governance", + "c4815ebe-d3a8-47fd-b204-936242bd8f40" ], [ "API Maps New Features", - "Feature Contribution Claim" + "Feature Contribution Claim", + "Governance", + "81c477e0-c9bf-4b25-a875-d265011a6136" ] ] } @@ -5264,23 +5296,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "Existing Features", - "Feature Class" + "Feature Class", + "Governance", + "b46ffee0-7c89-4155-8450-678d7cea24f8" ], [ "Charting System", - "Feature" + "Feature", + "Governance", + "992fe8ce-bd27-4857-900c-e0330b7ccc51" ] ] } @@ -5319,23 +5361,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "Existing Features", - "Feature Class" + "Feature Class", + "Governance", + "b46ffee0-7c89-4155-8450-678d7cea24f8" ], [ "Data Mining", - "Feature" + "Feature", + "Governance", + "afa546fa-799b-4c50-baa3-65c8409aaab9" ] ] } @@ -5374,23 +5426,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "Existing Features", - "Feature Class" + "Feature Class", + "Governance", + "b46ffee0-7c89-4155-8450-678d7cea24f8" ], [ "Visual Designer", - "Feature" + "Feature", + "Governance", + "b88a3b22-7060-45c8-90bd-57ec53e95c4f" ] ] } @@ -5429,23 +5491,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "Existing Features", - "Feature Class" + "Feature Class", + "Governance", + "b46ffee0-7c89-4155-8450-678d7cea24f8" ], [ "Visual Debugger", - "Feature" + "Feature", + "Governance", + "f713d118-f53a-4fc6-9b39-9e8717c4bd6f" ] ] } @@ -5481,19 +5553,27 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "Existing Features", - "Feature Class" + "Feature Class", + "Governance", + "b46ffee0-7c89-4155-8450-678d7cea24f8" ] ] } @@ -5541,23 +5621,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "New Features", - "Feature Class" + "Feature Class", + "Governance", + "372acad9-fb7b-4ac7-9620-28a66ac9c40d" ], [ "Governance System", - "Feature" + "Feature", + "Governance", + "a5a7304e-155a-47d1-97f7-c50b88082000" ] ] } @@ -5596,23 +5686,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "New Features", - "Feature Class" + "Feature Class", + "Governance", + "372acad9-fb7b-4ac7-9620-28a66ac9c40d" ], [ "API Maps", - "Feature" + "Feature", + "Governance", + "28c5218d-3213-4a10-8e28-11d5ae460547" ] ] } @@ -5651,23 +5751,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "New Features", - "Feature Class" + "Feature Class", + "Governance", + "372acad9-fb7b-4ac7-9620-28a66ac9c40d" ], [ "User Defined Variables and Code", - "Feature" + "Feature", + "Governance", + "55e7b969-383c-4ae8-95c0-2dc18473404f" ] ] } @@ -5706,23 +5816,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "New Features", - "Feature Class" + "Feature Class", + "Governance", + "372acad9-fb7b-4ac7-9620-28a66ac9c40d" ], [ "Tensor Flow Integration", - "Feature" + "Feature", + "Governance", + "68388215-3e97-4864-9804-72e91ecff02b" ] ] } @@ -5758,19 +5878,27 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "New Features", - "Feature Class" + "Feature Class", + "Governance", + "372acad9-fb7b-4ac7-9620-28a66ac9c40d" ] ] } @@ -5809,15 +5937,21 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ] ] } @@ -5871,23 +6005,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Mobile App", - "Feature Class" + "Feature Class", + "Governance", + "f193b1f9-c97d-4831-87b4-defe9f6aab9a" ], [ "Needed Features", - "Feature Class" + "Feature Class", + "Governance", + "243a3f35-62a2-4193-ab19-da643accd275" ], [ "Android Mobile App", - "Feature" + "Feature", + "Governance", + "22e0864c-5a2a-40b5-a24d-fe46cde7dd64" ] ] } @@ -5926,23 +6070,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Mobile App", - "Feature Class" + "Feature Class", + "Governance", + "f193b1f9-c97d-4831-87b4-defe9f6aab9a" ], [ "Needed Features", - "Feature Class" + "Feature Class", + "Governance", + "243a3f35-62a2-4193-ab19-da643accd275" ], [ "iOS Mobile App", - "Feature" + "Feature", + "Governance", + "dc029fe2-d4f7-46a1-908d-3d3251af002e" ] ] } @@ -5981,23 +6135,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Mobile App", - "Feature Class" + "Feature Class", + "Governance", + "f193b1f9-c97d-4831-87b4-defe9f6aab9a" ], [ "Needed Features", - "Feature Class" + "Feature Class", + "Governance", + "243a3f35-62a2-4193-ab19-da643accd275" ], [ "Huawei Mobile App", - "Feature" + "Feature", + "Governance", + "198f47fc-61bd-41a1-9b2f-7bc1bea082f9" ] ] } @@ -6033,19 +6197,27 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Mobile App", - "Feature Class" + "Feature Class", + "Governance", + "f193b1f9-c97d-4831-87b4-defe9f6aab9a" ], [ "Needed Features", - "Feature Class" + "Feature Class", + "Governance", + "243a3f35-62a2-4193-ab19-da643accd275" ] ] } @@ -6084,15 +6256,21 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Mobile App", - "Feature Class" + "Feature Class", + "Governance", + "f193b1f9-c97d-4831-87b4-defe9f6aab9a" ] ] } @@ -6146,23 +6324,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos P2P Network", - "Feature Class" + "Feature Class", + "Governance", + "e205d4f2-140e-4d4b-a839-e37a6537dfa9" ], [ "Needed Features", - "Feature Class" + "Feature Class", + "Governance", + "0253c529-e28f-43b5-8b3a-a86abb38dc4a" ], [ "Node.js Implementation", - "Feature" + "Feature", + "Governance", + "bda64809-41d7-41a8-9166-792a6df000e1" ] ] } @@ -6198,19 +6386,27 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos P2P Network", - "Feature Class" + "Feature Class", + "Governance", + "e205d4f2-140e-4d4b-a839-e37a6537dfa9" ], [ "Needed Features", - "Feature Class" + "Feature Class", + "Governance", + "0253c529-e28f-43b5-8b3a-a86abb38dc4a" ] ] } @@ -6249,15 +6445,21 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos P2P Network", - "Feature Class" + "Feature Class", + "Governance", + "e205d4f2-140e-4d4b-a839-e37a6537dfa9" ] ] } @@ -6296,11 +6498,15 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ] ] } @@ -12817,23 +13023,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "New Features", - "Feature Class" + "Feature Class", + "Governance", + "372acad9-fb7b-4ac7-9620-28a66ac9c40d" ], [ "Governance System", - "Feature" + "Feature", + "Governance", + "a5a7304e-155a-47d1-97f7-c50b88082000" ] ] } @@ -12872,23 +13088,33 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "New Features", - "Feature Class" + "Feature Class", + "Governance", + "372acad9-fb7b-4ac7-9620-28a66ac9c40d" ], [ "API Maps", - "Feature" + "Feature", + "Governance", + "28c5218d-3213-4a10-8e28-11d5ae460547" ] ] } @@ -12923,19 +13149,27 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ], [ "New Features", - "Feature Class" + "Feature Class", + "Governance", + "372acad9-fb7b-4ac7-9620-28a66ac9c40d" ] ] } @@ -12971,15 +13205,21 @@ "referenceParentCombinedNodePath": [ [ "Superalgos", - "Features" + "Features", + "Governance", + "1d2c1985-c762-4ece-b350-15bd893bd1f4" ], [ "Project Features", - "Feature Class" + "Feature Class", + "Governance", + "136b6e7a-f042-441b-84be-395b56b65b70" ], [ "Superalgos Platform", - "Feature Class" + "Feature Class", + "Governance", + "f83a751e-ff0c-49bd-a306-8b5ab6a8cc83" ] ] } @@ -13208,7 +13448,7 @@ { "type": "Delegate Power Switch", "name": "harrellbm", - "config": "{\n \"percentage\": 20\n}", + "config": "{\n \"percentage\": 25\n}", "project": "Governance", "delegatePowerSwitch": [], "userDelegates": [], @@ -13238,7 +13478,7 @@ { "type": "Delegate Power Switch", "name": "Thomas", - "config": "{\n \"percentage\": 15\n}", + "config": "{\n \"percentage\": 20\n}", "project": "Governance", "delegatePowerSwitch": [], "userDelegates": [], @@ -13268,7 +13508,7 @@ { "type": "Delegate Power Switch", "name": "Carl", - "config": "{}", + "config": "{\n \"percentage\": 10\n}", "project": "Governance", "delegatePowerSwitch": [], "userDelegates": [], diff --git a/Projects/Governance/Schemas/Docs-Topics/G/Gov/Gov-Commands-Messages/gov-commands-messages-001-gov-message-pull-requests-processed.json b/Projects/Governance/Schemas/Docs-Topics/G/Gov/Gov-Commands-Messages/gov-commands-messages-001-gov-message-pull-requests-processed.json index c6f34197b..dbad39c4e 100644 --- a/Projects/Governance/Schemas/Docs-Topics/G/Gov/Gov-Commands-Messages/gov-commands-messages-001-gov-message-pull-requests-processed.json +++ b/Projects/Governance/Schemas/Docs-Topics/G/Gov/Gov-Commands-Messages/gov-commands-messages-001-gov-message-pull-requests-processed.json @@ -3,18 +3,16 @@ "pageNumber": "1", "type": "Gov Message - Pull Requests Processed", "definition": { - "text": "The pull requests at the main Superalgos repositoryhave been succesfully processed.", - "updated": 1611002547907, - "translations": [ - ] + "text": "The pull requests at the main Superalgos repository have been succesfully processed.", + "updated": 1628336677481, + "translations": [] }, "paragraphs": [ { "style": "Success", "text": "No further action from you is required. The PRs Processing Rules have been applied and all PRs that could be merged were merged.", "updated": 1611002626154, - "translations": [ - ] + "translations": [] } ] } \ No newline at end of file diff --git a/Projects/Governance/UI/Spaces/Reports-Space/CommandInterface.js b/Projects/Governance/UI/Spaces/Reports-Space/CommandInterface.js index eb7356989..fbde90f88 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/CommandInterface.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/CommandInterface.js @@ -27,14 +27,16 @@ function newGovernanceReportsCommmandInterface() { if (checkPayCommand() === undefined) { return true } function checkPRsCommand() { - if (UI.projects.governance.spaces.reportsSpace.commandInterface.command.toLowerCase() === 'gov.help gov.prs') { + + let command = UI.projects.governance.spaces.reportsSpace.commandInterface.command.toLowerCase() + if (command === 'gov.help gov.prs') { UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov PRs Command') return } - if (UI.projects.governance.spaces.reportsSpace.commandInterface.command.indexOf('Gov.PRs') !== 0 && UI.projects.governance.spaces.reportsSpace.commandInterface.command.indexOf('gov.prs') !== 0) { return 'Not PRs Commands' } + if (command.indexOf('gov.prs') !== 0 ) { return 'Not PRs Commands' } /* Set up the commit message */ - let message = UI.projects.governance.spaces.reportsSpace.commandInterface.command.trim().substring(UI.projects.governance.spaces.reportsSpace.commandInterface.command.indexOf(' ') + 1, UI.projects.governance.spaces.reportsSpace.commandInterface.command.length) + let message = command.trim().substring(command.indexOf(' ') + 1, command.length) if (message.toLowerCase() === 'gov.prs') { message = 'Automated PR merging process.' } @@ -96,11 +98,13 @@ function newGovernanceReportsCommmandInterface() { } function checkPayCommand() { - if (UI.projects.governance.spaces.reportsSpace.commandInterface.command.toLowerCase() === 'gov.help gov.pay') { + + let command = UI.projects.governance.spaces.reportsSpace.commandInterface.command.toLowerCase() + if (command === 'gov.help gov.pay') { UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Pay Command') return } - if (UI.projects.governance.spaces.reportsSpace.commandInterface.command.indexOf('Gov.Pay') !== 0 && UI.projects.governance.spaces.reportsSpace.commandInterface.command.indexOf('gov.pay') !== 0) { return 'Not Pay Commands' } + if (command.indexOf('gov.pay') !== 0) { return 'Not Pay Commands' } httpRequest(undefined, 'Gov/Pay/' + UI.projects.education.spaces.docsSpace.currentBranch, onResponse) UI.projects.education.spaces.docsSpace.navigateTo('Governance', 'Topic', 'Gov Message - Paying to Contributors') diff --git a/Projects/Governance/UI/Spaces/Reports-Space/FiltersHeader.js b/Projects/Governance/UI/Spaces/Reports-Space/FiltersHeader.js index 965e2ed32..ffe3c1aa1 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/FiltersHeader.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/FiltersHeader.js @@ -55,10 +55,10 @@ function newGovernanceReportsFiltersHeader() { if (event.key === "Enter" || event.keyCode === 13) { lastFilters = element.value.trim() UI.projects.governance.spaces.reportsSpace.reportsPage.render(undefined, lastFilters) - /* - UI.projects.education.spaces.docsSpace.commandInterface.command = element.value.trim() - UI.projects.education.spaces.docsSpace.commandInterface.detectCommands() - */ + + UI.projects.governance.spaces.reportsSpace.commandInterface.command = element.value.trim() + UI.projects.governance.spaces.reportsSpace.commandInterface.detectCommands() + } }); } diff --git a/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js b/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js index 840082abe..3487a3c57 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js @@ -24,6 +24,7 @@ function newGobernanceReportsSpace() { positions: undefined, mining: undefined, tablesSortingOrders: undefined, + commandInterface: undefined, changeTableSortingOrder, physics: physics, draw: draw, @@ -112,6 +113,9 @@ function newGobernanceReportsSpace() { thisObject.mining.finalize() thisObject.mining = undefined + thisObject.commandInterface.finalize() + thisObject.commandInterface = undefined + isInitialized = false } @@ -129,9 +133,10 @@ function newGobernanceReportsSpace() { thisObject.container.isDraggeable = false thisObject.container.detectMouseOver = true thisObject.container.status = 'hidden' - + resize() + thisObject.commandInterface = newGovernanceReportsCommmandInterface() thisObject.reportsPage = newGovernanceReportsReportsPage() thisObject.footer = newGovernanceReportsFooter() thisObject.filtersHeader = newGovernanceReportsFiltersHeader() @@ -152,6 +157,7 @@ function newGobernanceReportsSpace() { thisObject.positions = newGovernanceReportsPositions() thisObject.mining = newGovernanceReportsMining() + thisObject.commandInterface.initialize() thisObject.reportsPage.initialize() thisObject.footer.initialize() thisObject.filtersHeader.initialize() @@ -170,7 +176,7 @@ function newGobernanceReportsSpace() { thisObject.assets.initialize() thisObject.features.initialize() thisObject.positions.initialize() - thisObject.mining.initialize() + thisObject.mining.initialize() setupSidePanelTab() diff --git a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js index 43f066723..41cff0cb3 100644 --- a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js +++ b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js @@ -65,9 +65,7 @@ function newGovernanceUserProfileSpace() { return } - - - requestStars() + //requestStars() function requestStars() { httpRequest( From 53b960b54673be99bec1566ca0d669d14b552e6c Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 13:57:18 +0200 Subject: [PATCH 05/39] Governance Bug Fixed gov.prs command --- Client/httpInterface.js | 13 ++++++------- .../UI/Spaces/Reports-Space/ReportsSpace.js | 9 +++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 0abf1ffa5..ac7638269 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1238,9 +1238,9 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE async function doGithub() { try { - + const repo = repository + const owner = 'Superalgos' const { Octokit } = require("@octokit/rest") - const octokit = new Octokit({ auth: token, userAgent: 'Superalgos Beta 11' @@ -1249,8 +1249,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE await mergePrs() async function getPrList() { - const repo = repository - const owner = 'Superalgos' + const per_page = 100 // Max let page = 0 let lastPage = false @@ -1258,7 +1257,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE while (lastPage === false) { try { page++ - console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Requesting Page = ' + page) + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Requesting Page = ' + page) await sleep(GITHUB_API_WAITING_TIME) let listResponse = await octokit.rest.pulls.list({ @@ -1276,13 +1275,13 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE if (listResponse.data.length < 100) { lastPage = true } - console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Receiving Page = ' + page) + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Receiving Page = ' + page) for (let i = 0; i < listResponse.data.length; i++) { let pullRequest = listResponse.data[i] console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Pull Request "' + pullRequest.title + '" found and added to the list to validate. ') githubPrListArray.push(pullRequest) } - console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Received = ' + listResponse.data.length) + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Received = ' + listResponse.data.length) } catch (err) { console.log(err) diff --git a/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js b/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js index 3487a3c57..5790330d2 100644 --- a/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js +++ b/Projects/Governance/UI/Spaces/Reports-Space/ReportsSpace.js @@ -231,6 +231,15 @@ function newGobernanceReportsSpace() { 'width: ' + thisObject.container.frame.width + 'px;' + 'height: ' + thisObject.container.frame.height + 'px' } + + /* + Monitor the Docs Space to see if its tab is opened, to close this space tab. + */ + if (UI.projects.education.spaces.docsSpace.sidePanelTab.isOpen === true && + thisObject.sidePanelTab.isOpen === true + ) { + thisObject.sidePanelTab.close() + } } function getContainer(point, purpose) { From 41c0061aa080b2204c2651b107e329bcc7b2a463 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 14:16:22 +0200 Subject: [PATCH 06/39] Governance DeepScan bugs fixed --- Client/httpInterface.js | 3 +-- .../Governance/UI/Spaces/User-Profile-Space/UserProfile.js | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index ac7638269..e11382dee 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1210,8 +1210,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE const repository = 'Superalgos' const username = unescape(requestParameters[4]) const token = unescape(requestParameters[5]) - const currentBranch = unescape(requestParameters[6]) - const contributionsBranch = unescape(requestParameters[7]) + let error let githubPrListArray = [] diff --git a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js index 41cff0cb3..55723d405 100644 --- a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js +++ b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js @@ -37,7 +37,7 @@ function newGovernanceUserProfileSpace() { If the workspace is not related to governance, then we exit the Intialize Function */ let resultsArary = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile') - if (resultsArary.length === 0) { return } + if (resultsArary.length === 0 || resultsArary.length === 1) { return } /* Find the Username and Password */ @@ -65,7 +65,7 @@ function newGovernanceUserProfileSpace() { return } - //requestStars() + requestStars() function requestStars() { httpRequest( From 972cb4291db36c1ed8e6480a080c6b8679eb680f Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 14:18:19 +0200 Subject: [PATCH 07/39] Governance My Profile Update --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 245c7569a..c627ef6bc 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -13787,7 +13787,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": false, + "isCollapsed": true, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 From 92722e269157c3761cc4fa971879ddece28a066c Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 14:42:04 +0200 Subject: [PATCH 08/39] Governance Update Testing gov.prs --- Client/httpInterface.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index e11382dee..83c578e00 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1248,7 +1248,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE await mergePrs() async function getPrList() { - + const per_page = 100 // Max let page = 0 let lastPage = false @@ -1360,7 +1360,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE /* Validation #4: The message signed at the config is not the Github Username. */ - let config = JSON.parser(userProfile.config) + let config = JSON.parse(userProfile.config) let messageSigned = config.signature.message if (messageSigned !== githubUsername) { console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Validation #4 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the Messaged Signed at the User Profile. -> Github Username = ' + githubUsername + '-> messageSigned = ' + messageSigned) @@ -1377,6 +1377,8 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE commit_title: 'Changes in User Profile done by Profile Owner ' + githubUsername + ' automatically merged by Superalgos.' }); + console.log(mergeResponse) + if (mergeResponse.merged !== true) { console.log('[WARN] httpInterface -> Gov -> mergeGithubPullRequests -> Merge Failed -> Pull Request "' + pullRequest.title + '" not merged because Github could not merge it. -> mergeResponse.message = ' + mergeResponse.message) continue From 887277f3d1b3e08d7b6fe5d929823a8cecbd1415 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 14:45:04 +0200 Subject: [PATCH 09/39] Governance Update Testing gov.prs --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index c627ef6bc..245c7569a 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -13787,7 +13787,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": true, + "isCollapsed": false, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 From e011f1a4ad365fe4467c9a239d30ef3fdce37a65 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 14:47:14 +0200 Subject: [PATCH 10/39] Governance Update Testing gov.prs 3 --- Client/httpInterface.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 83c578e00..7f4cf06bf 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1377,13 +1377,11 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE commit_title: 'Changes in User Profile done by Profile Owner ' + githubUsername + ' automatically merged by Superalgos.' }); - console.log(mergeResponse) - - if (mergeResponse.merged !== true) { - console.log('[WARN] httpInterface -> Gov -> mergeGithubPullRequests -> Merge Failed -> Pull Request "' + pullRequest.title + '" not merged because Github could not merge it. -> mergeResponse.message = ' + mergeResponse.message) + if (mergeResponse.data.merged !== true) { + console.log('[WARN] httpInterface -> Gov -> mergeGithubPullRequests -> Merge Failed -> Pull Request "' + pullRequest.title + '" not merged because Github could not merge it. -> mergeResponse.message = ' + mergeResponse.data.message) continue } else { - console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Merge Succed -> Pull Request "' + pullRequest.title + '" successfully merged. -> mergeResponse.message = ' + mergeResponse.message) + console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Merge Succed -> Pull Request "' + pullRequest.title + '" successfully merged. -> mergeResponse.message = ' + mergeResponse.data.message) } } } From 42df2960ad824df7ec1db7e65a6480849c5f91b0 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 14:48:24 +0200 Subject: [PATCH 11/39] Governance Update Testing gov.prs 4 --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 245c7569a..b670c14c0 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -13333,7 +13333,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": true, + "isCollapsed": false, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 From 621a72c3339d994cea3be984a35f7d0bd80429c3 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 14:51:11 +0200 Subject: [PATCH 12/39] Governance Update Testing gov.prs 5 --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index b670c14c0..4d906dba0 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -1,7 +1,7 @@ { "type": "User Profile", "name": "Luis-Fernando-Molina", - "config": "{\"tokens\":10000000,\"signature\":{\"message\":\"Luis-Fernando-Molina\",\"messageHash\":\"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\"v\":\"0x1b\",\"r\":\"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\"s\":\"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\"signature\":\"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"},\"codeName\":\"Luis-Fernando-Molina\"}", + "config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"XXXLuis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n },\n \"codeName\": \"Luis-Fernando-Molina\"\n}", "project": "Governance", "tokenPowerSwitch": { "type": "Token Power Switch", From d9026e75051ecfe59ef31456fdcdd180f18d8e36 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 14:52:38 +0200 Subject: [PATCH 13/39] Governance Update Testing gov.prs 5 --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 4d906dba0..16c1698d0 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -1,7 +1,7 @@ { "type": "User Profile", "name": "Luis-Fernando-Molina", - "config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"XXXLuis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n },\n \"codeName\": \"Luis-Fernando-Molina\"\n}", + "config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"Luis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n },\n \"codeName\": \"Luis-Fernando-Molina\"\n}", "project": "Governance", "tokenPowerSwitch": { "type": "Token Power Switch", From 1a01996ff4ebb4d5ab131fbb766829e07a539f98 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 15:05:51 +0200 Subject: [PATCH 14/39] Governance Update Testing gov.prs 6 --- Client/httpInterface.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 7f4cf06bf..91a5ff9b7 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1256,7 +1256,6 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE while (lastPage === false) { try { page++ - console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> doGithub -> getPrList -> Requesting Page = ' + page) await sleep(GITHUB_API_WAITING_TIME) let listResponse = await octokit.rest.pulls.list({ @@ -1382,6 +1381,14 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE continue } else { console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Merge Succed -> Pull Request "' + pullRequest.title + '" successfully merged. -> mergeResponse.message = ' + mergeResponse.data.message) + await sleep(GITHUB_API_WAITING_TIME) + await octokit.rest.pulls.createReviewComment({ + owner: owner, + repo: repo, + pull_number: pullRequest.number, + body: 'This Pull Request was automatically merged by Superalgos because it was detected that a Github Username modified its own User Profile plugin file and nothning else but that file. All validations ran were successfull.' + }); + continue } } } From d9e6df8251acac05e8fcdb5e0383d0ed9a0b0a8a Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 15:07:25 +0200 Subject: [PATCH 15/39] Governance Update Testing gov.prs 7 --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 16c1698d0..53710724b 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -13333,7 +13333,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": false, + "isCollapsed": true, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 From 974112e6192f01094763783a0bafd9d0c1cf701d Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 15:13:17 +0200 Subject: [PATCH 16/39] Governance Update Testing gov.prs 8 --- Client/httpInterface.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 91a5ff9b7..4e753bc4d 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1382,10 +1382,10 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE } else { console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Merge Succed -> Pull Request "' + pullRequest.title + '" successfully merged. -> mergeResponse.message = ' + mergeResponse.data.message) await sleep(GITHUB_API_WAITING_TIME) - await octokit.rest.pulls.createReviewComment({ + await octokit.rest.issues.createComment({ owner: owner, repo: repo, - pull_number: pullRequest.number, + issue_number: pullRequest.number, body: 'This Pull Request was automatically merged by Superalgos because it was detected that a Github Username modified its own User Profile plugin file and nothning else but that file. All validations ran were successfull.' }); continue From 1caa07032e15582ef7266153efa9d6d9803ac608 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 15:14:57 +0200 Subject: [PATCH 17/39] Governance Update Testing gov.prs 9 --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 53710724b..6a96f898c 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -137,7 +137,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": true, + "isCollapsed": false, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 From a6014ebc7964057ba7bcf12f1880067c7c079fd9 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 15:27:27 +0200 Subject: [PATCH 18/39] Governance Update Testing gov.prs 10 --- Client/httpInterface.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 4e753bc4d..90ccb6f35 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1362,7 +1362,23 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE let config = JSON.parse(userProfile.config) let messageSigned = config.signature.message if (messageSigned !== githubUsername) { - console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Validation #4 Failed -> Pull Request "' + pullRequest.title + '" not merged because the Github Username is not equal to the Messaged Signed at the User Profile. -> Github Username = ' + githubUsername + '-> messageSigned = ' + messageSigned) + console.log('[INFO] httpInterface -> Gov -> 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 sleep(GITHUB_API_WAITING_TIME) + await octokit.rest.issues.createComment({ + owner: owner, + repo: repo, + issue_number: pullRequest.number, + body: 'This Pull Request could not be automatically merged by the Superalgos Governance System because it was detected that the Github User " ' + githubUsername + '" who submitted it, is not equal to the Message Signed at the User Profile. messageSigned = "' + messageSigned + '"' + }); + + await sleep(GITHUB_API_WAITING_TIME) + await octokit.rest.pulls.update({ + owner: owner, + repo: repo, + pull_number: pullRequest.number, + state: 'closed' + }); continue } /* @@ -1386,7 +1402,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE owner: owner, repo: repo, issue_number: pullRequest.number, - body: 'This Pull Request was automatically merged by Superalgos because it was detected that a Github Username modified its own User Profile plugin file and nothning else but that file. All validations ran were successfull.' + body: 'This Pull Request was automatically merged by the Superalgos Governance System because it was detected that a Github User " ' + githubUsername + '" who submitted it, modified its own User Profile Plugin File and nothning else but that file. All validations were successfull.' }); continue } From 5c13d0bc55491c89ef485afa2d983b75ca63de64 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 15:29:05 +0200 Subject: [PATCH 19/39] Governance Update Testing gov.prs 11 --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 6a96f898c..53710724b 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -137,7 +137,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": false, + "isCollapsed": true, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 From e515d88a0bfd7c9db0545a7af8eccbf376c432ae Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 15:32:13 +0200 Subject: [PATCH 20/39] Governance Update Testing gov.prs 12 --- Client/httpInterface.js | 2 +- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 90ccb6f35..331f6ca66 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1402,7 +1402,7 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE 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 a 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 nothning else but that file. All validations were successfull.' }); continue } diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 53710724b..374c6f5f5 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -1,7 +1,7 @@ { "type": "User Profile", "name": "Luis-Fernando-Molina", - "config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"Luis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n },\n \"codeName\": \"Luis-Fernando-Molina\"\n}", + "config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"XXXLuis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n },\n \"codeName\": \"Luis-Fernando-Molina\"\n}", "project": "Governance", "tokenPowerSwitch": { "type": "Token Power Switch", From 7f23ed50f6193efdafb0827edc16a09780f8ffcb Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 15:33:27 +0200 Subject: [PATCH 21/39] Governance Update Testing gov.prs 13 --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 374c6f5f5..73d2f4ac7 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -1,7 +1,7 @@ { "type": "User Profile", "name": "Luis-Fernando-Molina", - "config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"XXXLuis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n },\n \"codeName\": \"Luis-Fernando-Molina\"\n}", + "config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"XXXYYYLuis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n },\n \"codeName\": \"Luis-Fernando-Molina\"\n}", "project": "Governance", "tokenPowerSwitch": { "type": "Token Power Switch", From 5cb1e63e69dbb74091f6a4ec92aac70a8540b6fa Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 15:36:35 +0200 Subject: [PATCH 22/39] Governance Update Testing gov.prs 14 --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 73d2f4ac7..53710724b 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -1,7 +1,7 @@ { "type": "User Profile", "name": "Luis-Fernando-Molina", - "config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"XXXYYYLuis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n },\n \"codeName\": \"Luis-Fernando-Molina\"\n}", + "config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"Luis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n },\n \"codeName\": \"Luis-Fernando-Molina\"\n}", "project": "Governance", "tokenPowerSwitch": { "type": "Token Power Switch", From 8f2caba4a5a51448730c77ac1e7db5ed47999318 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 17:46:29 +0200 Subject: [PATCH 23/39] Governance Update Testing gov.prs 15 --- Client/httpInterface.js | 35 ++++++++++++++++--- .../User-Profiles/Luis-Fernando-Molina.json | 2 +- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 331f6ca66..b93c97662 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1328,6 +1328,31 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE */ if (listResponse.data.length !== 1) { console.log('[INFO] httpInterface -> Gov -> mergeGithubPullRequests -> Validation #1 Failed -> Pull Request "' + pullRequest.title + '" not merged because it contains more than 1 file. -> fileCount = ' + listResponse.data.length) + /* + We will close PRs that contains any User Profile file together with other files in the same Pull Request. + This will avoid manual merges to include User Profile files. + */ + for (j = 0; j < listResponse.data.length; j++) { + let pullRequestFile = listResponse.data[j] + if (pullRequestFile.indexOf('Governance/Plugins/User-Profiles') >= 0) { + await sleep(GITHUB_API_WAITING_TIME) + await octokit.rest.issues.createComment({ + 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 "' + pullRequestFile + '" was submitted it together with ' + listResponse.data.length + ' other files. 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) + await octokit.rest.pulls.update({ + owner: owner, + repo: repo, + pull_number: pullRequest.number, + state: 'closed' + }); + break + } + } continue } let pullRequestFile = listResponse.data[0] @@ -1363,14 +1388,14 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE let messageSigned = config.signature.message if (messageSigned !== githubUsername) { console.log('[INFO] httpInterface -> Gov -> 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 sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ owner: owner, repo: repo, issue_number: pullRequest.number, - body: 'This Pull Request could not be automatically merged by the Superalgos Governance System because it was detected that the Github User " ' + githubUsername + '" who submitted it, is not equal to the Message Signed at the User Profile. messageSigned = "' + messageSigned + '"' - }); + body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that the Github User "' + githubUsername + '" who submitted it, is not equal to the Message Signed at the User Profile. messageSigned = "' + messageSigned + '"' + }); await sleep(GITHUB_API_WAITING_TIME) await octokit.rest.pulls.update({ @@ -1402,8 +1427,8 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE 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 nothning else but that file. All validations were successfull.' + }); continue } } diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 53710724b..6a96f898c 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -137,7 +137,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": true, + "isCollapsed": false, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 From c7488b91554448aabb8fd2d08874879546737d27 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 17:54:01 +0200 Subject: [PATCH 24/39] Governance Update Testing gov.prs 16 --- Client/httpInterface.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index b93c97662..e6623b2be 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1334,13 +1334,14 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE */ for (j = 0; j < listResponse.data.length; j++) { let pullRequestFile = listResponse.data[j] - if (pullRequestFile.indexOf('Governance/Plugins/User-Profiles') >= 0) { + let fileContentUrl = pullRequestFile.raw_url + if (fileContentUrl.indexOf('Governance/Plugins/User-Profiles') >= 0) { await sleep(GITHUB_API_WAITING_TIME) await octokit.rest.issues.createComment({ 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 "' + pullRequestFile + '" was submitted it together with ' + listResponse.data.length + ' other files. 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) From e7cd1702cc0d6006d6aaaa8ce3095d4468d5331a Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:00:57 +0200 Subject: [PATCH 25/39] Governance Update Testing gov.prs 17 --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 6a96f898c..53710724b 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -137,7 +137,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": false, + "isCollapsed": true, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 From c40f42579790f5ce73547b398bd1e5586a67711c Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:02:42 +0200 Subject: [PATCH 26/39] Governance Update Testing gov.prs 18 --- .../Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 53710724b..6a96f898c 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -137,7 +137,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": true, + "isCollapsed": false, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 From c990670bbbfafa1cdb27eaf0b38cda8c9c0ddb95 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:05:29 +0200 Subject: [PATCH 27/39] Changes in Marina User Profile --- .../Plugins/User-Profiles/MarinitaMarina.json | 180 +----------------- 1 file changed, 1 insertion(+), 179 deletions(-) diff --git a/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json b/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json index 9d0159c15..99b9cd2dc 100644 --- a/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json +++ b/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json @@ -9,184 +9,6 @@ "config": "{}", "project": "Governance", "tokenPowerSwitch": [], - "githubProgram": { - "type": "Github Program", - "name": "New Github Program", - "config": "{}", - "project": "Governance", - "tokensAwarded": { - "type": "Tokens Awarded", - "name": "New Tokens Awarded", - "project": "Governance", - "id": "3c7c14f1-ff7a-4d50-9178-5887e35d3c96", - "savedPayload": { - "position": { - "x": 13875, - "y": 26618.115242270665 - }, - "targetPosition": { - "x": 13725, - "y": 26358.307621135333 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - } - } - }, - "id": "4064a67f-7169-476b-a3fc-1265482099d3", - "savedPayload": { - "position": { - "x": 13725, - "y": 26358.307621135333 - }, - "targetPosition": { - "x": 13575, - "y": 26098.5 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - } - } - }, - "referralProgram": { - "type": "Referral Program", - "name": "New Referral Program", - "config": "{}", - "project": "Governance", - "userReferrers": [ - { - "type": "User Referrer", - "name": "Luis-Fernando-Molina", - "config": "{}", - "project": "Governance", - "id": "299528a7-3d40-4818-a4c3-43c70ced1d77", - "savedPayload": { - "position": { - "x": 13502.645713530756, - "y": 26648.085369022054 - }, - "targetPosition": { - "x": 13425, - "y": 26358.307621135333 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - }, - "referenceParent": { - "type": "User Profile", - "name": "Luis-Fernando-Molina", - "id": "148911b3-b2f3-44fb-8cb4-017991789132" - }, - "referenceParentCombinedNodePath": [ - [ - "Luis-Fernando-Molina", - "User Profile" - ] - ] - } - } - ], - "tokensAwarded": { - "type": "Tokens Awarded", - "name": "New Tokens Awarded", - "project": "Governance", - "id": "f39667c5-7c43-4f8f-b97b-86f07c9b49a6", - "savedPayload": { - "position": { - "x": 13275, - "y": 26618.115242270665 - }, - "targetPosition": { - "x": 13425, - "y": 26358.307621135333 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - } - } - }, - "tokensBonus": { - "type": "Tokens Bonus", - "name": "New Tokens Bonus", - "project": "Governance", - "id": "04456e5c-121f-4f34-9853-e55d2739b978", - "savedPayload": { - "position": { - "x": 13135.222252113279, - "y": 26435.95333466609 - }, - "targetPosition": { - "x": 13425, - "y": 26358.307621135333 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - } - } - }, - "id": "4db2f276-f06f-4fd5-8041-e6172efdf3a5", - "savedPayload": { - "position": { - "x": 13425, - "y": 26358.307621135333 - }, - "targetPosition": { - "x": 13575, - "y": 26098.5 - }, - "floatingObject": { - "isPinned": false, - "isFrozen": false, - "isCollapsed": false, - "angleToParent": 2, - "distanceToParent": 3, - "arrangementStyle": 0 - }, - "uiObject": { - "isRunning": false - } - } - }, "id": "eef4e172-d7db-421d-8881-9ae4dc6bd35d", "savedPayload": { "position": { @@ -250,7 +72,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": false, + "isCollapsed": true, "angleToParent": 1, "distanceToParent": 3, "arrangementStyle": 0 From 43a396e471a31a43e09d37cddb8b4dea91023dbc Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:15:35 +0200 Subject: [PATCH 28/39] Governance: Automatic Merging of PRs for User Profiles changes. --- Client/httpInterface.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index e6623b2be..2a92f8c29 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1369,6 +1369,22 @@ 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, + 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 the Github User "' + githubUsername + '" who submitted it, is not equal to the name of the User Profile Plugin File.\n\n File Name = "' + fileName + '"' + }); + + await sleep(GITHUB_API_WAITING_TIME) + await octokit.rest.pulls.update({ + owner: owner, + repo: repo, + pull_number: pullRequest.number, + state: 'closed' + }); continue } await sleep(GITHUB_API_WAITING_TIME) @@ -1395,7 +1411,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 the Github User "' + githubUsername + '" who submitted it, is not equal to the Message Signed at the User Profile. messageSigned = "' + messageSigned + '"' + body: 'This Pull Request could not be automatically merged and was closed by the Superalgos Governance System because it was detected that the Github User "' + githubUsername + '" who submitted it, is not equal to the Message Signed at the User Profile.\n\n Message Signed = "' + messageSigned + '"' }); await sleep(GITHUB_API_WAITING_TIME) From 4f56770b566c47afb4338a8a8e40fef6921a9f77 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:16:49 +0200 Subject: [PATCH 29/39] Governance: Automatic Merging of PRs for User Profiles changes. Bug Fixed. --- Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json b/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json index 99b9cd2dc..fa62ec7f5 100644 --- a/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json +++ b/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json @@ -72,7 +72,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": true, + "isCollapsed": false, "angleToParent": 1, "distanceToParent": 3, "arrangementStyle": 0 From 0f71e715e9024f6fca9ff808df6b4f917199a117 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:18:28 +0200 Subject: [PATCH 30/39] Revert "Changes in Marina User Profile" This reverts commit c990670bbbfafa1cdb27eaf0b38cda8c9c0ddb95. --- .../Plugins/User-Profiles/MarinitaMarina.json | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) diff --git a/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json b/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json index fa62ec7f5..9d0159c15 100644 --- a/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json +++ b/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json @@ -9,6 +9,184 @@ "config": "{}", "project": "Governance", "tokenPowerSwitch": [], + "githubProgram": { + "type": "Github Program", + "name": "New Github Program", + "config": "{}", + "project": "Governance", + "tokensAwarded": { + "type": "Tokens Awarded", + "name": "New Tokens Awarded", + "project": "Governance", + "id": "3c7c14f1-ff7a-4d50-9178-5887e35d3c96", + "savedPayload": { + "position": { + "x": 13875, + "y": 26618.115242270665 + }, + "targetPosition": { + "x": 13725, + "y": 26358.307621135333 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + }, + "id": "4064a67f-7169-476b-a3fc-1265482099d3", + "savedPayload": { + "position": { + "x": 13725, + "y": 26358.307621135333 + }, + "targetPosition": { + "x": 13575, + "y": 26098.5 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + }, + "referralProgram": { + "type": "Referral Program", + "name": "New Referral Program", + "config": "{}", + "project": "Governance", + "userReferrers": [ + { + "type": "User Referrer", + "name": "Luis-Fernando-Molina", + "config": "{}", + "project": "Governance", + "id": "299528a7-3d40-4818-a4c3-43c70ced1d77", + "savedPayload": { + "position": { + "x": 13502.645713530756, + "y": 26648.085369022054 + }, + "targetPosition": { + "x": 13425, + "y": 26358.307621135333 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + }, + "referenceParent": { + "type": "User Profile", + "name": "Luis-Fernando-Molina", + "id": "148911b3-b2f3-44fb-8cb4-017991789132" + }, + "referenceParentCombinedNodePath": [ + [ + "Luis-Fernando-Molina", + "User Profile" + ] + ] + } + } + ], + "tokensAwarded": { + "type": "Tokens Awarded", + "name": "New Tokens Awarded", + "project": "Governance", + "id": "f39667c5-7c43-4f8f-b97b-86f07c9b49a6", + "savedPayload": { + "position": { + "x": 13275, + "y": 26618.115242270665 + }, + "targetPosition": { + "x": 13425, + "y": 26358.307621135333 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + }, + "tokensBonus": { + "type": "Tokens Bonus", + "name": "New Tokens Bonus", + "project": "Governance", + "id": "04456e5c-121f-4f34-9853-e55d2739b978", + "savedPayload": { + "position": { + "x": 13135.222252113279, + "y": 26435.95333466609 + }, + "targetPosition": { + "x": 13425, + "y": 26358.307621135333 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + }, + "id": "4db2f276-f06f-4fd5-8041-e6172efdf3a5", + "savedPayload": { + "position": { + "x": 13425, + "y": 26358.307621135333 + }, + "targetPosition": { + "x": 13575, + "y": 26098.5 + }, + "floatingObject": { + "isPinned": false, + "isFrozen": false, + "isCollapsed": false, + "angleToParent": 2, + "distanceToParent": 3, + "arrangementStyle": 0 + }, + "uiObject": { + "isRunning": false + } + } + }, "id": "eef4e172-d7db-421d-8881-9ae4dc6bd35d", "savedPayload": { "position": { From ddf24dcc8723473140dd7990b2a22c10c7b01cb7 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:18:48 +0200 Subject: [PATCH 31/39] Revert "Governance: Automatic Merging of PRs for User Profiles changes. Bug Fixed." This reverts commit 4f56770b566c47afb4338a8a8e40fef6921a9f77. --- Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json b/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json index 9d0159c15..974350330 100644 --- a/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json +++ b/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json @@ -250,7 +250,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": false, + "isCollapsed": true, "angleToParent": 1, "distanceToParent": 3, "arrangementStyle": 0 From 23fa8cd9326610247307732693d1c1ed530eec8e Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:21:21 +0200 Subject: [PATCH 32/39] Governance: Automatic Merging of PRs for User Profiles changes. Bug Fixed. 2 --- Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json b/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json index 974350330..9d0159c15 100644 --- a/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json +++ b/Projects/Governance/Plugins/User-Profiles/MarinitaMarina.json @@ -250,7 +250,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": true, + "isCollapsed": false, "angleToParent": 1, "distanceToParent": 3, "arrangementStyle": 0 From 1ce7a69bbced80f55c398329f55c170e9dc28288 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:31:26 +0200 Subject: [PATCH 33/39] Governance: Automatic Merging of PRs for User Profiles changes. Bug Fixed.3 --- Client/httpInterface.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index 2a92f8c29..c156dcf06 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -1361,6 +1361,12 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE Validation #2: File Name must be the same to the Github Username of the PR owner. */ 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) + continue + } + let splittedURL = fileContentUrl.split('/') let fileName = splittedURL[splittedURL.length - 1] let splittedFileName = fileName.split('.') From ef859348fb2aa0f07cbb13fa791923850521acd5 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:33:25 +0200 Subject: [PATCH 34/39] Governance: Automatic Merging of PRs for User Profiles changes. Bug Fixed.4 --- Client/httpInterface.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index c156dcf06..ebf8e9ea4 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -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] From 3f13b84a79aef1eb10e0ae583ec5aea7dc4d89cf Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:35:08 +0200 Subject: [PATCH 35/39] Governance: Automatic Merging of PRs for User Profiles changes. Bug Fixed.5 --- .../Plugins/User-Profiles/Luis-Fernando-Molina.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json index 6a96f898c..245c7569a 100644 --- a/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json +++ b/Projects/Governance/Plugins/User-Profiles/Luis-Fernando-Molina.json @@ -1,7 +1,7 @@ { "type": "User Profile", "name": "Luis-Fernando-Molina", - "config": "{\n \"tokens\": 10000000,\n \"signature\": {\n \"message\": \"Luis-Fernando-Molina\",\n \"messageHash\": \"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\n \"v\": \"0x1b\",\n \"r\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\n \"s\": \"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\n \"signature\": \"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"\n },\n \"codeName\": \"Luis-Fernando-Molina\"\n}", + "config": "{\"tokens\":10000000,\"signature\":{\"message\":\"Luis-Fernando-Molina\",\"messageHash\":\"0x443abf3389e332a62d21b84dd12e271cb428d334195d3aeb986ca85ee53cccb9\",\"v\":\"0x1b\",\"r\":\"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb0\",\"s\":\"0x42abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e3\",\"signature\":\"0x90293b042c180aa21b05f0356f31688c597be4ff2df136f63a2b8a899c658eb042abf909024d34217430e42ebadc96b7834218cc86a4c295a2ae419ff2fca6e31b\"},\"codeName\":\"Luis-Fernando-Molina\"}", "project": "Governance", "tokenPowerSwitch": { "type": "Token Power Switch", @@ -137,7 +137,7 @@ "floatingObject": { "isPinned": false, "isFrozen": false, - "isCollapsed": false, + "isCollapsed": true, "angleToParent": 2, "distanceToParent": 3, "arrangementStyle": 0 From 998d630b4ba8da97edcab07abf7dfedf1397701e Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sat, 7 Aug 2021 18:39:55 +0200 Subject: [PATCH 36/39] 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 37/39] 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 38/39] 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 39/39] 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 }