-
-
Notifications
You must be signed in to change notification settings - Fork 0
🔖 From prod → Bump version: v1.1.22 into main #129
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
Changes from all commits
91e11ac
fae2cfd
177206d
e671779
3c09a3c
db1fa0a
4d50bee
25b4aa3
a6a31f8
d47c155
4a12a72
ed57c00
29d00b1
aa4e883
94e1efa
fe27bf4
8a29ff7
feba9ef
da08aac
12af143
1e4c34f
fa105a1
36e5723
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| [bumpversion] | ||
| current_version = 1.1.20 | ||
| current_version = 1.1.22 | ||
| commit = True | ||
| tag = False | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,8 @@ | |
| import warnings | ||
| import smtplib | ||
| from email.mime.text import MIMEText | ||
| import json # Added import for JSON handling | ||
| import json | ||
| import re | ||
|
|
||
| from cryptography.hazmat.backends import default_backend | ||
| from cryptography.hazmat.primitives.asymmetric import rsa, padding | ||
|
|
@@ -536,6 +537,19 @@ def get_status(self) -> None: | |
| print("Failed to retrieve status. Check logs for more details.") | ||
|
|
||
|
|
||
| def _resolve_key_pair_name(cert_location: str) -> str: | ||
| """Returns the active key pair name whose year range contains the current year.""" | ||
| current_year = datetime.now().year | ||
| if os.path.isdir(cert_location): | ||
| for fname in os.listdir(cert_location): | ||
| match = re.match(r"^Crypto-Key-Pair-(\d{4})-(\d{4})\.kp$", fname) | ||
| if match: | ||
| start, end = int(match.group(1)), int(match.group(2)) | ||
| if start <= current_year <= end: | ||
| return fname[:-3] | ||
| return f"Crypto-Key-Pair-{current_year}-{current_year + int(CERT_EXPIRATION_YEARS)}" | ||
|
|
||
|
|
||
| def parse_arguments() -> argparse.Namespace: | ||
| """ | ||
| Parses command-line arguments. | ||
|
|
@@ -561,7 +575,7 @@ def parse_arguments() -> argparse.Namespace: | |
| ) | ||
| parser.add_argument( | ||
| "--key-pair-name", | ||
| default=f"Crypto-Key-Pair-{datetime.now().year}", | ||
| default=_resolve_key_pair_name(os.path.join(os.getcwd(), "certs")), | ||
| help="Name of the key pair. Defaults to 'Crypto-Key-Pair-<YEAR>'.", | ||
|
Comment on lines
577
to
579
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When callers provide Useful? React with 👍 / 👎. |
||
| ) | ||
| parser.add_argument( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,3 +4,4 @@ python-dotenv>=0.19.0 | |
| wheel>=0.36.2 | ||
| pytest>=7.0.0 | ||
| pytest-cov>=4.0.0 | ||
| pytest-mock>=3.11.0 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,13 +61,12 @@ def format_yaml_file(file_path): | |
|
|
||
| new_lines.append(line) | ||
|
|
||
| formatted_content = "\n".join(lines) + "\n" | ||
| formatted_content = "\n".join(new_lines) + "\n" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a top-level Useful? React with 👍 / 👎. |
||
|
|
||
| with open(file_path, "w", newline="\n", encoding="utf-8") as f: | ||
| f.write(formatted_content) | ||
|
|
||
| print(f"[FORMAT] Formatted {file_path} with LF line endings.") | ||
| sys.exit(0) | ||
|
|
||
|
|
||
| def main(): | ||
|
|
||
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.
When the first amend is aborted by a modifying hook,
git add -ustages every tracked modification in the worktree, not just files changed by that hook. A developer who invokes this pre-push hook with unrelated unstaged edits will therefore have those edits silently folded into the amended version-bump commit on the retry; stage only the known hook outputs or preserve and restore the preexisting index/worktree state.Useful? React with 👍 / 👎.