t-bug-catcher 0.6.9__tar.gz → 0.6.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/PKG-INFO +1 -1
  2. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/setup.cfg +1 -1
  3. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/setup.py +1 -1
  4. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/__init__.py +1 -1
  5. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/bug_catcher.py +3 -0
  6. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/jira.py +8 -1
  7. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher.egg-info/PKG-INFO +1 -1
  8. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/MANIFEST.in +0 -0
  9. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/README.rst +0 -0
  10. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/pyproject.toml +0 -0
  11. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/requirements.txt +0 -0
  12. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/bug_snag.py +0 -0
  13. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/config.py +0 -0
  14. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/exceptions.py +0 -0
  15. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/resources/whispers_config.yml +0 -0
  16. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/stack_saver.py +0 -0
  17. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/utils/__init__.py +0 -0
  18. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/utils/common.py +0 -0
  19. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/utils/logger.py +0 -0
  20. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher/workitems.py +0 -0
  21. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher.egg-info/SOURCES.txt +0 -0
  22. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher.egg-info/dependency_links.txt +0 -0
  23. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher.egg-info/not-zip-safe +0 -0
  24. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher.egg-info/requires.txt +0 -0
  25. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/t_bug_catcher.egg-info/top_level.txt +0 -0
  26. {t_bug_catcher-0.6.9 → t_bug_catcher-0.6.10}/tests/test_t_bug_catcher.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: t_bug_catcher
3
- Version: 0.6.9
3
+ Version: 0.6.10
4
4
  Summary: Bug catcher
5
5
  Home-page: https://www.thoughtful.ai/
6
6
  Author: Thoughtful
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 0.6.9
2
+ current_version = 0.6.10
3
3
  commit = True
4
4
  tag = False
5
5
 
@@ -26,7 +26,7 @@ setup(
26
26
  packages=find_packages(include=["t_bug_catcher", "t_bug_catcher.*"]),
27
27
  test_suite="tests",
28
28
  url="https://www.thoughtful.ai/",
29
- version="0.6.9",
29
+ version="0.6.10",
30
30
  zip_safe=False,
31
31
  install_requires=install_requirements,
32
32
  include_package_data=True,
@@ -3,7 +3,7 @@
3
3
  __author__ = """Thoughtful"""
4
4
  __email__ = "support@thoughtful.ai"
5
5
  # fmt: off
6
- __version__ = '0.6.9'
6
+ __version__ = '0.6.10'
7
7
  # fmt: on
8
8
 
9
9
  from .bug_catcher import (
@@ -30,6 +30,7 @@ class Configurator:
30
30
  api_token: str,
31
31
  project_key: str,
32
32
  webhook_url: Optional[str] = None,
33
+ webhook_secret: Optional[str] = None,
33
34
  default_assignee: Optional[str] = None,
34
35
  ):
35
36
  """Configures the JiraPoster and BugSnag classes.
@@ -39,6 +40,7 @@ class Configurator:
39
40
  api_token (str): The API token for the Jira account.
40
41
  project_key (str): The key of the Jira project.
41
42
  webhook_url (str, optional): The webhook URL for the Jira project. Defaults to None.
43
+ webhook_secret (str, optional): The webhook secret for the Jira project. Defaults to None.
42
44
  default_assignee (str, optional): The default assignee for the Jira project. Defaults to None.
43
45
 
44
46
  Returns:
@@ -49,6 +51,7 @@ class Configurator:
49
51
  api_token=api_token,
50
52
  project_key=project_key,
51
53
  webhook_url=webhook_url,
54
+ webhook_secret=webhook_secret,
52
55
  default_assignee=default_assignee,
53
56
  )
54
57
 
@@ -54,6 +54,7 @@ class Jira:
54
54
  self._issue_types = {}
55
55
  self._project_key = None
56
56
  self._webhook_url = None
57
+ self._webhook_secret = None
57
58
  self._auth = None
58
59
  self._default_assignee = None
59
60
  self._build_info: Optional[dict] = None
@@ -99,6 +100,7 @@ class Jira:
99
100
  api_token: str,
100
101
  project_key: str,
101
102
  webhook_url: Optional[str] = None,
103
+ webhook_secret: Optional[str] = None,
102
104
  default_assignee: Optional[str] = None,
103
105
  ) -> bool:
104
106
  """Sets the webhook URL for the Jira project.
@@ -108,6 +110,7 @@ class Jira:
108
110
  api_token (str): The API token for the Jira account.
109
111
  project_key (str): The key of the Jira project.
110
112
  webhook_url (str): The webhook URL for the Jira project.
113
+ webhook_secret (str, optional): The webhook secret for the Jira project. Defaults to None.
111
114
  default_assignee (str, optional): The default assignee for the Jira project. Defaults to None.
112
115
 
113
116
  Returns:
@@ -120,6 +123,7 @@ class Jira:
120
123
  if not webhook_url:
121
124
  logger.warning("No JIRA webhook URL provided. All issues will be posted to backlog.")
122
125
  self._webhook_url = webhook_url
126
+ self._webhook_secret = webhook_secret
123
127
  self._auth = self._authenticate(login, api_token)
124
128
  try:
125
129
  self.get_current_user()
@@ -265,10 +269,13 @@ class Jira:
265
269
  None
266
270
  """
267
271
  payload = json.dumps({"issues": [ticket_id]})
272
+ headers = {"Content-type": "application/json"}
273
+ if self._webhook_secret:
274
+ headers["X-Automation-Webhook-Token"] = self._webhook_secret
268
275
  requests.request(
269
276
  "POST",
270
277
  url=self._webhook_url,
271
- headers={"Content-type": "application/json"},
278
+ headers=headers,
272
279
  data=payload,
273
280
  )
274
281
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: t_bug_catcher
3
- Version: 0.6.9
3
+ Version: 0.6.10
4
4
  Summary: Bug catcher
5
5
  Home-page: https://www.thoughtful.ai/
6
6
  Author: Thoughtful
File without changes