diff --git a/.circleci/config.yml b/.circleci/config.yml index 1944d83..6ddec1e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,6 +120,7 @@ workflows: - deploy: requires: - build_and_test_python27 + - build_and_test_python36 filters: branches: only: master diff --git a/actions/add_watcher.py b/actions/add_watcher.py index f5bd3f0..3abb29f 100755 --- a/actions/add_watcher.py +++ b/actions/add_watcher.py @@ -5,5 +5,4 @@ class JiraIssueAddWatcherAction(BaseJiraAction): def run(self, issue_key, username): - result = self._client.add_watcher(issue_key, username) - return result + return self._client.add_watcher(issue_key, username) diff --git a/config.schema.yaml b/config.schema.yaml index 56a13bd..b50baa2 100755 --- a/config.schema.yaml +++ b/config.schema.yaml @@ -1,75 +1,75 @@ --- -url: - description: "URL of the JIRA instance (e.g. ``https://myproject.atlassian.net``)" - type: "string" - secret: false - required: true -verify: - description: "Verify SSL certificate. Set to False to disable verification. Default True" - type: boolean - default: True -auth_method: - description: "Authentication method to use - oauth or basic" - type: "string" - secret: false - required: true - default: "oauth" - enum: - - oauth - - basic -username: - description: "Username if using the basic auth_method" - type: "string" - secret: false - required: false -password: - description: "Password if using the basic auth_method" - type: "string" - secret: true - required: false -rsa_cert_file: - description: "Path to a private key file, e.g. /home/vagrant/jira.pem" - type: "string" - secret: false - required: false -oauth_token: - description: "OAuth token" - type: "string" - secret: true - required: false -oauth_secret: - description: "OAuth secret" - type: "string" - secret: true - required: false -consumer_key: - description: "Consumer key" - type: "string" - secret: true - required: false -poll_interval: - description: "Polling interval - default 30s" - type: "integer" - secret: false - required: false - default: 30 -project: - description: "Project to be used as default for actions that don't require or allow a project" - type: "string" - secret: false - required: true -validate: - description: "If true it will validate your credentials first." - type: boolean - default: false - required: false -client_cert_file: - description: "Path to a client cert file, e.g. /home/jiracerts/username.cer" - type: "string" - secret: false - required: false -client_key_file: - description: "Path to a client key file, e.g. /home/jiracerts/username.key" - type: "string" - secret: false - required: false + url: + description: "URL of the JIRA instance (e.g. ``https://myproject.atlassian.net``)" + type: "string" + secret: false + required: true + verify: + description: "Verify SSL certificate. Set to False to disable verification. Default True" + type: boolean + default: True + auth_method: + description: "Authentication method to use - oauth or basic" + type: "string" + secret: false + required: true + default: "oauth" + enum: + - oauth + - basic + username: + description: "Username if using the basic auth_method" + type: "string" + secret: false + required: false + password: + description: "Password if using the basic auth_method" + type: "string" + secret: true + required: false + rsa_cert_file: + description: "Path to a private key file, e.g. /home/vagrant/jira.pem" + type: "string" + secret: false + required: false + oauth_token: + description: "OAuth token" + type: "string" + secret: true + required: false + oauth_secret: + description: "OAuth secret" + type: "string" + secret: true + required: false + consumer_key: + description: "Consumer key" + type: "string" + secret: true + required: false + poll_interval: + description: "Polling interval - default 30s" + type: "integer" + secret: false + required: false + default: 30 + project: + description: "Project to be used as default for actions that don't require or allow a project" + type: "string" + secret: false + required: true + validate: + description: "If true it will validate your credentials first." + type: boolean + default: false + required: false + client_cert_file: + description: "Path to a client cert file, e.g. /home/jiracerts/username.cer" + type: "string" + secret: false + required: false + client_key_file: + description: "Path to a client key file, e.g. /home/jiracerts/username.key" + type: "string" + secret: false + required: false diff --git a/sensors/jira_sensor.py b/sensors/jira_sensor.py index 8220a87..f72cf0c 100755 --- a/sensors/jira_sensor.py +++ b/sensors/jira_sensor.py @@ -13,9 +13,9 @@ class JIRASensor(PollingSensor): ''' def __init__(self, sensor_service, config=None, poll_interval=5): - super(JIRASensor, self).__init__( - sensor_service=sensor_service, config=config, poll_interval=poll_interval - ) + super(JIRASensor, self).__init__(sensor_service=sensor_service, + config=config, + poll_interval=poll_interval) self._jira_url = None # The Consumer Key created while setting up the 'Incoming Authentication' in diff --git a/sensors/jira_sensor.yaml b/sensors/jira_sensor.yaml index ee73173..8d06e46 100755 --- a/sensors/jira_sensor.yaml +++ b/sensors/jira_sensor.yaml @@ -1,25 +1,26 @@ --- -class_name: "JIRASensor" -entry_point: "jira_sensor.py" -description: "Sensor which monitors JIRA for new tickets" -poll_interval: 30 -trigger_types: - - name: "issues_tracker" - description: "Trigger which indicates that a new issue has been created" - payload_schema: - type: "object" - properties: - project: - type: "string" - issue_name: - type: "string" - issue_url: - type: "string" - created: - type: "string" - assignee: - type: "string" - fix_versions: - type: "list" - issue_type: - type: "string" + class_name: "JIRASensor" + entry_point: "jira_sensor.py" + description: "Sensor which monitors JIRA for new tickets" + poll_interval: 30 + trigger_types: + - + name: "issues_tracker" + description: "Trigger which indicates that a new issue has been created" + payload_schema: + type: "object" + properties: + project: + type: "string" + issue_name: + type: "string" + issue_url: + type: "string" + created: + type: "string" + assignee: + type: "string" + fix_versions: + type: "string" + issue_type: + type: "string" diff --git a/tests/fixtures/full_auth_passwd.yaml b/tests/fixtures/full_auth_passwd.yaml index 6cb7204..f875019 100644 --- a/tests/fixtures/full_auth_passwd.yaml +++ b/tests/fixtures/full_auth_passwd.yaml @@ -1,10 +1,10 @@ --- -url: "https://company.atlassian.net" -auth_method: "basic" -username: "user" -password: "passwd" -poll_interval: 30 -project: "MY_PROJECT" -verify: True -client_cert_file: "" -client_key_file: "" + url: "https://company.atlassian.net" + auth_method: "basic" + username: "user" + password: "passwd" + poll_interval: 30 + project: "MY_PROJECT" + verify: True + client_cert_file: "" + client_key_file: ""