Skip to content

Commit d1c5c38

Browse files
Cr 17130 revert (#566)
1 parent cd1cca8 commit d1c5c38

File tree

2 files changed

+6
-33
lines changed

2 files changed

+6
-33
lines changed

incubating/jira-issue-manager/script/jira_issue_manager.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@
1010
from requests.auth import HTTPBasicAuth
1111

1212
class Environment:
13-
def __init__(self, jira_base_url, jira_username, jira_api_key, jira_server_pat, action,
13+
def __init__(self, jira_base_url, jira_username, jira_api_key, action,
1414
issue, issue_project, issue_summary, issue_description, issue_type, issue_components, issue_customfields,
1515
existing_comment_id, comment_body, status, jql_query, jql_query_max_results,
1616
verbose):
1717
self.jira_base_url = jira_base_url
1818
self.jira_username = jira_username
1919
self.jira_api_key = jira_api_key
20-
self.jira_server_pat = jira_server_pat
2120
self.action = action
2221
self.issue = issue
2322
self.issue_project = issue_project
@@ -33,23 +32,9 @@ def __init__(self, jira_base_url, jira_username, jira_api_key, jira_server_pat,
3332
self.jql_query_max_results = jql_query_max_results
3433
self.verbose = verbose
3534

36-
def valudate_input(current_environment):
37-
if not current_environment.jira_api_key and current_environment.jira_username:
38-
raise Exception('JIRA_API_KEY required for basic authentication')
39-
40-
if current_environment.jira_api_key and not current_environment.jira_username:
41-
raise Exception('JIRA_USERNAME required for basic authentication')
42-
43-
if not current_environment.jira_api_key and not current_environment.jira_server_pat:
44-
raise Exception('Credentials not provided')
45-
46-
if current_environment.jira_api_key and current_environment.jira_server_pat:
47-
raise Exception('Only one of JIRA_API_KEY and JIRA_SERVER_PAT allowed')
48-
4935

5036
def main():
5137
current_environment = environment_setup()
52-
valudate_input(current_environment)
5338
authenticated_jira = authentication(current_environment)
5439
step_action(current_environment.action, authenticated_jira, current_environment)
5540

@@ -60,7 +45,6 @@ def environment_setup():
6045
jira_base_url = StepUtility.getEnvironmentVariable('JIRA_BASE_URL', env)
6146
jira_username = StepUtility.getEnvironmentVariable('JIRA_USERNAME', env)
6247
jira_api_key = StepUtility.getEnvironmentVariable('JIRA_API_KEY', env)
63-
jira_server_pat = StepUtility.getEnvironmentVariable('JIRA_SERVER_PAT', env)
6448
action = StepUtility.getEnvironmentVariable('ACTION', env)
6549

6650
# Logic here to use the regex to grab the jira issue key and assign it to issue
@@ -116,7 +100,6 @@ def environment_setup():
116100
jira_base_url,
117101
jira_username,
118102
jira_api_key,
119-
jira_server_pat,
120103
action,
121104
issue,
122105
issue_project,
@@ -135,14 +118,6 @@ def environment_setup():
135118

136119

137120
def authentication(current_environment):
138-
if current_environment.jira_server_pat:
139-
# Jira Server authentication with a PAT
140-
jira = JIRA(
141-
current_environment.jira_base_url,
142-
token_auth=current_environment.jira_server_pat
143-
)
144-
return jira
145-
146121
# Basic authentication with an API Token
147122
jira = JIRA(
148123
current_environment.jira_base_url,

incubating/jira-issue-manager/step.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kind: step-type
22
version: '1.0'
33
metadata:
44
name: jira-issue-manager
5-
version: 1.0.9
5+
version: 1.0.10
66
title: Jira Issue Manager
77
isPublic: true
88
description: Create, Update, & Validate Jira Issues
@@ -158,7 +158,9 @@ spec:
158158
"additionalProperties": false,
159159
"patterns": [],
160160
"required": [
161-
"JIRA_BASE_URL"
161+
"JIRA_BASE_URL",
162+
"JIRA_USERNAME",
163+
"JIRA_API_KEY"
162164
],
163165
"properties": {
164166
"JIRA_BASE_URL": {
@@ -173,10 +175,6 @@ spec:
173175
"type": "string",
174176
"description": "Jira API key"
175177
},
176-
"JIRA_SERVER_PAT": {
177-
"type": "string",
178-
"description": "Jira Personal Access Token for Jira Server"
179-
},
180178
"ACTION": {
181179
"type": "string",
182180
"description": "Specifies the type of action to perform against your Jira instance - please see the examples and readme"
@@ -245,7 +243,7 @@ spec:
245243
stepsTemplate: |-
246244
main:
247245
name: jira-issue-manager
248-
image: quay.io/codefreshplugins/jira-issue-manager:1.0.9
246+
image: quay.io/codefreshplugins/jira-issue-manager:1.0.10
249247
environment:
250248
[[ range $key, $val := .Arguments ]]
251249
- '[[ $key ]]=[[ $val ]]'

0 commit comments

Comments
 (0)