From 9c911f700401e63e3729bef5e2134033f85611bc Mon Sep 17 00:00:00 2001 From: JerrySentry Date: Thu, 12 Sep 2024 13:41:19 -0400 Subject: [PATCH 1/2] Add extra log debugging for unable to fetch_commit_yaml --- services/yaml.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/services/yaml.py b/services/yaml.py index edf5faab8b..279d09e0fb 100644 --- a/services/yaml.py +++ b/services/yaml.py @@ -34,14 +34,17 @@ def fetch_commit_yaml(commit: Commit, owner: Owner | None) -> Dict | None: ) yaml_dict = safe_load(yaml_str) return validate_yaml(yaml_dict, show_secrets_for=None) - except Exception: + except Exception as e: # fetching, parsing, validating the yaml inside the commit can # have various exceptions, which we do not care about to get the final # yaml used for a commit, as any error here, the codecov.yaml would not # be used, so we return None here log.warning( - "Was not able to fetch yaml file for commit. Ignoring error and returning None.", - extra={"commit_id": commit.commitid}, + f"Was not able to fetch yaml file for commit. Ignoring error and returning None. Exception: {e}", + extra={ + "commit_id": commit.commitid, + "owner": owner, + }, ) return None From b4052d1eb2d7d292186af11fef5c5ff408cdaaee Mon Sep 17 00:00:00 2001 From: JerrySentry Date: Thu, 12 Sep 2024 13:48:03 -0400 Subject: [PATCH 2/2] check --- services/yaml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/yaml.py b/services/yaml.py index 279d09e0fb..b5579b1f06 100644 --- a/services/yaml.py +++ b/services/yaml.py @@ -43,7 +43,7 @@ def fetch_commit_yaml(commit: Commit, owner: Owner | None) -> Dict | None: f"Was not able to fetch yaml file for commit. Ignoring error and returning None. Exception: {e}", extra={ "commit_id": commit.commitid, - "owner": owner, + "owner": owner.ownerid if owner else None, }, ) return None