t-bug-catcher 0.2.1__tar.gz → 0.2.2__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.
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/PKG-INFO +1 -1
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/setup.cfg +1 -1
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/setup.py +1 -1
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher/__init__.py +1 -1
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher/jira.py +68 -37
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher.egg-info/PKG-INFO +1 -1
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/MANIFEST.in +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/README.rst +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/pyproject.toml +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/requirements.txt +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher/bug_catcher.py +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher/bug_snag.py +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher/config.py +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher/exceptions.py +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher/utils/__init__.py +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher/utils/common.py +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher/utils/logger.py +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher/workitems.py +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher.egg-info/SOURCES.txt +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher.egg-info/dependency_links.txt +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher.egg-info/not-zip-safe +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher.egg-info/requires.txt +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/t_bug_catcher.egg-info/top_level.txt +0 -0
- {t_bug_catcher-0.2.1 → t_bug_catcher-0.2.2}/tests/test_t_bug_catcher.py +0 -0
|
@@ -404,12 +404,8 @@ class Jira:
|
|
|
404
404
|
"text": "Run link: ",
|
|
405
405
|
"marks": [{"type": "strong"}],
|
|
406
406
|
},
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
"text": CONFIG.ENVIRONMENT,
|
|
410
|
-
"marks": ([] + self.__link_markup()),
|
|
411
|
-
},
|
|
412
|
-
],
|
|
407
|
+
]
|
|
408
|
+
+ self.__link_markup(),
|
|
413
409
|
}
|
|
414
410
|
]
|
|
415
411
|
if CONFIG.ENVIRONMENT != "local"
|
|
@@ -529,19 +525,39 @@ class Jira:
|
|
|
529
525
|
link_markup = {
|
|
530
526
|
variables.get("environment"): [
|
|
531
527
|
{
|
|
532
|
-
"type": "
|
|
533
|
-
"
|
|
534
|
-
|
|
535
|
-
|
|
528
|
+
"type": "text",
|
|
529
|
+
"text": variables.get("processRunUrl"),
|
|
530
|
+
"marks": [
|
|
531
|
+
{
|
|
532
|
+
"type": "link",
|
|
533
|
+
"attrs": {"href": variables.get("processRunUrl")},
|
|
534
|
+
},
|
|
535
|
+
{"type": "underline"},
|
|
536
|
+
],
|
|
537
|
+
}
|
|
536
538
|
],
|
|
537
539
|
"robocloud": [
|
|
538
540
|
{
|
|
539
|
-
"type": "
|
|
540
|
-
"
|
|
541
|
-
|
|
542
|
-
|
|
541
|
+
"type": "text",
|
|
542
|
+
"text": "https://cloud.robocorp.com",
|
|
543
|
+
"marks": [
|
|
544
|
+
{
|
|
545
|
+
"type": "link",
|
|
546
|
+
"attrs": {"href": CONFIG.RC_RUN_LINK},
|
|
547
|
+
},
|
|
548
|
+
{"type": "underline"},
|
|
549
|
+
],
|
|
550
|
+
}
|
|
551
|
+
],
|
|
552
|
+
"local": [
|
|
553
|
+
{
|
|
554
|
+
"type": "text",
|
|
555
|
+
"text": "local run",
|
|
556
|
+
"marks": [
|
|
557
|
+
{"type": "underline"},
|
|
558
|
+
],
|
|
559
|
+
}
|
|
543
560
|
],
|
|
544
|
-
"local": [{"type": "underline"}],
|
|
545
561
|
}
|
|
546
562
|
return link_markup[CONFIG.ENVIRONMENT]
|
|
547
563
|
|
|
@@ -653,28 +669,33 @@ class Jira:
|
|
|
653
669
|
if len(error) < CONFIG.LIMITS.MAX_DESCRIPTION_LENGTH
|
|
654
670
|
else error[: CONFIG.LIMITS.MAX_DESCRIPTION_LENGTH] + "..."
|
|
655
671
|
)
|
|
672
|
+
date_markup = [
|
|
673
|
+
{
|
|
674
|
+
"type": "text",
|
|
675
|
+
"text": f" at {str(datetime.datetime.now().strftime('%B %d, %Y %I:%M:%S %p'))}",
|
|
676
|
+
},
|
|
677
|
+
{"type": "hardBreak"},
|
|
678
|
+
]
|
|
656
679
|
|
|
657
680
|
error_markup = [
|
|
681
|
+
{
|
|
682
|
+
"type": "text",
|
|
683
|
+
"text": error,
|
|
684
|
+
"marks": [{"type": "code"}],
|
|
685
|
+
},
|
|
686
|
+
]
|
|
687
|
+
|
|
688
|
+
comment_markup = [
|
|
658
689
|
{
|
|
659
690
|
"type": "paragraph",
|
|
660
|
-
"content":
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
"type": "text",
|
|
669
|
-
"text": f" at {str(datetime.datetime.now().strftime('%B %d, %Y %I:%M:%S %p'))}",
|
|
670
|
-
},
|
|
671
|
-
{"type": "hardBreak"},
|
|
672
|
-
{
|
|
673
|
-
"type": "text",
|
|
674
|
-
"text": error,
|
|
675
|
-
"marks": [{"type": "code"}],
|
|
676
|
-
},
|
|
677
|
-
],
|
|
691
|
+
"content": (
|
|
692
|
+
[
|
|
693
|
+
{"type": "text", "text": "Error occures again in "},
|
|
694
|
+
]
|
|
695
|
+
+ self.__link_markup()
|
|
696
|
+
+ date_markup
|
|
697
|
+
+ error_markup
|
|
698
|
+
),
|
|
678
699
|
}
|
|
679
700
|
]
|
|
680
701
|
|
|
@@ -711,7 +732,7 @@ class Jira:
|
|
|
711
732
|
"type": "doc",
|
|
712
733
|
"version": 1,
|
|
713
734
|
"content": []
|
|
714
|
-
+ (
|
|
735
|
+
+ (comment_markup if error else [])
|
|
715
736
|
+ (self.__description_markup(additional_info) if additional_info else [])
|
|
716
737
|
+ (attach_markup if attachments else [])
|
|
717
738
|
+ (self.__metadata_markup(metadata) if metadata else []),
|
|
@@ -780,7 +801,13 @@ class Jira:
|
|
|
780
801
|
posted_attachments = []
|
|
781
802
|
else:
|
|
782
803
|
posted_attachments = (
|
|
783
|
-
[
|
|
804
|
+
[
|
|
805
|
+
self.add_attachment(attachment, issue["id"])
|
|
806
|
+
for attachment in attachments
|
|
807
|
+
if os.path.exists(str(attachment))
|
|
808
|
+
]
|
|
809
|
+
if attachments
|
|
810
|
+
else []
|
|
784
811
|
)
|
|
785
812
|
|
|
786
813
|
self.update_comment(
|
|
@@ -834,7 +861,8 @@ class Jira:
|
|
|
834
861
|
ticket_id = ticket["id"]
|
|
835
862
|
if attachments:
|
|
836
863
|
for attachment in attachments:
|
|
837
|
-
|
|
864
|
+
if os.path.exists(str(attachment)):
|
|
865
|
+
self.add_attachment(attachment, ticket_id)
|
|
838
866
|
if self._webhook_url:
|
|
839
867
|
self.move_ticket_to_board(ticket_id)
|
|
840
868
|
return response
|
|
@@ -843,7 +871,7 @@ class Jira:
|
|
|
843
871
|
self,
|
|
844
872
|
exception: Optional[Exception] = None,
|
|
845
873
|
assignee: Optional[str] = None,
|
|
846
|
-
attachments:
|
|
874
|
+
attachments: Union[List, str, Path, None] = None,
|
|
847
875
|
metadata: Optional[dict] = None,
|
|
848
876
|
additional_info: Optional[str] = None,
|
|
849
877
|
) -> dict:
|
|
@@ -866,6 +894,9 @@ class Jira:
|
|
|
866
894
|
if attachments is None:
|
|
867
895
|
attachments = []
|
|
868
896
|
|
|
897
|
+
if isinstance(attachments, (str, Path)):
|
|
898
|
+
attachments = [str(attachments)]
|
|
899
|
+
|
|
869
900
|
if not isinstance(attachments, List):
|
|
870
901
|
logger.warning(f"Incorrect type of attachments: {type(attachments)}")
|
|
871
902
|
attachments = []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|