From 76c012de60d1b3ae34712626b7307da62c0d7853 Mon Sep 17 00:00:00 2001 From: Ben Zhang Date: Sun, 18 Aug 2024 09:55:20 -0700 Subject: [PATCH] Warn that SENTRY_RELEASE is missing when BUILD_INFO is missing When BUILD_INFO is present, we have a valid fallback for SENTRY_RELEASE. --- src/watcloud_utils/sentry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/watcloud_utils/sentry.py b/src/watcloud_utils/sentry.py index ffb575d..8e84aa5 100644 --- a/src/watcloud_utils/sentry.py +++ b/src/watcloud_utils/sentry.py @@ -43,7 +43,7 @@ def set_up_sentry( image_rev = build_labels.get("org.opencontainers.image.revision", "unknown_rev") SENTRY_RELEASE = ( - getvar(Vars.SENTRY_RELEASE, logger=logger) + getvar(Vars.SENTRY_RELEASE, warn_if_missing=not BUILD_INFO, logger=logger) or f"{image_title}:{image_version}@{image_rev}" )