mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-06 22:00:40 +08:00
protections
This commit is contained in:
@ -102,10 +102,14 @@ class GithubProvider(GitProvider):
|
|||||||
git_files = context.get("git_files", None)
|
git_files = context.get("git_files", None)
|
||||||
if git_files:
|
if git_files:
|
||||||
return git_files
|
return git_files
|
||||||
|
self.git_files = self.pr.get_files()
|
||||||
|
context["git_files"] = self.git_files
|
||||||
|
return self.git_files
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
if not self.git_files:
|
||||||
self.git_files = context["git_files"] = self.pr.get_files()
|
self.git_files = self.pr.get_files()
|
||||||
return self.git_files
|
return self.git_files
|
||||||
|
|
||||||
|
|
||||||
@retry(exceptions=RateLimitExceeded,
|
@retry(exceptions=RateLimitExceeded,
|
||||||
tries=get_settings().github.ratelimit_retries, delay=2, backoff=2, jitter=(1, 3))
|
tries=get_settings().github.ratelimit_retries, delay=2, backoff=2, jitter=(1, 3))
|
||||||
@ -168,7 +172,11 @@ class GithubProvider(GitProvider):
|
|||||||
diff_files.append(file_patch_canonical_structure)
|
diff_files.append(file_patch_canonical_structure)
|
||||||
|
|
||||||
self.diff_files = diff_files
|
self.diff_files = diff_files
|
||||||
context["diff_files"] = diff_files
|
try:
|
||||||
|
context["diff_files"] = diff_files
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
return diff_files
|
return diff_files
|
||||||
|
|
||||||
except GithubException.RateLimitExceededException as e:
|
except GithubException.RateLimitExceededException as e:
|
||||||
|
@ -22,6 +22,10 @@ def apply_repo_settings(pr_url):
|
|||||||
if not repo_settings:
|
if not repo_settings:
|
||||||
git_provider = get_git_provider()(pr_url)
|
git_provider = get_git_provider()(pr_url)
|
||||||
repo_settings = git_provider.get_repo_settings()
|
repo_settings = git_provider.get_repo_settings()
|
||||||
|
try:
|
||||||
|
context.set("git_files", repo_settings)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
if repo_settings:
|
if repo_settings:
|
||||||
repo_settings_file = None
|
repo_settings_file = None
|
||||||
|
Reference in New Issue
Block a user