From 83c23e88617c97ab5d3663ee8895eeda258a1eb9 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 8 May 2026 04:20:00 -0700 Subject: [PATCH] fix(google-workspace): cleanup for --check-live salvage Small follow-ups on top of #19643: - check_auth() takes quiet kwarg to suppress its AUTHENTICATED print when called from check_auth_live(), so the final status line reflects the live-call outcome only. - Drop redundant _ensure_deps() call in check_auth_live() (check_auth() already calls it). - Add AUTHOR_MAP entry for ygd58 so release attribution script works. --- scripts/release.py | 1 + .../productivity/google-workspace/scripts/setup.py | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/release.py b/scripts/release.py index 47b65078dd..c5ceac0a9f 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -47,6 +47,7 @@ AUTHOR_MAP = { "qiyin.zuo@pcitc.com": "qiyin-code", "oleksii.lisikh@gmail.com": "olisikh", "leone.parise@gmail.com": "leoneparise", + "buraysandro9@gmail.com": "ygd58", "teknium@nousresearch.com": "teknium1", "piyushvp1@gmail.com": "thelumiereguy", "harish.kukreja@gmail.com": "counterposition", diff --git a/skills/productivity/google-workspace/scripts/setup.py b/skills/productivity/google-workspace/scripts/setup.py index 8504d180cd..8d798f8a67 100644 --- a/skills/productivity/google-workspace/scripts/setup.py +++ b/skills/productivity/google-workspace/scripts/setup.py @@ -132,9 +132,10 @@ def _ensure_deps(): def check_auth_live(): """Check auth with a real API call to detect disabled_client/account issues.""" - if not check_auth(): + # quiet=True suppresses the "AUTHENTICATED" print from check_auth so the + # final status line reflects the live-call outcome (OK or FAILED). + if not check_auth(quiet=True): return False - _ensure_deps() try: from googleapiclient.discovery import build from google.oauth2.credentials import Credentials @@ -155,7 +156,7 @@ def check_auth_live(): return False -def check_auth(): +def check_auth(quiet: bool = False): """Check if stored credentials are valid. Prints status, exits 0 or 1.""" if not TOKEN_PATH.exists(): print(f"NOT_AUTHENTICATED: No token at {TOKEN_PATH}") @@ -182,7 +183,8 @@ def check_auth(): print(f"AUTHENTICATED (partial): Token valid but missing {len(missing_scopes)} scopes:") for s in missing_scopes: print(f" - {s}") - print(f"AUTHENTICATED: Token valid at {TOKEN_PATH}") + if not quiet: + print(f"AUTHENTICATED: Token valid at {TOKEN_PATH}") return True if creds.expired and creds.refresh_token: @@ -199,7 +201,8 @@ def check_auth(): print(f"AUTHENTICATED (partial): Token refreshed but missing {len(missing_scopes)} scopes:") for s in missing_scopes: print(f" - {s}") - print(f"AUTHENTICATED: Token refreshed at {TOKEN_PATH}") + if not quiet: + print(f"AUTHENTICATED: Token refreshed at {TOKEN_PATH}") return True except Exception as e: err_str = str(e).lower()