Skip to content

Commit ad89aea

Browse files
maiosgithub-actions[bot]
authored andcommitted
[maps-ios] remove hashlib from maps-ios breaking api check (#10938)
- breaking api check is now simply checking if the list of breakages is empty cc @mapbox/maps-ios GitOrigin-RevId: 72c7acfac0dace374b709564942e691c12461d7d
1 parent 90fe07d commit ad89aea

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

scripts/api-compatibility-check/breaking-api-check.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import shutil
99
import sys
1010
import tempfile
11-
import hashlib
1211

1312

1413
def main():
@@ -420,8 +419,7 @@ def __init__(self, path):
420419
self.path = path
421420
self.breakage = {}
422421
self.__parseReport()
423-
self.hashsum = self.__hashsum()
424-
self.is_good = self.hashsum == self.__empty_report_hashsum()
422+
self.is_good = not self.breakage
425423

426424
def __parseReport(self):
427425
for line in open(self.path).readlines():
@@ -433,18 +431,6 @@ def __parseReport(self):
433431
elif category:
434432
self.breakage[category] = self.breakage.get(category, []) + [line]
435433

436-
def __hashsum(self):
437-
sha_hash = hashlib.sha1()
438-
with open(self.path, "rb") as f:
439-
# Read and update hash string value in blocks of 4K
440-
for byte_block in iter(lambda: f.read(4096), b""):
441-
sha_hash.update(byte_block)
442-
return sha_hash.hexdigest()
443-
444-
def __empty_report_hashsum(self):
445-
# Represents a sha1 hashsum of an empty report (including section names).
446-
return "afd2a1b542b33273920d65821deddc653063c700"
447-
448434
def reportComment(self):
449435
if self.is_good:
450436
return "API compatibility report: ✅"

0 commit comments

Comments
 (0)