bugbug
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: bugbug | ||
| Version: 0.0.609 | ||
| Version: 0.0.610 | ||
| Summary: ML tools for Mozilla projects | ||
@@ -5,0 +5,0 @@ Author: Marco Castelluccio |
+21
-16
@@ -33,3 +33,3 @@ # -*- coding: utf-8 -*- | ||
| FIXED_COMMENTS_DB = "data/fixed_comments.json" | ||
| FIXED_COMMENTS_ALREADY_ANALYZED_DB = "fixed_comments_already_analyzed.pickle" | ||
| FIXED_COMMENTS_ALREADY_ANALYZED_DB = "fixed_comments_already_analyzed.pickle.zst" | ||
| db.register( | ||
@@ -73,10 +73,14 @@ FIXED_COMMENTS_DB, | ||
| while after is not None: | ||
| out = tenacity.retry( | ||
| for attempt in tenacity.Retrying( | ||
| wait=tenacity.wait_exponential(multiplier=2, min=2), | ||
| stop=tenacity.stop_after_attempt(9), | ||
| )( | ||
| lambda PHABRICATOR_API=PHABRICATOR_API: PHABRICATOR_API.request( | ||
| "transaction.search", objectIdentifier=rev_phid, limit=1000, after=after | ||
| ) | ||
| )() | ||
| ): | ||
| with attempt: | ||
| out = PHABRICATOR_API.request( | ||
| "transaction.search", | ||
| objectIdentifier=rev_phid, | ||
| limit=1000, | ||
| after=after, | ||
| ) | ||
| data += out["data"] | ||
@@ -106,13 +110,14 @@ after = out["cursor"]["after"] | ||
| while after is not None: | ||
| out = tenacity.retry( | ||
| for attempt in tenacity.Retrying( | ||
| wait=tenacity.wait_exponential(multiplier=2, min=2), | ||
| stop=tenacity.stop_after_attempt(9), | ||
| )( | ||
| lambda PHABRICATOR_API=PHABRICATOR_API: PHABRICATOR_API.request( | ||
| "differential.revision.search", | ||
| constraints=constraints, | ||
| attachments={"projects": True, "reviewers": True}, | ||
| after=after, | ||
| ) | ||
| )() | ||
| ): | ||
| with attempt: | ||
| out = PHABRICATOR_API.request( | ||
| "differential.revision.search", | ||
| constraints=constraints, | ||
| attachments={"projects": True, "reviewers": True}, | ||
| after=after, | ||
| ) | ||
| data += out["data"] | ||
@@ -119,0 +124,0 @@ after = out["cursor"]["after"] |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: bugbug | ||
| Version: 0.0.609 | ||
| Version: 0.0.610 | ||
| Summary: ML tools for Mozilla projects | ||
@@ -5,0 +5,0 @@ Author: Marco Castelluccio |
@@ -224,22 +224,23 @@ # -*- coding: utf-8 -*- | ||
| if not os.path.exists(repo_dir): | ||
| tenacity.retry( | ||
| for attempt in tenacity.Retrying( | ||
| wait=tenacity.wait_exponential(multiplier=2, min=2), | ||
| stop=tenacity.stop_after_attempt(7), | ||
| )( | ||
| lambda: subprocess.run( | ||
| ["git", "clone", "--quiet", repo_url, repo_dir], check=True | ||
| ) | ||
| )() | ||
| ): | ||
| with attempt: | ||
| subprocess.run( | ||
| ["git", "clone", "--quiet", repo_url, repo_dir], | ||
| check=True, | ||
| ) | ||
| tenacity.retry( | ||
| for attempt in tenacity.Retrying( | ||
| wait=tenacity.wait_exponential(multiplier=2, min=2), | ||
| stop=tenacity.stop_after_attempt(7), | ||
| )( | ||
| lambda: subprocess.run( | ||
| ["git", "fetch"], | ||
| cwd=repo_dir, | ||
| capture_output=True, | ||
| check=True, | ||
| ) | ||
| )() | ||
| ): | ||
| with attempt: | ||
| subprocess.run( | ||
| ["git", "fetch"], | ||
| cwd=repo_dir, | ||
| capture_output=True, | ||
| check=True, | ||
| ) | ||
@@ -246,0 +247,0 @@ subprocess.run( |
@@ -84,3 +84,6 @@ import argparse | ||
| with open( | ||
| os.path.join("data", phabricator.FIXED_COMMENTS_ALREADY_ANALYZED_DB), "rb" | ||
| os.path.join( | ||
| "data", phabricator.FIXED_COMMENTS_ALREADY_ANALYZED_DB[: -len(".zst")] | ||
| ), | ||
| "rb", | ||
| ) as f: | ||
@@ -182,7 +185,14 @@ already_done_patches = pickle.load(f) | ||
| with open( | ||
| os.path.join("data", phabricator.FIXED_COMMENTS_ALREADY_ANALYZED_DB), "wb" | ||
| os.path.join( | ||
| "data", phabricator.FIXED_COMMENTS_ALREADY_ANALYZED_DB[: -len(".zst")] | ||
| ), | ||
| "wb", | ||
| ) as f: | ||
| pickle.dump(already_done_patches, f) | ||
| zstd_compress(os.path.join("data", phabricator.FIXED_COMMENTS_ALREADY_ANALYZED_DB)) | ||
| zstd_compress( | ||
| os.path.join( | ||
| "data", phabricator.FIXED_COMMENTS_ALREADY_ANALYZED_DB[: -len(".zst")] | ||
| ) | ||
| ) | ||
@@ -189,0 +199,0 @@ |
@@ -81,6 +81,8 @@ # -*- coding: utf-8 -*- | ||
| tenacity.retry( | ||
| for attempt in tenacity.Retrying( | ||
| wait=tenacity.wait_exponential(multiplier=2, min=2), | ||
| stop=tenacity.stop_after_attempt(7), | ||
| )(lambda: subprocess.run(push_args, cwd=self.git_repo_path, check=True))() | ||
| ): | ||
| with attempt: | ||
| subprocess.run(push_args, cwd=self.git_repo_path, check=True) | ||
@@ -100,11 +102,11 @@ # We are not using db.upload as we don't need to upload the git repo. | ||
| def clone_git_repo(self): | ||
| tenacity.retry( | ||
| for attempt in tenacity.Retrying( | ||
| wait=tenacity.wait_exponential(multiplier=2, min=2), | ||
| stop=tenacity.stop_after_attempt(7), | ||
| )( | ||
| lambda: subprocess.run( | ||
| ["git", "clone", self.repo_url, self.git_repo_path], | ||
| check=True, | ||
| ) | ||
| )() | ||
| ): | ||
| with attempt: | ||
| subprocess.run( | ||
| ["git", "clone", self.repo_url, self.git_repo_path], | ||
| check=True, | ||
| ) | ||
@@ -116,14 +118,14 @@ subprocess.run( | ||
| try: | ||
| tenacity.retry( | ||
| for attempt in tenacity.Retrying( | ||
| wait=tenacity.wait_exponential(multiplier=2, min=2), | ||
| stop=tenacity.stop_after_attempt(7), | ||
| reraise=True, | ||
| )( | ||
| lambda: subprocess.run( | ||
| ["git", "pull", "origin", "master"], | ||
| cwd=self.git_repo_path, | ||
| capture_output=True, | ||
| check=True, | ||
| ) | ||
| )() | ||
| ): | ||
| with attempt: | ||
| subprocess.run( | ||
| ["git", "pull", "origin", "master"], | ||
| cwd=self.git_repo_path, | ||
| capture_output=True, | ||
| check=True, | ||
| ) | ||
| except subprocess.CalledProcessError as e: | ||
@@ -130,0 +132,0 @@ # When the repo is empty. |
@@ -87,10 +87,11 @@ # -*- coding: utf-8 -*- | ||
| if not os.path.exists(repo_dir): | ||
| tenacity.retry( | ||
| for attempt in tenacity.Retrying( | ||
| wait=tenacity.wait_exponential(multiplier=2, min=2), | ||
| stop=tenacity.stop_after_attempt(7), | ||
| )( | ||
| lambda: subprocess.run( | ||
| ["git", "clone", "--quiet", repo_url, repo_dir], check=True | ||
| ) | ||
| )() | ||
| ): | ||
| with attempt: | ||
| subprocess.run( | ||
| ["git", "clone", "--quiet", repo_url, repo_dir], | ||
| check=True, | ||
| ) | ||
@@ -101,13 +102,13 @@ logger.info("%s cloned", repo_dir) | ||
| tenacity.retry( | ||
| for attempt in tenacity.Retrying( | ||
| wait=tenacity.wait_exponential(multiplier=2, min=2), | ||
| stop=tenacity.stop_after_attempt(7), | ||
| )( | ||
| lambda: subprocess.run( | ||
| ["git", "fetch", "--quiet"], | ||
| cwd=repo_dir, | ||
| capture_output=True, | ||
| check=True, | ||
| ) | ||
| )() | ||
| ): | ||
| with attempt: | ||
| subprocess.run( | ||
| ["git", "fetch", "--quiet"], | ||
| cwd=repo_dir, | ||
| capture_output=True, | ||
| check=True, | ||
| ) | ||
@@ -114,0 +115,0 @@ logger.info("%s fetched", repo_dir) |
@@ -260,11 +260,11 @@ # -*- coding: utf-8 -*- | ||
| if not os.path.exists(repo_path): | ||
| tenacity.retry( | ||
| for attempt in tenacity.Retrying( | ||
| wait=tenacity.wait_exponential(multiplier=2, min=2), | ||
| stop=tenacity.stop_after_attempt(7), | ||
| )( | ||
| lambda: subprocess.run( | ||
| ["git", "clone", repo_url, repo_path], | ||
| check=True, | ||
| ) | ||
| )() | ||
| ): | ||
| with attempt: | ||
| subprocess.run( | ||
| ["git", "clone", repo_url, repo_path], | ||
| check=True, | ||
| ) | ||
@@ -271,0 +271,0 @@ os.makedirs(os.path.join("data", "ci_failures_diffs"), exist_ok=True) |
+1
-1
@@ -1,1 +0,1 @@ | ||
| 0.0.609 | ||
| 0.0.610 |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
1371462
0.05%22232
0.08%