Working on the same prismic page in multiple branches

Hello team!

We have been running into issues multiple time now after starting to use slice machine so I would like som advise on best practice and workflow.

So we are using prismic for translations, having two languages currently and having all of our page content stored in prismic.
We started working with slice machine a while back when we started a new prismic container for a new page that we were building.

So our workflow is as follows. One developer starts working on a new subpage of our site and then starting up slicemachine and creating a new page type for adding translations.
This page is taking a while and the developer is continuously adding new translations as he/she develops. Since we want to work with the translations to see how it looks, we push to prismic and add the translations as we go along. The first version of the page is done and pushed to development branch.
Everything is fine as of now.
Let's now say that two new developers start working on different features of this new subpage.
One developer needs to add some more translations so he/she opens slicemachine and adds new types and pushes to prismic and adds the content there.
The second developer realises that he/she also needs to add new translations to prismic so he/she does the same. When the second developer pushes to prismic (since he/she does have the updated type file for the slicemachine page) and the first developers new translations and types are now gone from prismic.
Let's say that the first developer had added a slice with data for a product that we are selling and created 100 of theses products. Loosing all that data is very frustrating and takes a lot of time to add again.

This can happen in multiple ways, say that we push something from develop to prod with types and translations added to prismic, but now a new developer starts working on a new feature and forgets to pull from the develop branch and then creates a new type in slicemachine and pushes to prismic, now the old translations that are already in production are lost since the type file has changed and has been push to prismic which will cause the page to look bad and even crash if not coded correctly.

So my question is as follows: Did you take this workflow into consideration when creating slice machine and is there a prefered way of working when multiple developers work on the same prismic instance at the same time. Is it possible to somehow backup the prismic data or have it stored somewhere until the type for the translation is pushed back to prismic?

best regards,

Hey sebastian,

I'd say this is a problem you would have with any git based system where you need to publish version controlled data when you don't the right internal workflow/communication.

Have you thought about creating tickets for each custom type/slice and assigning that ticket to someone? then no one else would be able to work on it till that ticket is handed over/completed.

Hi @tech9, thanks for sharing your use case.
@jake's description is very accurate. There is no option to limit who modifies the Custom Type models in a repository that uses Slice Machine. If in dev has access to the project code and repository, it is possible to change everything.

The git version control must go hand in hand with a good communication system between the teams. Doing code reviews is necessary so that these types of errors do not exist.

1 Like