This is an automated email from the ASF dual-hosted git repository.
sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git
The following commit(s) were added to refs/heads/main by this push:
new c20d0ff Make key import a little faster to speed up tests
c20d0ff is described below
commit c20d0ff4a524ddaefc09687bc99dd78665a3d2f9
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Jun 27 17:08:04 2025 +0100
Make key import a little faster to speed up tests
---
atr/tasks/checks/signature.py | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/atr/tasks/checks/signature.py b/atr/tasks/checks/signature.py
index 3ee9963..ed972e5 100644
--- a/atr/tasks/checks/signature.py
+++ b/atr/tasks/checks/signature.py
@@ -18,6 +18,7 @@
import asyncio
import logging
import tempfile
+import time
from typing import Any, Final
import gnupg
@@ -126,11 +127,18 @@ def _check_core_logic_verify_signature(
gpg: Final[gnupg.GPG] = gnupg.GPG(gnupghome=gpg_dir)
# Import all PMC public signing keys
- for key in ascii_armored_keys:
- import_result = gpg.import_keys(key)
- if not import_result.fingerprints:
- # TODO: Log warning about invalid key?
- continue
+ start = time.perf_counter_ns()
+ # for key in ascii_armored_keys:
+ # import_result = gpg.import_keys(key)
+ # if not import_result.fingerprints:
+ # # TODO: Log warning about invalid key?
+ # continue
+ # TODO: Will this fail if one key doesn't work?
+ import_result = gpg.import_keys("\n\n".join(ascii_armored_keys))
+ if not import_result.fingerprints:
+ _LOGGER.warning("No fingerprints found after importing keys")
+ end = time.perf_counter_ns()
+ _LOGGER.info(f"Import {len(ascii_armored_keys)} keys took {(end -
start) / 1000000} ms")
verified = gpg.verify_file(sig_file, str(artifact_path))
key_fp = verified.pubkey_fingerprint.lower() if
verified.pubkey_fingerprint else None
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]