-
-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(commit): add retry_after_failure config option and --no-retry flag #1027
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1027 +/- ##
==========================================
+ Coverage 97.33% 97.48% +0.15%
==========================================
Files 42 55 +13
Lines 2104 2429 +325
==========================================
+ Hits 2048 2368 +320
- Misses 56 61 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…root returns None
…e for other retry test cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ! Thanks (I was going to take a loook at this, so perfect timing 👌🏼)
commitizen/commands/commit.py
Outdated
|
||
def read_backup_message(self) -> str: | ||
def read_backup_message(self) -> Optional[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def read_backup_message(self) -> Optional[str]: | |
def read_backup_message(self) -> str | None: |
commitizen/commands/commit.py
Outdated
@@ -1,12 +1,14 @@ | |||
import contextlib | |||
import os | |||
import tempfile | |||
|
|||
from typing import Optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from typing import Optional |
hooks/post-commit.py
Outdated
print("could not import commitizen:") | ||
print(error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print("could not import commitizen:") | |
print(error) | |
print(f"could not import commitizen:\n{error}") |
commitizen/cz/utils.py
Outdated
return os.path.join( | ||
tempfile.gettempdir(), | ||
"cz.commit%{user}%{project}.backup".format( | ||
user=os.environ.get("USER", ""), | ||
project=project, | ||
), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return os.path.join( | |
tempfile.gettempdir(), | |
"cz.commit%{user}%{project}.backup".format( | |
user=os.environ.get("USER", ""), | |
project=project, | |
), | |
) | |
user = os.environ.get("USER", "") | |
return os.path.join( | |
tempfile.gettempdir(), | |
f"cz.commit%{user}%{project}.backup" | |
) |
Thanks so much for finishing this feature! I just fixed a few style-related nitpicks. Will merge this one once CI passes. |
Closes: #732 |
@Lee-W awesome, thanks a lot. |
Description
This pull request resolves #732 by implementing the requested feature.
Checklist
./scripts/format
and./scripts/test
locally to ensure this change passes linter check and testExpected behavior
See #732 (comment).
Steps to Test This Pull Request
retry_after_failure
Additional context