Skip to content

Commit

Permalink
PSAAS-20418 pre-commit after update
Browse files Browse the repository at this point in the history
  • Loading branch information
mnordby-splunk committed Dec 13, 2024
1 parent 444048f commit f82b029
Show file tree
Hide file tree
Showing 14 changed files with 411 additions and 399 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/phantomcyber/dev-cicd-tools
rev: v1.17
rev: v1.24
hooks:
- id: org-hook
- id: package-app-dependencies
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--no-verify', '--exclude-files', '^jira.json$']
36 changes: 0 additions & 36 deletions jira.json
Original file line number Diff line number Diff line change
Expand Up @@ -10669,26 +10669,10 @@
"module": "PyJWT",
"input_file": "wheels/py3/PyJWT-2.6.0-py3-none-any.whl"
},
{
"module": "beautifulsoup4",
"input_file": "wheels/py3/beautifulsoup4-4.9.1-py3-none-any.whl"
},
{
"module": "certifi",
"input_file": "wheels/py3/certifi-2024.8.30-py3-none-any.whl"
},
{
"module": "charset_normalizer",
"input_file": "wheels/py39/charset_normalizer-3.4.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl"
},
{
"module": "defusedxml",
"input_file": "wheels/shared/defusedxml-0.7.1-py2.py3-none-any.whl"
},
{
"module": "idna",
"input_file": "wheels/py3/idna-3.10-py3-none-any.whl"
},
{
"module": "jira",
"input_file": "wheels/py3/jira-3.5.0-py3-none-any.whl"
Expand All @@ -10705,18 +10689,10 @@
"module": "pbr",
"input_file": "wheels/shared/pbr-5.4.4-py2.py3-none-any.whl"
},
{
"module": "python_dateutil",
"input_file": "wheels/shared/python_dateutil-2.8.1-py2.py3-none-any.whl"
},
{
"module": "pytz",
"input_file": "wheels/shared/pytz-2021.1-py2.py3-none-any.whl"
},
{
"module": "requests",
"input_file": "wheels/py3/requests-2.32.3-py3-none-any.whl"
},
{
"module": "requests_oauthlib",
"input_file": "wheels/shared/requests_oauthlib-1.3.1-py2.py3-none-any.whl"
Expand All @@ -10725,21 +10701,9 @@
"module": "requests_toolbelt",
"input_file": "wheels/shared/requests_toolbelt-0.10.1-py2.py3-none-any.whl"
},
{
"module": "six",
"input_file": "wheels/shared/six-1.17.0-py2.py3-none-any.whl"
},
{
"module": "soupsieve",
"input_file": "wheels/py3/soupsieve-2.6-py3-none-any.whl"
},
{
"module": "typing_extensions",
"input_file": "wheels/py3/typing_extensions-4.12.2-py3-none-any.whl"
},
{
"module": "urllib3",
"input_file": "wheels/py3/urllib3-2.2.3-py3-none-any.whl"
}
]
}
Expand Down
717 changes: 378 additions & 339 deletions jira_connector.py

Large diffs are not rendered by default.

48 changes: 30 additions & 18 deletions jira_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,34 @@
JIRA_JSON_TO_ID = "to_id"
JIRA_JSON_LINK_TYPE = "link_type"
JIRA_JSON_UPDATED_AT = "updated_at"
JIRA_JSON_CONTAINER = 'container'
JIRA_JSON_SDI = 'source_data_identifier'
JIRA_JSON_LABEL = 'label'
JIRA_JSON_CEF = 'cef'
JIRA_JSON_UNRESOLVED = 'Unresolved'
JIRA_JSON_CUSTOM_FIELDS = 'custom_fields'
JIRA_JSON_USERNAME = 'username'
JIRA_JSON_DISPLAY_NAME = 'display_name'
JIRA_JSON_USER_ACCOUNT_ID = 'user_account_id'
JIRA_JSON_TIMESPENT = 'time_spent'
JIRA_JSON_CONTAINER = "container"
JIRA_JSON_SDI = "source_data_identifier"
JIRA_JSON_LABEL = "label"
JIRA_JSON_CEF = "cef"
JIRA_JSON_UNRESOLVED = "Unresolved"
JIRA_JSON_CUSTOM_FIELDS = "custom_fields"
JIRA_JSON_USERNAME = "username"
JIRA_JSON_DISPLAY_NAME = "display_name"
JIRA_JSON_USER_ACCOUNT_ID = "user_account_id"
JIRA_JSON_TIMESPENT = "time_spent"

JIRA_RESPONSE_ERROR_MESSAGES_KEY = "errorMessages"
JIRA_RESPONSE_ERRORS_KEY = "errors"

