-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate neo home inside neoDeploy #93
Validate neo home inside neoDeploy #93
Conversation
151aeff
to
807bc5d
Compare
vars/neoDeploy.groovy
Outdated
@@ -87,6 +87,21 @@ def call(parameters = [:]) { | |||
stepConfiguration, stepConfigurationKeys, | |||
ConfigurationLoader.defaultStepConfiguration(script, stepName)) | |||
|
|||
HOME_CHECK: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The behaviour with validation inside the ui5 reference pipeline was:
- NEO_HOME needs to be provided from the config. If it was not provided, we failed. The code with launching neo.sh from the path was not used.
- The behaviour now is:
- In case NEO_HOME is provided (either from config or as Jenkins environment variable), we validate. In case it is not provided we try to launch neo.sh from the path. This is the behaviour we had already when using the step outside our ui5 pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if NEO_HOME is in the path the neo version must be validated anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but currently this is not possible with the current version of toolValidate. --> Should be done in another PR.
The current story is about moving the validation from the pipeline into the steps. Before there was also no validation in case neo.sh was fetched from the path. From that point of view this is no change wrt status before. But in general I aggree, we should also validate the version if we have neo in the path. But this should be added in another PR closer to the validation toolset.
Some more background: using which
we get the full path to the executable. toolValidate works upon NEO_HOME
which is not the path to the executable. In case which neo.sh
returns a symbolic link (typically provided in /usr/bin
or /usr/local/bin
) it is not even possible to strip the trailing tools/neo.sh
.
Integration test with pipeline not performing validation at the beginning has been performed successfully. |
a39fb19
to
9dcdde0
Compare
9dcdde0
to
5fe99ce
Compare
vars/neoDeploy.groovy
Outdated
@@ -87,6 +87,21 @@ def call(parameters = [:]) { | |||
stepConfiguration, stepConfigurationKeys, | |||
ConfigurationLoader.defaultStepConfiguration(script, stepName)) | |||
|
|||
HOME_CHECK: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if NEO_HOME is in the path the neo version must be validated anyways.
test/groovy/NeoDeploymentTest.groovy
Outdated
// toolValidate here. This is expected to be done in a test class for | ||
// toolValidate. | ||
// | ||
helper.registerAllowedMethod('toolValidate', [Map], {m -> toolValidateCalled = true;}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo ;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot see a typo, please help me with finding the typo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean using ; with Groovy
f6a3840
to
d148f82
Compare
vars/neoDeploy.groovy
Outdated
@@ -196,7 +216,7 @@ def call(parameters = [:]) { | |||
|
|||
private getNeoExecutable(configuration) { | |||
|
|||
def neoExecutable = 'neo.sh' // default, if nothing below applies maybe it is the path. | |||
def neoExecutable = NEO_DEFAULT_CMD // default, if nothing below applies maybe it is the path. | |||
|
|||
if (configuration.neoHome) { | |||
neoExecutable = "${configuration.neoHome}/tools/neo.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this occurance of neo.sh should also use NEO_DEFAULT_CMD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
ebda826
to
0dbb8be
Compare
// toolValidate. | ||
|
||
def rc = sh script: "which ${NEO_DEFAULT_CMD}", returnStatus: true | ||
if(neoHome || (!neoHome && rc != 0)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would directly fail here if (!neoHome && rc != 0) instead of passing an empty neohome ot toolValidate. This would be better readable/understandable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Furthermore some log output could be helpful if neo is taken from the path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can discuss if we should fail here in case !neoHome
. With the current approach the behavior is closer to the behavior before the change. Before the change we got inside toolValidate
and fail inside in the same was like it is now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log output: done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my review is outdated
0dbb8be
to
489dab7
Compare
since pip install fails caused by outdated python version
Needed in order to deal with new shell calls wrt 'which neo.sh'.
489dab7
to
c6f4ce4
Compare
No description provided.