hello! Is there any documentation or "best practic...
# help
e
hello! Is there any documentation or "best practices" when having multiple reads and writes to a bucket over time. Async. What i want is: 1. Create a branch (If possible a blank branch with no history) 2. Write some data to it and performing transformations etc 3. Commit to this branch and run pre-merge-hook on it 4. Merge into main branch. For now im trying something like this in python but sometimes i get errors of dirty branches and conflicts. Can i specify merge strategy on python merge?
a
Hi Eirik, That's my favourite way to do it, too! The Python SDK is autogenerated from the Swagger API. So it supports everything in that API. Docs are also auto-generated, so they do cover merge strategy in the example. Basically just add your desired merge strategy. BUT while this may resolve "conflicts", it will not resolve "dirty branch". If you have those, you probably have uncommitted changes on a branch somewhere. Merge can only work with committed data.
o
Adding to @Ariel Shaqed (Scolnicov)’s great answer here - A common pattern with lakeFS, is to define branches which are often merged into, as protected branches. This has 2 main advantages in your scenario: 1. it ensures anything contained on the target branch has been merged from another branch, thus had to go through the pre-merge hooks 2. it disallows writing directly to a branch, leaving uncommitted changes - so by definition a protected branch cannot be "dirty". Hope this helps!
e
thanks for answer. Then im on right track. Ill check out the merge strategy choice. I found out that, as you said, that if there is a uncommited change in one of the branch its labled "dirty". Oh, protected branch i havent looked into. It will solve alot of my dirty branch problems. thanks. Thats what i was looking for
sunglasses lakefs 1
a
Good to hear. And please, let us know how it goes!
👍 1