Skip to content

Commit

Permalink
fix: Fix display of commit in console surprise (#19965)
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes authored Jan 25, 2024
1 parent 1766a8e commit 949916a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
const tags = [
'{% if debug %}DEBUG mode{% elif region %}Region: {{ region }}{% else %}Hobby deployment{% endif %}',
'{% if debug %}Branch: {{ git_branch|default:"unknown" }}{% else %}Commit: {{ git_rev|default:"unknown" }}{% endif %}',
'Come join us! https://posthog.com/careers',
'Join us! https://posthog.com/careers',
]
console.info(
`%c %cPostHog %c— %cIn data we trust\n%c${tags.join('%c %c')}`,
Expand All @@ -18,7 +18,7 @@
'',
'font-style: italic;',
'padding: 0.2em 0.4em; border-radius: 0.5em; background: #1d4aff; color: white;',
'',
'padding-bottom: 0.4em;',
'padding: 0.2em 0.4em; border-radius: 0.5em; background: #f54e00; color: white;',
'',
'padding: 0.2em 0.4em; border-radius: 0.5em; background: #f9bd2b; color: black;'
Expand Down
2 changes: 1 addition & 1 deletion posthog/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ def render_template(
if sentry_environment := os.environ.get("SENTRY_ENVIRONMENT"):
context["sentry_environment"] = sentry_environment

context["git_rev"] = get_git_commit() # Include commit in prod for the `console.info()` message
if settings.DEBUG and not settings.TEST:
context["debug"] = True
context["git_rev"] = get_git_commit()
context["git_branch"] = get_git_branch()

if settings.E2E_TESTING:
Expand Down

0 comments on commit 949916a

Please sign in to comment.