Just casually, I’m going to start a checklist of features a production service should have just as basic features to enhance maintainabilty. Over time I’ll add more stuff, usually as I see things in other services that are well-written, so that I have a good list of things to remember to add when I spin up something new.
I’m going to start with some helpful version reporting hooks:
+ service returns version dynamically — coming in through the front door, a client can get the service’s version as a service call. This is also handy because it can serve as a “hello world” link for checking if the service is up, a front-line monitoring link
+ service reports version in a text file in the deployment directory — if applicable
+ service reports version in the .war file — probably in the Manifest
+ service embeds version in any generated client-facing pages
Those things remove the guess work of what version is deployed where. If you’re wondering what version of the service is deployed on a server, just ask it. Or look in the directory where it’s deployed. Or crack open the .war file and look at the manifest.
For the client-facing stuff (i.e. the HTML), having the version as a comment embedded in the HTML page can be really handy for troubleshooting. There have been lots of times when I asked someone logged in to “view page source” and tell me what version they see. Or did the same thing by myself in the course of development. That can be a really big sanity check.