Skip to content
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

Add override parameters to Jenkins #302

Merged
merged 2 commits into from
May 21, 2018

Conversation

katyafervent
Copy link
Contributor

No description provided.

'override_parameters': {
'type': 'parameters',
'label': 'Jenkins job parameters',
'order': 1,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required

'label': 'Jenkins job parameters',
'order': 1,
'validators': {
'required': False

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure it's needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, default is required

logger.exception('Could not contact JenkinsEngine backend: ')
status = config.get('PROVISIONER_ERROR_STATE')
return status
Check, that key parameter, defined by

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that key parameter defined by

Returns:
:obj:`jenkins.Jenkins`: initialized Jenkins client
"""
return jenkins.Jenkins(self.jenkins_url, **{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you pass it in a normal way?

try:
job_body = self.client.get_job_info(self.provision_job_name, depth=1)
for jj_class in job_body['property']:
if 'parameterDefinitions' not in jj_class.keys():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not in jj_class:?

if self.job_override_params:
logger.debug('The following job parameters will be overwritten: {}'
.format(self.job_override_params))
for key, value in self.job_override_params.items():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctx.update(self.job_override_params) ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried this? It should work

Copy link
Contributor

@naumvd95 naumvd95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG mostly
just a few comments
re-trigger travis with amend
and do u want to push into master directly or firstly push to my PR?

@@ -227,7 +227,7 @@ def dispatch_request(self, *args, **kwargs):
self.save_object()
self.after_save()
except Exception as e:
current_app.logger.error(e)
current_app.logger.exception(e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e is redundant, coz it in that way traceback will be duplicated

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not in that case this is general logging, we don't log exceptions everywhere so this is the one way to get info about exception.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, okok


Returns:
:obj:`jenkins.Jenkins`: initialized Jenkins client
bool: True if all parameters exist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all
this method takes 1 arg

@naumvd95
Copy link
Contributor

@katyafervent ^^

@katyafervent katyafervent force-pushed the add-override-parameters-to-jenkins branch from f79520f to a710908 Compare May 17, 2018 14:29
naumvd95
naumvd95 previously approved these changes May 18, 2018
Copy link
Contributor

@naumvd95 naumvd95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGFM

if auth_verify:
status = config.get('PROVISIONER_OK_STATE')
except Exception as e:
logger.exception('Could not contact JenkinsEngine backend: ')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like smth is missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just code movement, not a scope of this commit

Ekaterina Chernova and others added 2 commits May 21, 2018 10:39
Use cases:
1) Calico managing in case of using mcp-job calico-ha-aws-k8s
2) Overriding parameters in case of any jenkins job
@katyafervent katyafervent force-pushed the add-override-parameters-to-jenkins branch from 340827a to 3f88bae Compare May 21, 2018 07:45
@naumvd95 naumvd95 merged commit 098e114 into master May 21, 2018
@naumvd95 naumvd95 deleted the add-override-parameters-to-jenkins branch May 21, 2018 11:35
@katyafervent katyafervent restored the add-override-parameters-to-jenkins branch May 21, 2018 15:07
@ekhomyakova ekhomyakova deleted the add-override-parameters-to-jenkins branch June 26, 2018 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants