Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra log debugging for unable to fetch_commit_yaml #817

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions services/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.ownerid if owner else None,
},
)
return None

Expand Down
Loading