github-overlord 0.10.0__tar.gz → 0.10.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: github-overlord
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: Automatically merge Dependabot PRs in public repositories
5
5
  Keywords: github,dependabot,automation
6
6
  Author: Michael Bianco
@@ -210,8 +210,8 @@ def handle_stale_dependabot_pr(pr: PullRequest) -> None:
210
210
  Handle a dependabot PR that has been open for at least 30 days and has conflicts
211
211
  """
212
212
 
213
- assert not pr.mergeable
214
- assert pr.mergeable_state == "dirty"
213
+ if not pr.user or pr.user.login != "dependabot[bot]":
214
+ return
215
215
 
216
216
  if pr.body is None:
217
217
  return
@@ -221,25 +221,33 @@ def handle_stale_dependabot_pr(pr: PullRequest) -> None:
221
221
  "PR has disabled automatic rebases, manually commenting", url=pr.html_url
222
222
  )
223
223
 
224
- pr.create_issue_comment("@dependabot rebase")
224
+ try:
225
+ pr.create_issue_comment("@dependabot rebase")
226
+ except GithubException as error:
227
+ log.error(
228
+ "failed to comment on stale PR",
229
+ pr=pr.html_url,
230
+ status=error.status,
231
+ error=error.data.get("message", str(error)),
232
+ )
225
233
 
226
234
 
227
235
  def is_eligible_for_merge(pr: PullRequest) -> bool:
228
- resolve_async_status(pr, "mergeable")
229
-
230
236
  if pr.state == "closed":
231
237
  log.debug("PR is closed", url=pr.html_url)
232
238
  return False
233
239
 
240
+ if not pr.user or pr.user.login != "dependabot[bot]":
241
+ log.debug("PR is not from dependabot", url=pr.html_url)
242
+ return False
243
+
244
+ resolve_async_status(pr, "mergeable")
245
+
234
246
  if not pr.mergeable:
235
247
  log.debug("PR is not mergeable", url=pr.html_url)
236
248
  handle_stale_dependabot_pr(pr)
237
249
  return False
238
250
 
239
- if pr.user.login != "dependabot[bot]":
240
- log.debug("PR is not from dependabot", url=pr.html_url)
241
- return False
242
-
243
251
  last_commit = pr.get_commits().reversed[0]
244
252
  combined_status = last_commit.get_combined_status()
245
253
  status = combined_status.state
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "github-overlord"
3
- version = "0.10.0"
3
+ version = "0.10.1"
4
4
  description = "Automatically merge Dependabot PRs in public repositories"
5
5
  readme = "README.md"
6
6
  keywords = [
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "github-overlord"
3
- version = "0.10.0"
3
+ version = "0.10.1"
4
4
  description = "Automatically merge Dependabot PRs in public repositories"
5
5
  authors = [{ name = "Michael Bianco", email = "mike@mikebian.co" }]
6
6
  readme = "README.md"