Better Git conflicts + commit history (launched)

Conrad Slimmer · Friday Demos · June 28, 2024 · 7:13

More improvements to the git integration to better handle conflicts between imported changes and activity in the app via commit history.

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. um I can follow that up I guess so let me try and share all right so I've been working on some Polish around the git integration so last week it's great people have started using it and so we're starting to hear about the things that don't work the way people want uh last week somebody ran into something with where they modified the git repo outside of uh Omni and so Omni didn't know about this new commit and then they merged that PR uh and Omni kind of fell on its face and didn't didn't do what what you would want it to do namely know pick up that change or or something so last week we added um a thing that'll basically a web hook that

  2. detects when a branch with an open PR gets pushed to gets committed to on the remote and uh let's see oh I spelled that really well um and so it will last week all we did was we started just overwriting that with putting it back to a known state which I'm sure people love uh and I'll show you that behavior because it's also part of the existing behavior and kind of one of the limit the new behavior and and one of the limitations that that we have to deal with there so you know here I go I've got this I've opened the pr I created a label that's all that changed and then I'm I'm going to just you know change this here locally just

  3. to show that behavior avior um but I'm not going to update the pull request so this change only exists in Omni uh I'm GNA come back into my open poll request just to you know show you that get doesn't know anything about the change I just made uh and then I'm going to make a change directly in git um and we're going to blow this change away uh because we don't know about it so what are we supposed to do with it so commit that change that's triggers a synchronized web hook event we can see the change but if we wait a minute oh look it wants me to refresh uh because I the web hook saw that and said I don't know about this

  4. and it committed another change that basically got rid of that if we go look in the commit history um you can see that we've got this web hook synchronized pull request uh commit that I just made and the detail message is look I can't save externally committed edits when the local on the edits are ahead of git uh obviously we can change these automated messages but uh you get the idea let's jump back into our um on me and we'll update the poll request so uh go ahead and do that if we go back to our poll request and go to files changed um you'll see that you know now my change has been pushed up uh but you know I really actually so now

  5. we're in sync right I don't like the label that this person uh gave it so I'm going to go ahead and give a cool label uh to this field and I'll commit this change this should sync to Omni go ahead and commit that and obviously I'm doing this through the GitHub UI but in theory you know you could be working in VI and committing and pushing to this brain so completely divorced from GitHub uh and we'll wait around for a second but uh you can see that I'm not actually pushing up an overwrite commit in this case and uh if we come back to uh Omni and refresh because you know I this browser session doesn't know there's a change you can see that we

  6. just edited Omni model outside of omy through git and using this or request synchronize event and uh I'm amazed that this worked because I was fixing bugs right up to the last minute but uh I think I think we're good and and hopefully this will go live sometime next week that's awesome and con there's no limitation on what you can do inside the uh externally let's call it I mean the limitation is that it has to be valid on the yaml so if you write invalid yaml or you you know do some something that basically if you did it in the editor we would reject it and say hey I don't understand that parameter or you know this is supposed to be a list not

  7. a a dictionary um then we will overwrite those commits uh I mean if you want I could I already stopped my screen share but basically we'll overwrite that commit and give them give the same message to the user about what's wrong with their yaml will be part of the the commit message so that they can be like oh yeah I see I need to go fix this thing and I can do it again it's a little weird but it's actually kind of clever that like the get commit message sort of becomes your like debug log there for your a it is there's also some debug going into the the web hook history um in GitHub so we give some message around what we do there

  8. but honestly the commit log's almost better yeah yeah I see this also like as a as a a stepping stone to you know other ways to interface with the Omni model or or modify the Omni model uh outside of of omni and potentially you know outside of git even right you can imagine using the same sort of mechanism to um to to save models via an API or something along those lines