e-merlin / eMERLIN_CASA_pipeline

This is CASA eMERLIN pipeline to calibrate data from the e-MERLIN array. Please fork the repository before making any changes and read the Coding Practices page in the wiki. Please add issues with the pipeline in the issues tab.
GNU General Public License v3.0
14 stars 11 forks source link

Adding version numbers #50

Closed varenius closed 7 years ago

varenius commented 7 years ago

It would be nice to introduce version numbers to the pipeline, through the releases functionality in Github. In this way, users can report version along any problems which simplifies bugfixing.

It would be nice to have the version in the log. Without release versions, one way to do this is to read the latest commit ID from the repo. This however only works if the users checked out the pipeline with git, i.e. not if downloading as zipfile. And if the user has git installed. If these requirements are satisfied, then it is possible to write it to log using the following command. (Now assuming the the script was run using the casa -c and not using execfile within casa)

import subprocess
repoversion = subprocess.check_output(['git', '--git-dir=' + pipeline_path + '/.git', 'rev-parse', 'HEAD'])
logger.info('Starting pipeline version ' + repoversion)

The optimal way to handle version numbers should probably be to use releases instead, and hence I'm only putting this here as a note while we're investigating the releases route.

jmoldon commented 7 years ago

Solved by b3f7f847df41223be5b88a92a55cd216517d39fc. It includes branch name and last commit to the log produced by the pipeline. It uses information in the .git folder.

Eskil will investigate adding hooks when commiting. If that is a robust way and, it does not need the commiter to do anything special, we will use it by default.