Some questions about now-sdk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 11:46 PM
Hi,
I am a rather pro-code oriented application developer, and I am experimenting with implementation via now-sdk on behalf of my company. To contextualize, I am working on the implementation of a REST API deployed in ServiceNow. This API contains model transformation logics (between those described in OpenAPI and ServiceNow internal models) that I want to unit test to detect possible regressions as early as possible.
After several weeks of experimenting, I have some questions and observations that I can't find the answers to that I would like to ask you.
1. package.json version
I notice that if I deploy an application in a specific version (located in my package.json descriptor), any other deployment on this version does not propagate my changes, even using the "--reinstall true" option of the CLI. Is this a limitation of the SDK (to force the increment of the version of the package.json) or of the instance setting? Used to the rolling deployment, this mechanism is slightly irritating.
2. update set management
Under the hood, the SDK will generate update sets. How are they handled on the ServiceNow side? Is there a naming logic? Where can I find documentation on this (the SDK documentation doesn't mention anything about the transformation applied by the CLI during deployment, and what this actually produces in the ServiceNow instance). In practice, I end up with update sets named "Default XX", with XX incrementing with each deployment.
3. history
When I view the details of my enterprise application, I see a lot of versions logged in the instance. I already manage the logged version of my source code via git, is it possible to not store all these histories in ServiceNow?
Beyond the history of my application, each JS file present in my application also has its own history (I have js files with more than 200 versions). Here too, the history is managed elsewhere in git, is it possible not to store all the intermediate versions of each source file? This is applicable to each Scripted REST API and Scripted REST resource.
4. resources
The existing documentation is quite basic and the examples are minimalistic: are there more advanced resources to illustrate the implementation of a complex project taking advantage of the benefits of the SDK put forward by ServiceNow? (such as the use of third-party Javascript modules).
Also, no training exists in Now Learning on this subject. Is it planned? Where can I find training items on this topic?
I think I'm forgetting some questions but I'll be sure to reply to this topic to ask them when they come back to me 🙂
Thank you for your time and answers.
Anthony
- 867 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2025 05:36 AM
Bumping the thread, it seems that I am the only one building a custom app with now-sdk 😞
I got another question: does anyone know how transitive dependencies are handled?
For example, my now-sdk app is using a third-party library "libOne", that depends on another library "libTwo". My now-sdk app package.json will only refer to "libOne", and on runtime, it seems that "libTwo" is not found in ServiceNow. However, "libTwo" is correctly referred in "libOne" package.json.
The ServiceNow documentation only mentions very basic use cases for third-party Javascript libraries. No example found so far.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 09:58 AM
Hi @anthonydian I'll try answering these best I can
1) The version should not matter for deployment, as we don't force incrementing versions and the last deployment should overwrite any changes on your development instance. Changes to tables beyond the basic info or adding columns will almost always require a reinstall though as that is limitations in the system. If you are having problems with others entities not updating please add some info here (or a sample repo is best!) and we can take a look.
2) The changes will go into the default update set for the application your are developing and there is no way to change that currently. We are looking at support for specifying update sets in the near future though.
3) There is no changes your can make to the SDK to modify this behavior as the system tracks these changes by default.
4) I agree with you here, and yes this is an area we plan to expand on soon. We do have a simple Github examples repo that has some basic usages of each API right now. As we put more resources into the SDK and IDE expect more here, but sorry for the limited documentation right now.
If you have not done so already, I encourage you (and any other developers) to join the public office hours if you can when you have some SDK related technical questions you need help with from some of our engineers from the team! @Jon Lind hosts those and you can find the post about it here for more information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 11:42 PM
Hi @BryceG and thanks for this detailed answer.
Let me take the points one by one :
- I created a Gitlab.com projet from scratch to illustrate the non-update issue following a now-sdk deployment. This issue is not reproduced on my PDI but still active on our ServiceNow company development instance. I tend to believe that this could be caused by settings. Have you ever seen / heard this kind of problem?
- Ok thanks, we'll follow each SDK evolution with interest.
- Ok, from my point of view, this mechanism is generating noise on the platform, as we're doing a lot of daily deployments, each one generating several history records for each javascript file sent to the platform. Code history is already managed on Gitlab side.
- No problem, are training courses planned to facilitate developers and companies onboarding on this specific topic? On our side, we are building a rather substantial now-sdk based application, with typescript model generation via openapi-generator, unit testing via jest, applying clean code best practices, with a dedicated CICD Gitlab pipeline to simplify application deployments and improve collaborative work among developers.
I'll keep you updated on the the non-update deployment issue.
A quick word on managing transitive dependencies though? 🙂 Is it possible?
Thanks again @BryceG !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 03:05 AM
To give more feedback on our application installation / update issue through now-sdk, the issue is reproduced on both dev and acceptance plateform.
The first install using now-sdk deploy is going well, but when I'm pushing another application (sharing the same package.json version), I notice the following error in System logs :
"Not allowing install of third party application: no thrown error".
Maybe it is related to the non-update of source code.