Daniel Draes
ServiceNow Employee
ServiceNow Employee

So you are using Source Control and have embarked on using GitHub for more than just storing applications. You are committing changes regularly and ask your developers to use meaningful comments when committing these, maybe you even use the GitHub Webhook to parse the comment and link it to Stories in your SDLC module.

This is all great and supports a more modern development and collaboration flow. Based on some interactions I had with customers like yours I was thinking about how to improve it further. This blog is to start a - non ServiceNow owned and maintained - extension to our GitHub Spoke with additional functionality which can be helpful when you are using a GitHub based source control integration.

Added features:

Create Tag Action

When you publish an application from Studio IDE to the ServiceNow Application Repository it will automatically tag the linked source repository with the version published. If you do that though using the CI/CD spoke actions, there is no tagging. In order to keep my repositories in sync with the versioning in the instance I have added a Create Tag action to my flow. The action relatively simple but helps greatly to keep my instance synchronized, it takes the repository, new tag and the needed SHA as input to do its work:

 

find_real_file.png

 

Git Commits Remote Table

On every file / artifact we can modify in ServiceNow the instance will keep a version history, this is great for looking back and comparing version when something goes wrong. In the old world (non-source-control) each of these versions would have a linked update set which probably would help the developer to figure why this object was changed by the means of naming conventions. Not so anymore when using Source Control - our changes are tracked there with commit messages. The Remote Table will use the Git API to find commits for a given file and present the information back to the user incl. Commit Message, Author and SHA's. With that at least it is much simpler to see who changed it and maybe why.

Here is a screenshot how this can look like:

find_real_file.png

Note: It works but has some formatting issues still like the date/time is not correctly parsed. Timezone issue between the GitHub date and our servers. Should be simple to fix, just need some extra time to work on this again 😄

How can I get it / help?

I pushed the code behind this into a public git repository - feel free to fork it, check it out and supply new pieced to it via Pull Requests. Maybe this even finds an owner in the community to take it further?

As a word of caution, this is implemented as an extension / customization to the baseline GitHub Spoke. So

  • You need the GitHub Spoke installed before installing this one
  • If you have already a GitHub Spoke Customization it probably fails installing
  • This is **NOT** production ready code, more an example of what you can do
  • It requires IntegrationHub subscriptions as it is based on GitHub APIs which we call, each call will be counted against your transaction volume

With this disclaimer, I would advise you test this on a PDI from Developer program. If you like it - or parts of it - reapply the necessary bits in your development instance manually to avoid any collisions.

Let me know how you like this or what else you think would be a great feature to add.