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:



Diagram 1: Master v1 1.Overview



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”):



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:



Diagram 4: Master v3 1. Overview



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. 



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.


Diagram 7: Save all of your layouts in one place


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!