Customer updates are gone from Local Update Set after Git commit

JennyHu
Tera Guru
Tera Guru

I'm wondering if someone can help me here.

I started working on a scoped custom application and created a couple Local Update Sets to track my changes.   Later on, I decided to give Git Source Control a try.   So I linked to source control, created a development branch and commit changes to remote.     Things are getting committed to Git fine.

However, I realize that my customer updates and sometimes even the entire Local Update Set are gone from ServiceNow after the Git commit (if I go to System Update Sets > Local Update Sets).   Is this the expected behaviour to have customer updates disappear locally?

Now say I have completed my development, and need to push my changes to staging for testing, then production.. what would the process be? Once Git integration is established, does that mean that we can no longer use Local Update Set to track changes?

I'm not too familiar with how Git works with ServiceNow yet.   If I want to switch everything back to use Update Sets, is it possible to unlink the Git integration, use the XML committed to Git, and import it back to an Update Set?

Thank you in advance for your help!

Jenny

1 ACCEPTED SOLUTION

JennyHu
Tera Guru
Tera Guru

An update on this issue... I submitted a ticket to HI, and this is the response I received:



"Thank you for your patience. I can confirm that yes, we delete the sys_update_xml records when exporting an application to source control. This is how we track if an application is dirty or not. It is expected behavior.



If you would like to use update sets to export the application, you can do so via the "Publish to update set" UI Action on the application record.



1. Go to the application:



2. Under Related Links, click 'Publish to Update Set...'"



When I asked "if the update set will capture all the changes including the ones that I committed to source control?", HI replied:



"The update set will contain the current version, the latest update, of each application file in the application.



When you have a moment, additional details can be found here,



https://docs.servicenow.com/bundle/istanbul-application-development/page/build/applications/task/t_P..."



So it does look like I can use "Publish to Update Set" feature to get all the customer updates for my custom scoped app.


View solution in original post

9 REPLIES 9

Mark Scott1
Giga Expert

Hey Jenny,


I've done a bunch of work with GIT and I haven't seen Update Sets disappear when I link it to a Scoped App. Are you talking about the Update Set that gets created when a scoped app is created or did you create a brand new update set?


Hi Mark,



I haven't been able to reproduce the disappearing update set mystery.   But I can confirm that after a Git commit (Source Control > Commit Changes), all the Customer Update records are gone from my local update set for the scoped app.   Is this the expected behaviour?



Thanks,


Jenny


I'll be honest with you Jenny, I'm not a ServiceNow team member so I can't speak to the expected behavior. It would seem odd to me that the records would be missing after a GIT commit. We've been able to commit just fine without records going missing.



To answer your question about promotion:



I know this goes against what many people at ServiceNow believe about source control but...



I don't use stashes <shocked gasp goes here/>. The way my team and I do it is like this:



  1. We create three branches in our GIT repo "DEV", "TEST" and "MASTER".
  2. When we are happy with our changes we commit to DEV. When we are ready for testing, we use a third party tool called "SourceTree" (really any GIT tool that supports merging will work) to MERGE the DEV branch to the TEST branch.
  3. In the Scoped App on our test instance, we pick "Apply Remote Changes".
  4. When testing has given us the green light, we go ahead and merge the TEST branch into the MASTER branch.
  5. On Prod, in the sciped app, we click the "Apply Remote Changes"


PLEASE NOTE: WE NEVER MAKE CHANGES TO THE TEST OR MASTER BRANCH DIRECTLY!!!



I gave a talk about this at Knowledge 17 called "Source Control and Client Separation" if you need my slide deck, let me know. I've also written about this on my blog https://snstud.io/using-git-servicenow/   or you can message me directly!



If you wanted to go back to update sets, you could add all the changes to an Update Set (this will be done outside of Studio) but it would be a manual process. You can't just take the XML from the GIT check in and create an update set.


Hi Mark,



Thanks for your reply!   Just to clarify, I did not use stash as well and commit directly to Git after making some change to my scoped app.



The record change/update itself is still there in ServiceNow, but the Customer Update record disappeared!  



This is what I did:



1. Create a local update set for my scoped application


2. Link to Source Control from Studio


3. Create a dev branch from Studio


4. Make some changes to my scoped application



At this point, I can see the customer update record in my local update set



5. Go to Studio and Source Control -> Commit Changes



After step 5, the customer update record is no longer in my local update set!  


Is there a step I'm missing or something I'm doing wrong?



Thanks,


Jenny