---
title: "Solving a bug in Control Panel and uploading it to Github"
canonical: "https://onesaitplatform.refined.site/space/DOCT/2220815350/Solving%20a%20bug%20in%20Control%20Panel%20and%20uploading%20it%20to%20Github"
format: markdown
---
In this tutorial, we'll describe the process to solve a bug in the Platform's open-source version's Control Panel.

These are the steps:

1. Build the Platform's Development Environment in your machine.
2. Platform repo fork.
3. Clone your Repository in the Development Environment.
4. Initialize the platform in your PC.
5. Solve the bug in the Control Panel.
6. Create Pull Request in platform's Github.

## 1. Build the Platform's Development Environment in your machine

The platform's development environment offers you all the needed tools to develop on the platform without installing anything. It includes a Java JVM, aN Eclipse IDE, Maven, a Mongo instance as the RealTimeDB, a ConfigDB on MySQL, the git client, ...

This step is not mandatory, but it simplifies the initial configuration process. That's why we strongly recommend its use.

Development Environment for Linux and Windows are offered. We'll see next how you can install the Windows environment:

1. Download the [Windows environment for here.](http://sofia2.org/downloads/onesaitPlatform_DevEnv_Win_(31072018).zip) The environment is distributed as a ZIP file.
2. Uncompress the ZIP in some directory (we recommend **C:\OP_ENV\ **or **D:\OP_ENV)**, the password to uncompress is "sofia2".
3. Go to the directory where the ZIP is uncompressed and run **start.bat**. This create virtual unit **S:**
4. (If you are accessing the Internet through a proxy):
  1. Edit **S:\scripts\setenv.bat** and configure the proxy's values at **JAVA_OPTS:**> Macro (inline-media-image)
  2. Open **S:\tools\maven\conf\settings.xml** and edit the proxy option (server, protocolo, username, password):

![image](media://21b81ad5-9721-4bf2-8282-c6a515b0376b)

After this steps you will have the Platform's Development Environment ready to work, now you need the Platform repository.

## 2. Platform repo fork

1. The easiest way to fork the platform is loggin in [https://github.com](https://github.com) with your user.
2. Once there, look for the **onesait-cloud-platform** repo:

![image](media://52912177-b708-4e06-b920-68341271e8fc)

or go directly to [https://github.com/onesaitplatform/onesait-cloud-platform](https://github.com/onesaitplatform/onesait-cloud-platform)

3. From there, select the **Fork** button:

![image](media://338192af-3bc5-48e8-83ed-ab822cc8ee0f)

Having done this, if you browse to your profile, you'll see the repository fork:

![image](media://631fc16e-38d3-47c2-ba58-914962bda65d)

## 3. Clone your Repository in the Development Environment

Once you've forked the repository to your Github user, you can clone this repo locally. To do this, use the Development Environment you installed in Step 1.

1. If you have created unit S:, launch **S:\start.bat**.  Otherwise, go to the directory where you uncompressed the environment (e.g. **C:\OP_ENV\**) and run **start.bat. **This will open a command line aiming at S:> Macro (inline-media-image)

> Macro (inline-media-image)
2. To clone the repository go to **S:\sources** and do:
  <span style="color: #0000ff">git clone</span><span style="color: #0000ff"> </span>[<span style="color: #0000ff">https://github.com/</span>](https://github.com/lmgracia/onesait-cloud-platform)<span style="color: #0000ff">**[<your_github_name>](https://github.com/lmgracia/onesait-cloud-platform)**</span>[<span style="color: #0000ff">/onesait-cloud-platform</span>](https://github.com/lmgracia/onesait-cloud-platform)<span style="color: #0000ff">   (</span><span style="color: #0000ff">#</span><span style="color: #0000ff"> </span><span style="color: #0000ff">Replace <your_github_name> with your GitHub profile name).</span>
3. Then go to onesait-cloud-platform (<span style="color: #0000ff">cd</span><span style="color: #0000ff"> </span><span style="color: #0000ff">onesait-cloud-platform</span>), and do the next command to make <span style="color: #24292e">your </span>**upstream**<span style="color: #24292e"> aims at</span><span style="color: #24292e"> </span>**<span style="color: #24292e">onesaitplatform</span>****/onesait-cloud-tplatform**<span style="color: #24292e">:</span>
  <span style="color: #0000ff">git remote add upstream </span>[<span style="color: #0000ff">https://github.com/onesaitplatform/onesait-cloud-platform.git</span>](https://github.com/onesaitplatform/onesait-cloud-platform.git)<span style="color: #0000ff"> </span>
  
4. <span style="color: #000000">In this example, we want to solve an existing bug in the Platform's Control Panel on the Master branch (In a different scenario, you may be interested in working on a specific release</span><span style="color: #000000">).</span>> Macro (inline-media-image)


## 4. Initialize the platform in your PC

Before you start solving the detected bug, you must initially the platform locally, that is to say, execute the base modules you are going to need and load the master data. To do this:

1. Firstly compile the platform. To do this, from the directory where you downloaded the source code, go to the **sources** folder and run: <span style="color: #0000ff">mvn.cmd -Dmaven.test.skip=true clean install</span>
2. Once the code is compiled, launch the Platform's ConfigDB. By default, a MySQL instance included in the development environment will be used. Launch **S****:\scripts\ConfigDB_start.bat.** > Macro (inline-media-image)

> Macro (inline-media-image)
3. To check whether the ConfigDB started or not, launch a client with this command: **S:\scripts\ConfigDB_browser.bat**** **(with server host localhost, port 3306, username root and password changeIt!)

![image](media://20f73b39-8373-4e70-ba29-3b5efad6b20a)

and create the **onesaitplatform_config** schema:

![image](media://0637e3f2-3e62-4066-9213-9a4db27eb3d9)


4.Afterwards, launch the RealTimeDB. In the platform's reference implementation it's MongoDB. To do this, execute the command **s:\scripts\RTDB_start.bat**

> Macro (inline-media-image)

> Macro (inline-media-image)



5.The next point is initializing the tables and the platform's repositories' master data (ConfigDB and RealTimeDB). To do this, browse in the **sources** folder to **modules/config-init/** , then execute the **config-init module **with the command:

<span style="color: #0000ff">mvn spring-boot:run</span>

If everything's OK, you can see that the tables and data have bene created in the ConfigDB:

![image](media://888ad25a-c07a-44c5-bfdd-a2172edc3e41)

Now you have the environment ready to work!

## 5. Solve the bug in the Control Panel

Once the platform is initialized, you can get on with your business of solving the bug. To do it, load the project in the Eclipse IDE that's provided with the platform.

1. Launch Eclipse from **s:\scripts\eclipse.bat**
2. The first time Eclipse opens, you must check:
  1. In File>Switch Workspace, make sure you are using workspace *S:\tools\eclipse_workspace*
  2. In Windows>Preferences>Java>Installed JRES, select *s:\tools\jdk* and select as the default option JRE.
  3. In Windows>Preferences>Maven>User Settings, select s:\tools\maven\conf\settings.xml
    - > Macro (inline-media-image)
  4. In Windows>Preferences>General>Network Connections, check that you have configured your proxy correctly.
  5. In File>Import>Maven>Existing MavenProjects into Workspace, select Root Directory *S:\sources\onesait-platform\onesait-cloud-platform* and import all projects.


3. Now you can load the **control-panel **Maven project. To do it, select **File>Import>Existing Maven Projects> **, then select the project path (In this case s:\sources\github\onesait-cloud-platform\sources\modules\control-panel\):

![image](media://00c47e47-09c3-4eb6-9eb3-e38df173d3d5)

4. After a while, Eclipse will have compiled the project. If you get this error:

![image](media://834256b7-7969-4e42-a47b-ea458ea17090)

the most easiest is to ignore this error with the next configuration:

![image](media://f064d5b1-af65-41ee-9075-d549ae2efd3d)

5. Once you have compiled the project, to execute it, firstly you have to launch the databases:

- Start **ConfigDB** with **S:\scripts\ConfigDB_start.bat** (if everything is OK, you will have an open command line with ConfigDB):
- Start **RealTime Database with S:\scripts\RTDB_start.bat **(if everything is OK, you will have an open command line with RealTimeDB)
- Start **RealTime Database SQL-Service** with the command **S:\scripts\RTDB_HTTPServer_start.bat**

Then simply go to the **ControlPanelWebApplication **class and select **Debug As>Java Application**

> Macro (inline-media-image)

> Macro (inline-media-image)



After a few seconds, you'll see this in the Eclipse console:

![image](media://3beacefc-384c-42bb-8da5-d27409738b09)

which means the module has started on port 18000.

If you go to [http://localhost:18000/controlpanel/](http://localhost:18000/controlpanel/) with a browser, you'll see the application:

![image](media://92c50c46-a554-4be5-818e-50669bce8abc)

If you select  > Macro (inline-media-image)

, you can create an user for tests, such as:

![image](media://7c260b2d-9807-4ce9-af86-9a0475aad8e6)

6. Now you can start solving the bug. For this example we only want to add an accent to a text missing it. To do this, go the the file i18n for Spanish language:**messages_es.properties **

![image](media://77304a5a-66d9-410e-b513-5b2999655ecf)

If you go to the line on** json2ont.toolimport.title** , you detect the problem, so you can add the accent to the word "importación".

![image](media://c219b10e-91fd-4f40-a858-d827b00aa55f)

7. When you've edited the file you can change the language in the ControlPanel and check that the text is correctly shown.

![image](media://b399b704-3e3f-43b9-a7c5-371effb12f63)

8. Once you've checked that the bug is solved, do a push **(We recommend that a Pull Request has one single commit and push****):**

`git fetch upstream`

`git add *`

`git commit`

`git push`

<span style="color: #000000">If everything went fine, finally the push from your local repo to your gihub repository has been done</span><span style="color: #000000">:</span>

![image](media://1fed9eb9-f95a-4200-a4ab-d200ab02becc)

## 6. Create Pull Request in platform's Github

1. Once the bug is solved, go to the platform's github [https://github.com/onesaitplatform/onesait-cloud-platform](https://github.com/onesaitplatform/onesait-cloud-platform)) and create a Pull Request:

> Macro (inline-media-image)

> Macro (inline-media-image)



2. Select > Macro (inline-media-image)

then specify that you want to merge your repo's branch master to the platform's one:

![image](media://7e0572db-4394-4739-a4ba-044d43ae952f)

As there are no conflicts, you're allowed an automatic merge.

![image](media://33c79d26-21cf-4479-8284-15029fc801dc)

so select > Macro (inline-media-image)




Finally the Pull Request has been created, and a Platform's GateKeeper can accept it:

![image](media://0213d527-3683-4182-9e08-b5430ff6b038)