UCSF-Costello-Lab / LG3_Pipeline

The original LG3 pipeline
https://github.com/UCSF-Costello-Lab/LG3_Pipeline
0 stars 0 forks source link

ROBUSTNESS: Remove default LG3_HOME value - give error instead #89

Closed HenrikBengtsson closed 5 years ago

HenrikBengtsson commented 5 years ago

There's a risk for TIPCC users to use the incorrect pipeline version if they forget to load the 'lg3' module because then LG3_HOME is not set and it will default to /home/jocostello/shared/LG3_Pipeline and whatever version is therein.

Example

LG3_HOME not set:

$ module purge
$ ./_run_Trim
[2018-10-16 20:01:45 PDT] BEGIN: ./_run_Trim
Call: ./_run_Trim
Script: ./_run_Trim
Arguments:
Input:
- LG3_HOME=/home/jocostello/shared/LG3_Pipeline
[...]

LG3_HOME set:

$ module load CBC lg3
$ ./_run_Trim 
[2018-10-16 20:02:25 PDT] BEGIN: ./_run_Trim
Call: ./_run_Trim
Script: ./_run_Trim
Arguments: 
Input:
- LG3_HOME=/home/shared/cbc/software_cbc/LG3_Pipeline-2018-10-11
[...]

Suggestion

Let's remove the default LG3_HOME value and instead have all code produce an error if unset.

HenrikBengtsson commented 5 years ago

FYI, I've replaced all

LG3_HOME=${LG3_HOME:-/home/jocostello/shared/LG3_Pipeline}

with

LG3_HOME=${LG3_HOME:-?}

such that one now gets an error if not set;

$ export LG3_HOME=
$ ./_run_Trim 
[2018-10-16 20:29:50 PDT] BEGIN: ./_run_Trim
Call: ./_run_Trim
Script: ./_run_Trim
Arguments: 
./_run_Trim: line 9: LG3_HOME: parameter null or not set

I've also updated make check to assert that no code contains such paths.