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 9a4f76f  Add further debugging when importing a particular OpenPGP key
9a4f76f is described below

commit 9a4f76f5ddd8acbc74872688d26558a6b686b084
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Nov 14 20:43:21 2025 +0000

    Add further debugging when importing a particular OpenPGP key
---
 scripts/keys_import.py | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/scripts/keys_import.py b/scripts/keys_import.py
index b21b756..4709665 100755
--- a/scripts/keys_import.py
+++ b/scripts/keys_import.py
@@ -50,7 +50,7 @@ def print_and_flush(message: str) -> None:
     sys.stdout.flush()
 
 
-def log_target_key_debug(outcomes, committee_name: str) -> None:
+def log_target_key_debug(outcomes, committee_name: str, email_to_uid: 
dict[str, str]) -> None:  # noqa: C901
     target = TARGET_FINGERPRINT.lower()
     for result in outcomes.results():
         key_model = result.key_model
@@ -61,6 +61,22 @@ def log_target_key_debug(outcomes, committee_name: str) -> 
None:
                 f"apache_uid={key_model.apache_uid} 
primary_uid={key_model.primary_declared_uid} "
                 f"secondary_uids={key_model.secondary_declared_uids}"
             )
+            uids: list[str] = []
+            if key_model.primary_declared_uid:
+                uids.append(key_model.primary_declared_uid)
+            if key_model.secondary_declared_uids:
+                uids.extend(key_model.secondary_declared_uids)
+            for uid_value in uids:
+                email = util.email_from_uid(uid_value)
+                ldap_uid = email_to_uid.get(email) if email else None
+                mapped = None
+                if email and email.endswith("@apache.org"):
+                    mapped = email.removesuffix("@apache.org")
+                elif ldap_uid:
+                    mapped = ldap_uid
+                print_and_flush(
+                    f"DEBUG uid={uid_value} extracted_email={email} 
ldap_uid={ldap_uid} mapped_uid={mapped}"
+                )
     for error in outcomes.errors():
         fingerprint = None
         apache_uid = None
@@ -145,7 +161,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)
+            log_target_key_debug(outcomes, committee_name, email_to_uid)
             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