From f20d9c8a41a9c727e0ee1652ae211bff9a000931 Mon Sep 17 00:00:00 2001 From: sbrinkhorst <5467660+sbrinkhorst@users.noreply.github.com> Date: Wed, 16 Aug 2023 11:50:08 +0200 Subject: [PATCH 1/4] Catch error 502 that is thrown for analysis errors Currently we return 502 without message, this should be improved but at least handle it correctly for now. --- sigridci/sigridci/sigrid_api_client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sigridci/sigridci/sigrid_api_client.py b/sigridci/sigridci/sigrid_api_client.py index 03a5b733..514eb817 100644 --- a/sigridci/sigridci/sigrid_api_client.py +++ b/sigridci/sigridci/sigrid_api_client.py @@ -77,6 +77,9 @@ def retry(self, operation, *, attempts=5, allow404=False, allowEmpty=True): else: UploadLog.log(f"The system no longer exists (HTTP status {e.code})") sys.exit(1) + elif e.code == 502: + UploadLog.log("Something went wrong during analysis on our end (possibly related to configuration issues)") + sys.exit(1) elif allow404 and e.code == 404: return False From 84ff4bdc9fa69c0b6aab734c7ac695db773d4643 Mon Sep 17 00:00:00 2001 From: sbrinkhorst <5467660+sbrinkhorst@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:01:40 +0200 Subject: [PATCH 2/4] Fix test Project that we're testing changed --- test/test_repository_history_exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_repository_history_exporter.py b/test/test_repository_history_exporter.py index fdefc33c..24ae0e8e 100644 --- a/test/test_repository_history_exporter.py +++ b/test/test_repository_history_exporter.py @@ -33,4 +33,4 @@ def testExportGitHistory(self): historyEntries = f.read().strip().split("\n") self.assertEquals(historyEntries[0], - "'@@@;3e161af9218e6f20a095a96ee246763e9c01f1e3;Thomas Kraus (tukraus);thomas@sig.nl;2016-05-24 09:25:40 +0200;remove javascript'") + "'@@@;f59c21c9de5bee332d51cea5caef4b2500ea100e;Michiel Cuijpers;m.cuijpers@sig.eu;2023-08-15 13:57:07 +0200;Create sigrid-publish.yml'") From d016a74f7f703e9c42bbe2837df0bfda5c35b8d3 Mon Sep 17 00:00:00 2001 From: sbrinkhorst <5467660+sbrinkhorst@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:06:29 +0200 Subject: [PATCH 3/4] Clarify error message Co-authored-by: Pascal van Eck --- sigridci/sigridci/sigrid_api_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigridci/sigridci/sigrid_api_client.py b/sigridci/sigridci/sigrid_api_client.py index 514eb817..f024b560 100644 --- a/sigridci/sigridci/sigrid_api_client.py +++ b/sigridci/sigridci/sigrid_api_client.py @@ -78,7 +78,7 @@ def retry(self, operation, *, attempts=5, allow404=False, allowEmpty=True): UploadLog.log(f"The system no longer exists (HTTP status {e.code})") sys.exit(1) elif e.code == 502: - UploadLog.log("Something went wrong during analysis on our end (possibly related to configuration issues)") + UploadLog.log("Something went wrong during analysis on our end (could be an issue in `sigrid.yaml`, please review)") sys.exit(1) elif allow404 and e.code == 404: return False From 9eaddda1ee4385cb8fcd3419878c7a9cf427a017 Mon Sep 17 00:00:00 2001 From: sbrinkhorst <5467660+sbrinkhorst@users.noreply.github.com> Date: Tue, 29 Aug 2023 17:02:00 +0200 Subject: [PATCH 4/4] Clarify message (again) --- sigridci/sigridci/sigrid_api_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sigridci/sigridci/sigrid_api_client.py b/sigridci/sigridci/sigrid_api_client.py index f024b560..ba1b72fb 100644 --- a/sigridci/sigridci/sigrid_api_client.py +++ b/sigridci/sigridci/sigrid_api_client.py @@ -78,7 +78,7 @@ def retry(self, operation, *, attempts=5, allow404=False, allowEmpty=True): UploadLog.log(f"The system no longer exists (HTTP status {e.code})") sys.exit(1) elif e.code == 502: - UploadLog.log("Something went wrong during analysis on our end (could be an issue in `sigrid.yaml`, please review)") + UploadLog.log("Something went wrong during analysis at SIG (could be an issue in `sigrid.yaml`, please review)") sys.exit(1) elif allow404 and e.code == 404: return False