Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

fix: Retry deleting a branch if GitHub says it's unknown #691

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

timmc-edx
Copy link
Contributor

Try to fix #687 by allowing retries on delete_branch. This may prevent the issue we've seen in create_private_to_public_pr.py where the deletion of a newly created branch occasionally fails with a 404.

Also, avoid collisions in SHA prefixes by increasing from 7 to 12 chars. (See commit message for details.)

We already have 13 ambiguous 7-character abbreviated commit hashes:

```
$ git log --branches --tags --format=format:%H | grep -Po '^.{7}' | sort | uniq -c | grep -v ' 1 ' | wc -l
13
```

(and one collision for 8, even)
Try to fix #687 by allowing
retries on `delete_branch`. This may prevent the issue we've seen in
`create_private_to_public_pr.py` where the deletion of a newly created
branch occasionally fails with a 404.
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (467cdcc) 74.70% compared to head (b35fcf4) 74.70%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #691   +/-   ##
=======================================
  Coverage   74.70%   74.70%           
=======================================
  Files         105      105           
  Lines        8588     8588           
=======================================
  Hits         6416     6416           
  Misses       2172     2172           
Flag Coverage Δ
unittests 74.70% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
tubular/github_api.py 79.25% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@timmc-edx timmc-edx merged commit d38bafe into master Aug 21, 2023
5 checks passed
@timmc-edx timmc-edx deleted the timmc/merge-delete branch August 21, 2023 22:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create_merge_pr_job fails transiently
2 participants