navcontainerhelper
navcontainerhelper copied to clipboard
Renumber CreateTestUsers app
Describe the issue Most of our PTEs are starting their object IDs at 50000, for several reasons that I don't think I need to go into.
If we want to add test users to a database that already has a PTE installed the Object Ids will conflict with this error:
The application object of type 'Page' with the ID '50000' is defined in multiple apps. The apps are: CreateTestUsers by Microsoft 16.0.10221.0; "MyPTE" by "My Company" 17.0.19371.0.
I don't disagree with this app using the 50000-99999 number range (as #612 did) . But I would appreciate if it would use object id's in the upper part of the range (like 91234 or something other odd) instead of starting at 50000. Of course this is not bullet proof either, but the risk for having conflicting Object Ids would decrease drastically. :)
ps. This is not an urgent request, but it would be nice if it was changed the next time you need to touch that code
For this reason, I have added a parameter to Setup-BcContainerTestUsers called -createTestUsersAppUrl That one should be the URL for the app, which creates the test users. Fork this repo: https://dev.azure.com/businesscentralapps/CreateTestUsers - renumber and build your own. If it fails some day, chances are the app has been updated, then you can pull from remote again.
I don't like to maintain forked code... I rather have things fixed at the root, if possible.
The -createTestUsersAppUrl could be nice though, if we would like to have our own logic on additional users to create...
But avoiding object ids in the beginning of 50000 range in tools is a common practice, so it could make sense to at least consider that moving forward, imo. ;-)
I will consider.
The reason why I don't see many conflicts is that the app removes itself and leaves the ID, but if you install it after installing other apps there is a risk of conflict.
I will consider.
:)
The reason why I don't see many conflicts is that the app removes itself and leaves the ID, but if you install it after installing other apps there is a risk of conflict.
Yes, that was our case here. It's possible to workaround, but would be easer to maintain a change of ids in the CreateTestUsers app (hopefully no maintenence)
Maybe I should create a renumber-app command to unpack, renumber and re-compile.
It might be an overkill solution, but it would probably work for me :)
But it would add some additional time to the pipeline run. Our developers are already complaining about having to wait ten minutes for a PR pipeline to run...
I wrote a tool a few years ago - maybe it still works:-) https://github.com/NAVDEMO/RenumberNavObjectIds
@freddydk https://dev.azure.com/businesscentralapps/CreateTestUsers seems to have been deactivated, does the source exist anywhere else?
I thought I could use -createTestUsersAppUrl to work-around #2951
The new location is here; https://github.com/BusinessCentralApps/HelperApps
Thanks @freddydk 👍