8000 Plugin level parameters not present in cmd line by botzill · Pull Request #105 · madcore-ai/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Plugin level parameters not present in cmd line #105

New issue 8000

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

Merged
merged 1 commit into from
Mar 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions madcore/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,8 @@ def show_job_console_output(self, jenkins_server, job_name, build_number, sleep_

job_info = jenkins_server.get_job_info(job_name)
if job_info:
success = job_info.get('lastSuccessfulBuild', {}).get('number', None) == build_number
last_successful_build = job_info.get('lastSuccessfulBuild', None) or {}
success = last_successful_build.get('number', None) == build_number

results[job_name] = success
break
Expand Down Expand Up @@ -971,7 +972,8 @@ def _populate_core_parameters(self, params_list):
return params_list

def override_parameters_if_exists(self, params_list_base, param_list_override):
# Check the parameters that are present in base list and not in
"""Check the parameters that are present in base list and not in override list"""

params_diff = list(
set(self._get_parameters_name(params_list_base)) - set(self._get_parameters_name(param_list_override)))

Expand Down Expand Up @@ -1072,6 +1074,8 @@ def list_params_to_dict(cls, plugin_params):

@classmethod
def ignore_parameters_with_no_prompt(cls, params_list):
if not params_list:
return []
return [param for param in params_list if param.get('prompt', True)]

def ask_for_plugin_parameters(self, job_params, parsed_args):
Expand Down Expand Up @@ -1187,11 +1191,17 @@ def get_plugin_job_all_params(self, plugin_name, job_name):
Get all parameters for specific job name. This include also all input parameters for sequences.
"""

# Get the parameters that are defined at the plugin level
plugin_definition = self.get_plugin_by_name(plugin_name)
plugin_params = plugin_definition.get('parameters', [])
plugin_params = self.ignore_parameters_with_no_prompt(plugin_params)

job_definition = self.get_plugin_job_definition(plugin_name, job_name,
job_type=const.PLUGIN_JENKINS_JOB_TYPE)

job_params = job_definition.get('parameters', [])
job_params = self.ignore_parameters_with_no_prompt(job_params)
job_params = self.override_parameters_if_exists(plugin_params, job_params)

for sequence in job_definition.get('sequence', []):
sequence_params = sequence.get('parameters', [])
Expand Down
0