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-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new 68116c1  Add debugging for updating a public OpenPGP key
68116c1 is described below

commit 68116c157f3a83cccbc32c6f97bcf31e8d00fb50
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Nov 14 20:19:36 2025 +0000

    Add debugging for updating a public OpenPGP key
---
 scripts/keys_import.py | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/scripts/keys_import.py b/scripts/keys_import.py
index 70f29d3..b21b756 100755
--- a/scripts/keys_import.py
+++ b/scripts/keys_import.py
@@ -31,8 +31,11 @@ sys.path.append(".")
 import atr.config as config
 import atr.db as db
 import atr.storage as storage
+import atr.storage.types as types
 import atr.util as util
 
+TARGET_FINGERPRINT = "63db20dd87e4b34fcd9bbb0da9a14f22f57da182"
+
 
 def get(entry: dict, prop: str) -> str | None:
     if prop in entry:
@@ -47,6 +50,37 @@ def print_and_flush(message: str) -> None:
     sys.stdout.flush()
 
 
+def log_target_key_debug(outcomes, committee_name: str) -> None:
+    target = TARGET_FINGERPRINT.lower()
+    for result in outcomes.results():
+        key_model = result.key_model
+        if key_model.fingerprint == target:
+            status = getattr(result.status, "name", str(result.status))
+            print_and_flush(
+                f"DEBUG fingerprint={target} committee={committee_name} 
status={status} "
+                f"apache_uid={key_model.apache_uid} 
primary_uid={key_model.primary_declared_uid} "
+                f"secondary_uids={key_model.secondary_declared_uids}"
+            )
+    for error in outcomes.errors():
+        fingerprint = None
+        apache_uid = None
+        primary_uid = None
+        secondary_uids = None
+        detail = str(error)
+        if isinstance(error, types.PublicKeyError):
+            key_model = error.key.key_model
+            fingerprint = key_model.fingerprint
+            apache_uid = key_model.apache_uid
+            primary_uid = key_model.primary_declared_uid
+            secondary_uids = key_model.secondary_declared_uids
+            detail = str(error.original_error)
+        if fingerprint == target:
+            print_and_flush(
+                f"DEBUG fingerprint={target} committee={committee_name} 
error={type(error).__name__} "
+                f"apache_uid={apache_uid} primary_uid={primary_uid} 
secondary_uids={secondary_uids} detail={detail}"
+            )
+
+
 @contextlib.contextmanager
 def log_to_file(conf: config.AppConfig):
     log_file_path = os.path.join(conf.STATE_DIR, "keys_import.log")
@@ -111,6 +145,7 @@ async def keys_import(conf: config.AppConfig, asf_uid: str) 
-> None:
             wafa = write.as_foundation_admin(committee_name)
             keys_file_text = content.decode("utf-8", errors="replace")
             outcomes = await wafa.keys.ensure_associated(keys_file_text)
+            log_target_key_debug(outcomes, committee_name)
             yes = outcomes.result_count
             no = outcomes.error_count
             if no:


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to