rusackas commented on code in PR #41301:
URL: https://github.com/apache/superset/pull/41301#discussion_r3456950248
##########
superset/utils/version.py:
##########
@@ -57,6 +57,21 @@ def get_version_metadata() -> dict[str, Any]:
return metadata
+def visible_version_metadata(
+ metadata: dict[str, Any], expose_build_details: bool
+) -> dict[str, Any]:
+ """Return version metadata for user-facing surfaces.
+
+ The release ``version_string`` is always included. Precise build details
+ (the git SHA and build number), which let a viewer map the deployment to a
+ specific commit/build, are blanked out unless ``expose_build_details`` is
+ True (e.g. the viewer is an admin or the deployment opted in).
+ """
+ if expose_build_details:
+ return metadata
+ return {**metadata, "version_sha": "", "build_number": None}
Review Comment:
Fair point — `menu_data` only ever reads the three blanked keys, but the
helper claims to redact the SHA, so it should drop `full_sha` too. Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]