The Welkin Suite Forum

Commit to Git Before Checkin



Commit to Git Before Checkin

  • Please log in to reply

#1
windows version welkinsuite

martin.vanputten

    Posted 02 Nov 2017

    I'd like to setup automatic Git commits before checking the code back into SalesForce... is this possible with a script or built in tool?



    8 replies to this topic

    #2

    vlgubanovich

      Posted 03 Nov 2017

      Hi Martin,


      Thank you for your questions - this is a really very good one :) I've started to think over writing a blog post on this topic after the Dreamforce.


      In short - yes, it is possible, but needs some kung-fu from your side.

      The Welkin Suite uses the regular "MSBuild" project descriptor file (the one with the *.sfproj extension). As well we are using the regular MSBuild to save your changes to Salesforce - just our custom targets.

      This means that you can use the full power of the MSBuild customizations and even perform an incredibly complex and custom build process!


      At a very high-level what you'll need to achieve this:

      1. In the .sfproj file for your project you'll need to change the DefaultTargets from "Build" to (let's say) "CustomBuild"
      2. In the very end of the sfproj file before the closing "Project" node - create a custom target called "CustomBuild"
      3. This "CustomBuild" should first execute the regular "Build" targetand then it should execute some other custom "AfterBuild" target
      4. Create a new "AfterBuild" target - it can execute your prepared bat (or powershell) file which will do whatever you want (or you can just execute CMD commands in the easiest case).
      5. That's it :)

      Just as an example please find the screenshot of how this might look like in the attachment to this post.

      You can also take a look at the MSDN documentation about customizing MSBuild files.


      Hope this helps!


      Thank you,

      Vladimir





      Vladimir Gubanovich
      Head of Product
       
      The Welkin Suite
      skype id: vladimir.gubanovich
      e-mail: vladimir.gubanovich@welkinsuite.com


      #3

      martin.vanputten

        Posted 03 Nov 2017

        Awesome, I was thinking exactly that along the lines on how Visual Studio uses msbuild to do pre and post scripts so this is exactly the kung fu I need. I'll try to set it up later this evening as it is Friday, otherwise over the weekend.


        Cheers.



        #4

        martin.vanputten

          Posted 20 Nov 2017

          I wanted to follow up and say this is working great on build! Now I'm trying to figure it when pulling from salesforce. From what I can tell, pulling is not using msbuild in anyway... nor the use of the project files... so I'm thinking its either a configuration or hardcoded. I'm peaking around the The Welkin Suite installation folder but if there is a way to do this please let me know :)


          Cheers.



          #5

          vlgubanovich

            Posted 20 Nov 2017

            Hi Martin,


            I'm really happy that the pre/post-build events are working for you and that you've made your life a bit easier with them :)

            You're absolutely right - our pull process doesn't use msbuild and, being honest, i don't see any ways how to automate pre/post pull actions at the moment. I believe it might be a good option for ninjas like you, so I'll add the option to configure somewhere/somehow the way to execute pre/post pull actions. I'm not sure that we'll be able to plan it directly for one of the next sprints, but I hope that we'll be able to "fit" it into them somehow :)

            Just out of curiosity - are you also going to commit before/after pulls? Or is it some other action?


            Thank you,

            Vladimir


            Vladimir Gubanovich
            Head of Product
             
            The Welkin Suite
            skype id: vladimir.gubanovich
            e-mail: vladimir.gubanovich@welkinsuite.com


            #6

            martin.vanputten

              Posted 21 Nov 2017

              For now I was thinking of committing for before/after pull. My idea was to ensure that no code is lost as it is extremely easy in using native salesforce tools for someone to completely disregard changes and wipe out code as everybody is using a different IDE. Some are using Workbench, some use eclipse, some use the older tools that are no longer supported. I've only been working with Salesforce for about a month now but bringing my knowledge of the .NET world... I thoroughly support what you are doing with The Welkin Suite and hope to convince the entire team here to migrate over. Anything you can do to make this a better experience is greatly appreciated.

              Cheers.



              #7

              vlgubanovich

                Posted 21 Nov 2017

                Hi Martin,


                Thanks for the additional details.

                I'm not sure if this might fit your case, but for automated commits during build&pull we have the Local History - it's an automated git repository, that is located in the ".localHistory" hidden folder in the project's directory. I really don't know about your case - but it might work for you to open the .localHistory repository in your Git client, and set a remote for it for your git hosting - maybe track a separate branch, for example.

                So, again - not sure if this helps you, but just FYI :)

                Additionally, If you would like I can perform a demo of the IDE for your team - general overview of favourite/coolest features or, maybe, something related to your real use cases of the IDE or, even, can show solutions for payinpoints shared by your team with their current tools. So if you'd like to - just let me know and I'll get back to you so we can discuss the demo details :)


                Thank you,

                Vladimir


                Vladimir Gubanovich
                Head of Product
                 
                The Welkin Suite
                skype id: vladimir.gubanovich
                e-mail: vladimir.gubanovich@welkinsuite.com


                #8

                martin.vanputten

                  Posted 21 Nov 2017

                  I did notice the local history.. I wasn't sure when this gets updated but if its during before pulls then that should be sufficient. I am weary about the speed it takes to retrieve the local history in the IDE. It might be my machine but I do have to wait a few minutes for it to load so I didn't look too much into it.

                  The demo would be great. We will be ultimately be looking at solutions coming early next year as as we are still wrapping up projects for the end of this year. As I'm still the new guy I get to explore a bit more which is how I came across this wonderful tool. Also, developers are split up into a few locations so demoing might be a bit tricky. I plan to at least purcahse a license for myself at the end of the trial and hopefully expense it for the time being (otherwise i suck up the cost but I become more productive in the end).



                  #9

                  vlgubanovich

                    Posted 22 Nov 2017

                    Hi Martin,


                    I've just emailed you about the demo.

                    Regarding the Local History and time for it to show up - yes, it seems it's not as fast as we'd like to, right now. We'll look in more details and will work on the performance improvements for it.

                    However, hope that it'll fit your needs and you'll find it useful!


                    Thank you,

                    Vladimir


                    Vladimir Gubanovich
                    Head of Product
                     
                    The Welkin Suite
                    skype id: vladimir.gubanovich
                    e-mail: vladimir.gubanovich@welkinsuite.com





                    Boost Your Productivity. Get Started Today

                    Try Free Trial