JIRA_WATCHERS_ERROR = "Please provide either 'user_account_id' or 'username' action parameter. " \
JIRA_WATCHERS_ERROR = (
"Please provide either 'user_account_id' or 'username' action parameter. "
"For JIRA on-prem, use 'username' action parameter, and, for JIRA cloud, use 'user_account_id' action parameter"
JIRA_SEARCH_USERS_ERROR = "Please provide either 'display_name' or 'username' action parameter. " \
)
JIRA_SEARCH_USERS_ERROR = (
"Please provide either 'display_name' or 'username' action parameter. "
"For JIRA on-prem, use 'username' action parameter, and, for JIRA cloud, use 'display_name' action parameter"
)
JIRA_CUSTOM_FIELD_FORMAT_ERROR = "Could not load JSON formatted list from the custom_fields asset configuration parameter. {0}"
JIRA_CUSTOM_FIELD_NON_EMPTY_ERROR = "Please provide 'custom_fields' asset configuration parameter as a non-empty JSON formatted list"
JIRA_ASSIGNEE_ERROR = "Please provide either 'assignee' or 'assignee_account_id' action parameter. " \
JIRA_ASSIGNEE_ERROR = (
"Please provide either 'assignee' or 'assignee_account_id' action parameter. "
"For JIRA on-prem, use 'assignee' action parameter, and, for JIRA cloud, use 'assignee_account_id' action parameter"
)
JIRA_INVALID_LIMIT = "Please provide non-zero positive integer in limit"
JIRA_ERROR_STATE_FILE_CORRUPT_ERROR = "Error occurred while loading the state file due to its unexpected format.\
Resetting the state file with the default format. Please try again."
Expand All @@ -86,9 +92,11 @@
JIRA_ERROR_TICKET_ASSIGNMENT_FAILED = "Ticket assignment to user '{0}' failed. {1}"
JIRA_ERROR_CREATE_TICKET_FAILED = "Ticket creation failed"
JIRA_SUCCESS_TICKET_CREATED = "Created ticket with id: {id}, key: {key}"
JIRA_ERROR_ARTIFACT_NOT_FOUND_IN_CONTAINER = "Either the ticket artifact with issue key: {issue_key} got deleted " \
"from the container: {container_id} or the type of the issue has changed on the JIRA instance." \
JIRA_ERROR_ARTIFACT_NOT_FOUND_IN_CONTAINER = (
"Either the ticket artifact with issue key: {issue_key} got deleted "
"from the container: {container_id} or the type of the issue has changed on the JIRA instance."
"Please delete the container and re-run the ingestion."
)
JIRA_ERROR_FILE_NOT_IN_VAULT = "Could not find specified vault ID in vault"
JIRA_ERROR_ATTACH_FAILED = "Adding attachment failed. {0}"
JIRA_ERROR_LIST_TICKETS_FAILED = "Failed to get ticket listing"
Expand All @@ -98,13 +106,17 @@
JIRA_ERROR_ISSUE_VALID_RESOLUTION = "Input resolution does not seem to be valid"
JIRA_ERROR_UPDATE_NO_PARAM = "Either the Vault ID or the JSON field must be filled out to perform this action"
JIRA_ERROR_UPDATE_FAILED = "Unable to update the ticket with the given JSON"
JIRA_ERROR_COMMENT_SET_STATUS_FAILED = "Comment could not be added successfully due to either permissions or configuration issue " \
JIRA_ERROR_COMMENT_SET_STATUS_FAILED = (
"Comment could not be added successfully due to either permissions or configuration issue "
"(changing the status of the ticket to Closed and then, trying to add comment to it is one such scenario)."
)
JIRA_SUCCESS_TICKET_UPDATED = "Successfully updated the ticket"
JIRA_SUCCESS_TICKET_DELETED = "Successfully deleted the ticket"
JIRA_ERROR_INPUT_FIELDS_NOT_THE_ONLY_ONE = "Invalid fields value." \
" The input json has a 'fields' key in it in addition to other keys." \
JIRA_ERROR_INPUT_FIELDS_NOT_THE_ONLY_ONE = (
"Invalid fields value."
" The input json has a 'fields' key in it in addition to other keys."
" Either specify a dictionary with only one parent 'fields' key or multiple keys without the 'fields' key"
)
JIRA_ERROR_FAILED = "Some tickets had issues during ingestion, see logs for the details"
JIRA_ERROR_NEGATIVE_INPUT = "'start_index' cannot be a negative value"
JIRA_LIMIT_VALIDATION_ALLOW_ZERO_MESSAGE = "Please provide zero or positive integer value in the {parameter} parameter"
Expand Down
5 changes: 1 addition & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[flake8]
max-line-length = 145
max-complexity = 28
extend-ignore = F403,E128,E126,E111,E121,E127,E731,E201,E202,F405,E722,D,W292

[isort]
line_length = 145
extend-ignore = F403,E128,E126,E121,E127,E731,E201,E202,E203,E701,F405,E722,D,W503
Binary file removed wheels/py3/beautifulsoup4-4.9.1-py3-none-any.whl
Binary file not shown.
Binary file removed wheels/py3/certifi-2024.8.30-py3-none-any.whl
Binary file not shown.
Binary file removed wheels/py3/idna-3.10-py3-none-any.whl
Binary file not shown.
Binary file removed wheels/py3/requests-2.32.3-py3-none-any.whl
Binary file not shown.
Binary file removed wheels/py3/soupsieve-2.6-py3-none-any.whl
Binary file not shown.
Binary file removed wheels/py3/urllib3-2.2.3-py3-none-any.whl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed wheels/shared/six-1.17.0-py2.py3-none-any.whl
Binary file not shown.

0 comments on commit f82b029

Please sign in to comment.