Better exception handling in ci-test
When the model slot cannot be determined as in this job, we should fail in a nice way by catching the exception and replying to the discussion. At the moment one just sees the failure in Jenkins:
2020-06-23 11:03:21,465:DEBUG : https://gitlab.cern.ch:443 "GET //api/v4/projects/lhcb%2FLHCb HTTP/1.1" 200 2718
2020-06-23 11:03:22,080:DEBUG : https://gitlab.cern.ch:443 "GET //api/v4/projects/399/merge_requests/2552 HTTP/1.1" 200 2196
2020-06-23 11:03:22,081:INFO : Getting model slot
2020-06-23 11:03:22,081:ERROR : Cannot determine Slot configuration from target branch "reco14-patches".
Traceback (most recent call last):
File "/build/jenkins-tests/workspace/nightly-builds/main/venv/bin/lbn-enabled-slots", line 8, in <module>
sys.exit(enabled_slots())
File "/build/jenkins-tests/workspace/nightly-builds/main/venv/lib/python2.7/site-packages/LbNightlyTools/Scripts/_entry_points.py", line 54, in enabled_slots
return Script().run()
File "/build/jenkins-tests/workspace/nightly-builds/main/venv/lib/python2.7/site-packages/LbCommon/Script.py", line 107, in run
rc = self.main()
File "/build/jenkins-tests/workspace/nightly-builds/main/venv/lib/python2.7/site-packages/LbNightlyTools/Scripts/EnabledSlots.py", line 140, in main
ref_slot, mr_slot = make_mr_slots(mr_slots_config, slots)
File "/build/jenkins-tests/workspace/nightly-builds/main/venv/lib/python2.7/site-packages/LbNightlyTools/MergeRequestBuilds.py", line 369, in make_mr_slots
model_slots=model_slots)
File "/build/jenkins-tests/workspace/nightly-builds/main/venv/lib/python2.7/site-packages/LbNightlyTools/MergeRequestBuilds.py", line 279, in create_mr_slots
model_slot = get_model_slot(target_branch, model_slots)
File "/build/jenkins-tests/workspace/nightly-builds/main/venv/lib/python2.7/site-packages/LbNightlyTools/MergeRequestBuilds.py", line 182, in get_model_slot
raise NotImplementedError(message)
NotImplementedError: Cannot determine Slot configuration from target branch "reco14-patches".