Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Singh <[email protected]>
  • Loading branch information
viveksyngh committed Jul 20, 2020
2 parents 3938171 + 25bf9e3 commit 243a1c4
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 112 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ workflows:
- deploy:
requires:
- build_and_test_python27
- build_and_test_python36
filters:
branches:
only: master
Expand Down
3 changes: 1 addition & 2 deletions actions/add_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
148 changes: 74 additions & 74 deletions config.schema.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions sensors/jira_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 25 additions & 24 deletions sensors/jira_sensor.yaml
Original file line number Diff line number Diff line change
@@ -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"
18 changes: 9 additions & 9 deletions tests/fixtures/full_auth_passwd.yaml
Original file line number Diff line number Diff line change
@@ -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: ""

0 comments on commit 243a1c4

Please sign in to comment.