Tutorial

Working with Multiple Workspace Templates (Versions)


Version control is crucial because it keeps track of what changes were made in the past and allows you to revert releases for disaster recovery. GoodData.CN allows you to create versions of layouts from workspaces without keeping the workspaces you do not actively use. In this article, we are going to explore how to one option that users can take for version management in order to:

  1. Keep track of layouts of different development versions

  2. Revert the change to the previous version for disaster recovery

Toward the end of the article, you would be able to keep all layouts from different development versions without keeping workspaces you do not actively use in GoodData.CN.

 

Let’s pretend we are an e-commerce company, and I am going to develop dashboards for the analysts in the company. At each development stage, I will make changes according to the feedback from the analysts until the dashboards meet their requirements. Therefore, I am expecting to make multiple workspaces until the dashboards are rolled out for production. The first step is to create an empty workspace in GoodData.CN for the master workspace and I will name it “Master v1”. Then, I publish the LDM and develop the dashboards in this master workspace. My final dashboards in “Master v1” and looks like these in Diagram 1 and Diagram 2:

 

1Xri4GG305tDS9xrzzTd84uu6ICj61mfbZoKyjq7UGe65FlxDjtSClYx46Tf_GcQwKxh5csJCNXcyuootTFqVo7xe8CMsYRaQxRz8GFCcW1BGHdTxAVIm3S55Sif_nLTE5PYLHB_

Diagram 1: Master v1 1.Overview

 

_7kwajqCqaHPlmYyum688PTqx9AQWHdW6dufLaewfzptc0qUEyb3Le9aSwDZIxiZuqRschmOsJwV1rDhMS50lJEa-zOJ8KmUNc0wexezrD4_j6cacUga7txB9dIx-OjeR5Bmocja

Diagram 2: Master v1 2. Product Details

 

Once I finish developing the template in “Master v1”, I would like to distribute it for analysts to review. As feedback, the analysts would like me to add a dashboard about outdoor sales. To accomplish this, I need to create another workspace version to display the analysts’ needs. I can import the “Master v1” layout to a new empty workspace and make the changes requested. To do this, I would have to pull the layout from the “Master v1” workspace with this API call in the  command line:

 

curl http://localhost:3000/api/layout/workspaces/<workspace_id> \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer <token>" \
-o masterv1_layout.json

 

This API call allows me to obtain the layout metadata of the “Master v1”  workspace and save it to “masterv1_layout.json” (You may save with other names, but we will name it “masterv1_layout.json” to keep track of the layout versioning). If you import this JSON file to another workspace, it will recover the LDM, dashboards, and other elements accordingly so that you will have a workspace identical to “Master v1”. The next step is to create a new workspace and import this JSON file through the following API call in the command line:

 

curl http://localhost:3000/api/layout/workspaces/<workspace_id> \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <token>" \
  -X PUT \
  -d @masterv1_layout.json

 

Note: Remember to include “@” before the layout file

After the metadata is imported, I am ready to make my changes from the analyst feedback (you’ll notice I have the same “1. Overview” and “2.Product Details” like “Master v1” with a new dashboard “3.Outdoor”):

 

GrKEXcyky-RCcqJ6J-ovKgyvC4lW34Q4OmKO4wnIBUo6XLeKdN-OXnUoHRdTPO9BjkYaIiuGianhSoZPxQLUokHC3NKC9WiNHwLbwzckNbzFa7se5LO8ITpef0Cwb04phXIW5dYU

Diagram 3: Master v2 3. Outdoor

 

After meeting with the analysts for the second time, the analysts were not satisfied with “3. Outdoor''. They asked to drop this dashboard but keep the “Outdoor Revenue by Region” chart and replace it with the list in the “2. Product Details'' dashboard. To accommodate this, I would create a new version. Like creating Master v2, I export the layout of Master v2 and save it as masterv2_layout.json and import it to a new workspace, “Master v3” and edit the dashboards accordingly to the analysts’ request, and save masterv3_layout.json for the record. The workspace of “Master v3” will look like the following dashboards in Diagram 4 and Diagram 5:


 

v4GIHIxSGeBmgjOixgv09yzZNV1x3-KXsKparBKpawfRkq94BfwcpjMIK6rpBOQHIB3ldjXqJjzUqBP8eeSj28hZNXO5w5bMelPtZa1SdhGyhuiff7K1cUMMPuKarwOaXRuJcUh7

Diagram 4: Master v3 1. Overview

 

fv3M0sHJjS1mjXcpU_-RgSStJaRUWUAJF_-S_qldG6u-lbsiPhreU58_8WdR5Pe9FS9NhEbaD8CnW7E36WJ55cXvzcDYGpVaTSHE1eOhyfRuWDTSueEQYdCqUuaWJc19NPPvdhQp

Diagram 5: Master v3 2. Product Detail

 

The analysts were satisfied with the layout of Master v3, so now we can move this workspace to the testing phase. Simply import masterv3_layout.json to an empty workspace (Let’s call this workspace Testing v1). Once the dashboards pass the testing phase, we can release the dashboards to the analysts for production. We would roll out the dashboards according to masterv3_layout.json to the analysts on GoodData.CN. 

 

Up to this point, I have 5 workspaces related to this data product. 

 

CuEfY_ym3Tj6iEsOGipFKjhgVRiGqTDqfmKrjzt51cI4DHbMQbG-dqHbMK0hCjIE6P8zuK_XzbbqylLrThrl_mwkw5rJByXs3K8JnV4UwX-J_1BbE0TgdwGX9cLIVt_f5TKXOOrY

Diagram 6: Workspaces on my GoodData.CN

 

In case you do not want to have too many workspaces in your GoodData.CN, you can first export all the layouts of the workspaces you wish to delete. In our case, let’s say we want to delete “Master v1”, “Master v2”, “Master v3”, and “Testing v1”: We would first export the layout to JSON files and store those in one folder and delete the workspaces afterward. Although the workspaces are deleted, you saved the metadata of those versions in JSON and may be retrieved anytime you want.

FtZXzze-Ni3mhoPBn-ZHmGupRXAvFoUu_YDZsjOEUIu1zu2sHg42tdeq9ErfJsp_A2RX0PviH2jgCWUrjxYXKOSR3UDPD2PyToxA4Qb065ADREhJmXOA3p7Kgn6m5dk0TFUQTUj5

Diagram 7: Save all of your layouts in one place

 

5m4kw9f5J1BfWPrART_Yx9cu7v-Ilj05h-CL2masZSWR4mmW5io6cK1fbIbr0NVCbL0PUfsKzlSdeFkMemM4zhdfhCXk0Dm4nOf5jCcC6qjm60g62aBREW6Lb8WvyjBwD8h7cAxk
Diagram 8: GoodData.CN after deleting Master v1,2,3, and Testing v1


 

GoodData.CN provides you an option of keeping the layout of all workspaces you have created but not having all workspaces in GoodData.CN. In our case, we may only keep “Analyst v1” in GoodData.CN and delete the rest of the related workspaces. By doing that, you do not need to keep the inactive workspaces you do not need. Simply save those layouts in JSON files in one place and keep the workspaces you need on GoodData.CN. If you are interested in saving all JSON files on git, you may check out another article on GoodData.CN: Saving Layouts on Git.

 


0 replies

Be the first to reply!

Reply