# Roomle Content Project Data Structure
This document is a prescription on how to keep the configurator content data in a unified and easy-to-handle way.
# GIT repository structure
The git repository name should match with the tenant. The repository should start with folders matching the catalogues in the relevant tenant account.
Following structure should be used for git content repositories:
catalogue1/ components/ product1_components.json product1_master.json ... product2_components.json product2_master.json ... materials/ textures/ rgb/ xyz/ orm/ catalogue_materials_categories.csv catalogue_materials_shaders.csv catalogue_materials_textures.csv catalogue_materials_translations.csv catalogue_materials.csv geometry/ models/ all ply, obj that are ready to be uploaded catalogue_meshes_ALL.txt catalogue_product1_meshes.txt catalogue_product2_meshes.txt items/ catalogue_items_categories.csv catalogue_items_definition.csv catalogue_items_sort.csv catalogue_items_translations.csv catalogue_product1_addons.csv catalogue_product1_categories.csv catalogue_product1_definitions.csv catalogue_startconfigs_definitions.csv catalogue_startconfigs_translations.csv dtto for product2 catalogue_categories.csv catalogue_components_translations.csv catalogue_product1_components_import.csv catalogue_product1_loadersnippet.js catalogue_product2_components_import.csv catalogue_product2_loadersnippet.js ... catalogue2/ ...
Explanation of the individual parts follow:
Keep component source files (JSONs) in the /components/ folder and the relevant CSVs outside of that folder. Use-case: Select the whole folder + a relevant uploading CSV file, zip and upload a particular product fast & easy.
This CSV file is used for the product import. Example:
"component_id","component_definition" "product1_master","zip://product1_master.json" "product1_components","zip://product1_components.json"
The files components_translations.csv, catalogue_materials_translations.csv, catalogue_items_translations.csv are used to hold the RAPI labels of the entires used for translations. Example of the items translations header for a product, which is relevant for English-speaking, German and French markets:
Categories are defined in catalogue_categories.csv with a header and labels.
Categories then should apply to materials and items in the catalogue_materials_categories.csv and catalogue_items_categories.csv files. To add categories:
To remove categories, change the tag_ids_to_add to tag_ids_to_remove:
If you want to change the categories, first remove, then add.
Use catalogue_items_sort.csv file. Add-ons and planner entries are ascendingly ordered by the value of sort. A good practice is not to use 1,2,3 as sort values, but rather 10, 20, 30, or 100, 110, 120, allowing you to add entries in between (100, 110, 115, 120, 123, 125, 130, etc.) without having to rewrite all sort values.
- Start the commit subject with the relevant JIRA ticket code
- Describe what changes in the using imperative form. Try to call the commit, so that it answers the question why there is a change or what changes, not WHAT is in the commit (because you can open it and get the answer).
- Good example:
LAD-234 create ladder steps
- Bad example:
lad 234 do cubes in for loop
- Good example:
- Add a HTTP link to the commit description.
- If you had trouble during work, it is probable that someone else also has trouble when they need to fix it. In that case, do a proper description what was difficult, what you tried and failed or why you can't use an obviously simple solution, etc.
BS-123 reorder parameters, in brach
- Avoid doing too big commits, be clear in the code. Otherwise your changes are not trackable or fixable.
- Stage only what acutally changes, do not stage debug code snippets if you don't need to (like displaying parameters, coordinate system etc.). When you review the changes (Quality Management), you won't be able to check it properly if you see too much lines with changes which are not actual changes!
- Format before you commit. However, if you start working in an unformatted state, pick only what you really change or do not format at all.
# Branch strcuture
The master branch should always mirror the RAPI status. If you make changes in the master branch, make sure that those changes get updated in the RAPI. On the other hand, if you make changes in RAPI, do not forget to update the master.
If you continue working on a project that has been on halt, always do or let a production overseer do a reinitialization of the master branch. See the chapter how to do it.
Use this branch for development. Commit merge requests from individual tickets to dev/main, which should be checked by your internal QM. The state of dev/main should be functional, no half-done work or work with known bugs should be accepted to merge into dev/main.
Use this branch as the main branch for the product or configurator project. For example, we have a product called freistil190 -> the branch is called
Each product should have its own branch (same name as the components prefix). The branch name should contain the Jira ticket code and a short, one-word description of the topic of the branch. For example:
After the relevant work for the ticket has been finished, make a MR to the products main branch.
If possible, use one of the following one word descriptions:
- 3d (change in the geometry)
- addons (adding, changing addons logic)
- dev (general development of product)
- dock (docking logic fix / specialized development)
- fix (general fix of the product)
- group (grouping change)
- label (labels, changing labels texts)
- lang (changing or adding translation)
- mats (materials)
- params (parameter logic)
- partlist (fixing articleNrs, partlist change)
- sort (change in sorting)
If none of these fits, make up your own short and descriptive suffix.
# Comparing GIT state with RAPI
To be sure that the current online state is being used, you should reinitialize the GIT repository in order to check the GIT vs. RAPI consistency. As the process of merging into master is not currently bound automatically with the upload to RAPI and vice versa, you should make a diff between master and RAPI yourself.
Normally, the master branch should be a mirror of the state that is uploaded to the RAPI. To check, whether this is true, do the following:
- create a new branch from master - call it reinit/<currentDate>
- apply formatting on all components
- make a commit called "apply formatting with v 0.4.3" (the version of your roomle formatter plugin)
- delete /components/ folder
- download components.zip from the RAPI and place the /component/ folder instead of the deleted /component/ folder
- clean all auxiliary files (incoming components.csv)
- apply formatting on all components
- make a commit called "reinitialize"
You can see the changes in the "reinitialize" commit. At the end of each project and at the start of every reopening, this reinitialization should be done to see if the GIT repository is consistent with the RAPI.
- In order to easily and quickly apply formatting on all components, select all of them in the file selector of VS Code, right click and open them to the side. Then, apply the command (Ctrl+Shift+P or Cmd+Shift+P) "Format All Open Roomle JSONs".
# Workflow during development
Start your work in the dev/main branch and make a new branch product1/JIRA-100-dev. After the development is done, do a merge request to the dev/main branch, which should be checked by your QM. When the quality of the dev, fix or change is good, open a merge request to master assigned to the production overseer of the project.