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

feat: HogWatcher #23053

Closed
wants to merge 386 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
386 commits
Select commit Hold shift + click to select a range
1deeea6
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
cd9809c
Fixes?
benjackwhite Jun 13, 2024
8981f04
Merge branch 'feat/feedback-loop' into feat/proper-templates
benjackwhite Jun 13, 2024
3ec0fa7
Updated notes
benjackwhite Jun 13, 2024
10c41a3
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
751b1f1
Fix padding
benjackwhite Jun 13, 2024
aacc13a
Merge branch 'feat/proper-templates' of github.com:PostHog/posthog in…
benjackwhite Jun 13, 2024
f6a467a
Fix up
benjackwhite Jun 13, 2024
940b94c
Update query snapshots
github-actions[bot] Jun 13, 2024
378e861
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
d619005
Fix deletions
benjackwhite Jun 13, 2024
84b7681
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
47975de
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
160ecf1
Update query snapshots
github-actions[bot] Jun 13, 2024
22863be
merge
benjackwhite Jun 13, 2024
ccfc296
Merge branch 'feat/proper-templates' into fix/hog-fn-deletions
benjackwhite Jun 13, 2024
d0732dc
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
9c4fc5f
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
22f238d
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
ce7853c
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
0f273ba
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
78a63f1
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
d7db828
Started adding hubspot template
benjackwhite Jun 13, 2024
0a972f5
Merge branch 'master' into fix/hog-fn-deletions
benjackwhite Jun 13, 2024
2ff49ba
Merge branch 'master' into feat/more-templates
benjackwhite Jun 13, 2024
0176a21
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
c647495
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
1683670
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
185623d
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
144eab7
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
5fbb63c
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
a3ed769
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
f3cfa51
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 13, 2024
8c09ffe
fix
benjackwhite Jun 14, 2024
3c0b90a
Merge branch 'master' into fix/hog-fn-deletions
benjackwhite Jun 14, 2024
9bb8f1f
fix: JSON Config interactions (#22945)
benjackwhite Jun 14, 2024
75f211b
Merge branch 'fix/hog-fn-deletions' into feat/more-templates
benjackwhite Jun 14, 2024
2da2efc
Updates
benjackwhite Jun 14, 2024
2e756d7
Fixes
benjackwhite Jun 14, 2024
55894e5
Fixes
benjackwhite Jun 14, 2024
70f4344
Fixes
benjackwhite Jun 14, 2024
32d1bdb
Merge branch 'master' into feat/more-templates
benjackwhite Jun 14, 2024
b64c366
Fix
benjackwhite Jun 14, 2024
e47b110
Fix
benjackwhite Jun 14, 2024
731313e
Fixes
benjackwhite Jun 14, 2024
cee6345
Fix up hubspot template
benjackwhite Jun 14, 2024
6f132e7
Fix customer io
benjackwhite Jun 14, 2024
7cc935f
Fixes
benjackwhite Jun 14, 2024
6efc682
Tidy
benjackwhite Jun 14, 2024
dc90a61
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 14, 2024
014b75a
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 14, 2024
27079fe
Made abstract resizeable codeeditor
benjackwhite Jun 14, 2024
34a2a4e
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 14, 2024
26a52fa
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 14, 2024
b21ccad
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 14, 2024
b2420ff
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 14, 2024
db65eb3
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 14, 2024
421af36
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 14, 2024
e751ecf
Schema editing UX
benjackwhite Jun 14, 2024
f707d82
Added a bunch of controls
benjackwhite Jun 14, 2024
6f991fa
Merge branch 'feat/more-templates' of github.com:PostHog/posthog into…
benjackwhite Jun 14, 2024
febd30e
Fixes
benjackwhite Jun 14, 2024
0cd772b
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 14, 2024
68bc89d
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 14, 2024
2b98038
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 14, 2024
bcc0c30
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 14, 2024
b9a34db
Fixed up a bunch of stuff
benjackwhite Jun 14, 2024
90521af
More tweaks
benjackwhite Jun 14, 2024
711a1f3
Merge branch 'feat/more-templates' of github.com:PostHog/posthog into…
benjackwhite Jun 14, 2024
bd05191
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 14, 2024
b362463
Fix tests
benjackwhite Jun 14, 2024
41ada0b
Fix
benjackwhite Jun 17, 2024
3f9c26f
Fix
benjackwhite Jun 17, 2024
7fe5001
Merge branch 'master' into feat/more-templates
benjackwhite Jun 17, 2024
9e33ad2
Fixes
benjackwhite Jun 17, 2024
2576db8
Fix test
benjackwhite Jun 17, 2024
8a4f0d6
Fix customerio template
benjackwhite Jun 17, 2024
0149a0e
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 17, 2024
e37d48b
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 17, 2024
00d5a34
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 17, 2024
a77b6b3
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 17, 2024
84518c7
Fix up query
benjackwhite Jun 17, 2024
b107914
Added testing panel
benjackwhite Jun 17, 2024
6ff6ba9
Started adding test invocation
benjackwhite Jun 17, 2024
9f352cc
Fixes
benjackwhite Jun 17, 2024
8570bc0
Work done
benjackwhite Jun 17, 2024
ad03f89
Finish adding test info
benjackwhite Jun 17, 2024
9f9e2eb
merge
benjackwhite Jun 17, 2024
65305cf
Fixes
benjackwhite Jun 17, 2024
f29df05
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 17, 2024
67bb8c1
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 17, 2024
9630314
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 17, 2024
54195a4
Fix
benjackwhite Jun 17, 2024
8368f47
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 17, 2024
65d9e36
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 17, 2024
1f29741
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 17, 2024
8240751
Fixed up
benjackwhite Jun 17, 2024
15ae37f
Merge branch 'feat/preview-testing' of github.com:PostHog/posthog int…
benjackwhite Jun 17, 2024
9b09249
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 17, 2024
6252072
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 17, 2024
318db1b
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 17, 2024
37b07a6
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 17, 2024
e80b43c
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 17, 2024
408266c
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 17, 2024
9315d6b
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 17, 2024
fb532ac
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 17, 2024
ec9ef51
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 17, 2024
8f9b3d6
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 17, 2024
41b892b
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 17, 2024
5856021
Fixes
benjackwhite Jun 18, 2024
1256c0c
Fixes
benjackwhite Jun 18, 2024
f3302eb
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
f9e9798
Added testing toggle
benjackwhite Jun 18, 2024
f9e0463
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2024
c450172
Fix
benjackwhite Jun 18, 2024
1fe25dc
Merge branch 'feat/preview-testing' of github.com:PostHog/posthog int…
benjackwhite Jun 18, 2024
c514cc6
Fix?
benjackwhite Jun 18, 2024
fd034bb
Fix tests
benjackwhite Jun 18, 2024
48d1509
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
162efb8
Fix up calls
benjackwhite Jun 18, 2024
0149f82
Added better logging
benjackwhite Jun 18, 2024
952e0f5
Merge branch 'feat/preview-testing' of github.com:PostHog/posthog int…
benjackwhite Jun 18, 2024
0774ea8
Merge branch 'master' into feat/preview-testing
benjackwhite Jun 18, 2024
5c389cf
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2024
e23a9db
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2024
f27ba8f
Updated hogvm
benjackwhite Jun 18, 2024
48c6d21
Fix error checking
benjackwhite Jun 18, 2024
8397491
Fixes
benjackwhite Jun 18, 2024
2504fc6
Moved things around
benjackwhite Jun 18, 2024
ca41a32
Merge branch 'master' into feat/preview-testing
benjackwhite Jun 18, 2024
df6ebb8
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
e166934
Fixes
benjackwhite Jun 18, 2024
64b9cfe
Fixes
benjackwhite Jun 18, 2024
9d3348f
Merge branch 'feat/preview-testing' of github.com:PostHog/posthog int…
benjackwhite Jun 18, 2024
af25948
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
823765b
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2024
2b9dc25
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
4b6b2bc
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2024
30b86fc
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
cbd723a
Fixes
benjackwhite Jun 18, 2024
405aa8d
Merge branch 'feat/preview-testing' of github.com:PostHog/posthog int…
benjackwhite Jun 18, 2024
b380658
Bunch of refactoring
benjackwhite Jun 18, 2024
f84a6cb
Fix sanitization
benjackwhite Jun 18, 2024
f251a65
Add more logs
benjackwhite Jun 18, 2024
b4757a7
Fixes
benjackwhite Jun 18, 2024
f05da96
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
1c8ae00
Fix
benjackwhite Jun 18, 2024
1282b1f
Fix
benjackwhite Jun 18, 2024
6894818
Merge branch 'feat/preview-testing' of github.com:PostHog/posthog int…
benjackwhite Jun 18, 2024
5d24e24
Fix
benjackwhite Jun 18, 2024
800b868
Fix
benjackwhite Jun 18, 2024
2db469f
Fix
benjackwhite Jun 18, 2024
8e7224e
Fixes
benjackwhite Jun 18, 2024
fd47229
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
63baf87
Fixes
benjackwhite Jun 18, 2024
c27ef1c
Merge branch 'feat/preview-testing' of github.com:PostHog/posthog int…
benjackwhite Jun 18, 2024
51509a6
Fix
benjackwhite Jun 18, 2024
fd1dd0c
Fix
benjackwhite Jun 18, 2024
600903e
Fixes
benjackwhite Jun 18, 2024
3e38449
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
39b8ee9
Merge branch 'master' into feat/preview-testing
benjackwhite Jun 18, 2024
159cf37
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
d540710
Update query snapshots
github-actions[bot] Jun 18, 2024
65bd0cb
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2024
1e1b380
Started building overflow consumer
benjackwhite Jun 18, 2024
15a4c74
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2024
f8f8819
Fixes
benjackwhite Jun 18, 2024
01f965d
Merge branch 'feat/preview-testing' of github.com:PostHog/posthog int…
benjackwhite Jun 18, 2024
848d535
Merge branch 'feat/preview-testing' into feat/cdp-overflow-consumer
benjackwhite Jun 18, 2024
afc068e
Fix
benjackwhite Jun 18, 2024
8c3e737
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
6c9ecba
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2024
380d2f6
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
084875e
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2024
3132ecd
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2024
3ab8291
Update UI snapshots for `chromium` (1)
github-actions[bot] Jun 18, 2024
1a88deb
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 18, 2024
72bf3d9
Merge branch 'feat/preview-testing' into feat/cdp-overflow-consumer
benjackwhite Jun 19, 2024
38181e6
Fix
benjackwhite Jun 19, 2024
dd433ad
Added overflow consumer
benjackwhite Jun 19, 2024
c4df05c
Fix
benjackwhite Jun 19, 2024
a10a917
Merge branch 'feat/preview-testing' into feat/cdp-overflow-consumer
benjackwhite Jun 19, 2024
148610b
Added test for slow functions
benjackwhite Jun 19, 2024
e36dd3d
Started adding hogwatcher
benjackwhite Jun 19, 2024
59627a6
Fixes
benjackwhite Jun 19, 2024
05c5745
Added rating
benjackwhite Jun 19, 2024
eb9f806
Fix
benjackwhite Jun 19, 2024
509f875
Remove duplicated types
benjackwhite Jun 20, 2024
39dc0c4
Merge branch 'master' into feat/cdp-overflow-consumer
benjackwhite Jun 20, 2024
c39992d
Fix
benjackwhite Jun 20, 2024
5cb1482
Fixes
benjackwhite Jun 20, 2024
525878f
Fix up
benjackwhite Jun 20, 2024
3118b7d
fix type
benjackwhite Jun 20, 2024
9cce6be
Fixes
benjackwhite Jun 20, 2024
d81468d
Added max log length
benjackwhite Jun 20, 2024
9cea956
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 20, 2024
e019441
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 20, 2024
92d21a2
Updates to hog watcher
benjackwhite Jun 20, 2024
8190802
Merge branch 'feat/cdp-overflow-consumer' of github.com:PostHog/posth…
benjackwhite Jun 20, 2024
75a0f08
Fixed up
benjackwhite Jun 20, 2024
03f9a4c
Fixes
benjackwhite Jun 20, 2024
e0a58bc
Changes
benjackwhite Jun 21, 2024
1d77324
Merge branch 'master' into feat/cdp-overflow-consumer
benjackwhite Jun 21, 2024
1eccd13
Added status indicator
benjackwhite Jun 21, 2024
113af20
Merge branch 'master' into feat/cdp-overflow-consumer
benjackwhite Jun 24, 2024
1bc01ac
Refactor
benjackwhite Jun 24, 2024
860e6ff
Fixes
benjackwhite Jun 24, 2024
562462b
Fix
benjackwhite Jun 24, 2024
fdf505b
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 24, 2024
d5a3b37
Fixes
benjackwhite Jun 24, 2024
6cfd7f6
Merge branch 'master' into feat/cdp-overflow-consumer
benjackwhite Jun 24, 2024
6abdd32
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 24, 2024
d08252e
Pull out key generation
benjackwhite Jun 24, 2024
c9da6cd
Merge branch 'feat/cdp-overflow-consumer' of github.com:PostHog/posth…
benjackwhite Jun 24, 2024
3146aea
Fix
benjackwhite Jun 25, 2024
3676e5d
Fixes
benjackwhite Jun 25, 2024
eba34a9
Fix
benjackwhite Jun 25, 2024
20c21ea
Fixed tests
benjackwhite Jun 25, 2024
8c87b8f
Fixes
benjackwhite Jun 25, 2024
dffe019
Fixes
benjackwhite Jun 25, 2024
8736edc
Fix
benjackwhite Jun 25, 2024
830209e
Fixes
benjackwhite Jun 25, 2024
05042fb
Fixes
benjackwhite Jun 25, 2024
eb82555
Fixes allround
benjackwhite Jun 25, 2024
95049e2
Fix tests
benjackwhite Jun 25, 2024
6aaf765
Fixes
benjackwhite Jun 25, 2024
66f286b
Fixes
benjackwhite Jun 25, 2024
087c0b4
Merge branch 'master' into feat/cdp-overflow-consumer
benjackwhite Jun 25, 2024
d806c87
Better todosBetter todos
benjackwhite Jun 25, 2024
39c921e
fix tests
benjackwhite Jun 25, 2024
a8b5bd7
Added code for handling state changes
benjackwhite Jun 25, 2024
dc9f182
Update query snapshots
github-actions[bot] Jun 25, 2024
4393856
Merge branch 'master' into feat/cdp-overflow-consumer
benjackwhite Jun 26, 2024
bb21849
Update query snapshots
github-actions[bot] Jun 26, 2024
f5cdc96
Update query snapshots
github-actions[bot] Jun 26, 2024
24bb6ae
tidying
benjackwhite Jun 26, 2024
1b7fa28
Fixes
benjackwhite Jun 26, 2024
13ee3ae
feat(cdp): Re-enable functions (#23255)
benjackwhite Jun 27, 2024
d192835
Update query snapshots
github-actions[bot] Jun 27, 2024
1c55e45
Update query snapshots
github-actions[bot] Jun 27, 2024
ff13023
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 27, 2024
14d0d6f
Update query snapshots
github-actions[bot] Jun 27, 2024
44c3c18
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 27, 2024
d82a913
feat(cdp): Add a bunch more metrics counting for hog functions (#23281)
benjackwhite Jun 27, 2024
be772fd
Merge branch 'master' into feat/cdp-overflow-consumer
benjackwhite Jun 27, 2024
912e2d5
Fix
benjackwhite Jun 27, 2024
6b3fce6
Fix up tests
benjackwhite Jun 27, 2024
e2a6d16
Update query snapshots
github-actions[bot] Jun 27, 2024
8572e6d
Update UI snapshots for `chromium` (2)
github-actions[bot] Jun 27, 2024
3a80603
Update query snapshots
github-actions[bot] Jun 27, 2024
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
Prev Previous commit
Next Next commit
Fix up tests
  • Loading branch information
benjackwhite committed Jun 27, 2024
commit 6b3fce613d8d25a3307c46200431048b770c6144
4 changes: 2 additions & 2 deletions posthog/api/test/test_hog_function.py
Original file line number Diff line number Diff line change
@@ -358,8 +358,8 @@ def test_loads_status_when_enabled_and_available(self, *args):
@patch("posthog.permissions.posthoganalytics.feature_enabled", return_value=True)
def test_does_not_crash_when_status_not_available(self, *args):
with patch("posthog.plugins.plugin_server_api.requests.get") as mock_get:
mock_get.return_value.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
mock_get.return_value.json.return_value = {"error": "oh no"}
# Mock the api actually throwing fully
mock_get.side_effect = lambda x: Exception("oh no")

response = self.client.post(
f"/api/projects/{self.team.id}/hog_functions/",
22 changes: 15 additions & 7 deletions posthog/models/hog_functions/hog_function.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,7 @@
from django.db import models
from django.db.models.signals import post_save
from django.dispatch.dispatcher import receiver
import structlog

from posthog.cdp.templates.hog_function_template import HogFunctionTemplate
from posthog.models.action.action import Action
@@ -21,6 +22,8 @@
"states": [],
}

logger = structlog.get_logger(__name__)


class HogFunctionState(enum.Enum):
UNKNOWN = 0
@@ -73,11 +76,13 @@ def status(self) -> dict:
if self._status:
return self._status

res = get_hog_function_status(self.team_id, self.id)
if res.status_code == 200:
status = res.json()
else:
try:
status = DEFAULT_STATE
res = get_hog_function_status(self.team_id, self.id)
if res.status_code == 200:
status = res.json()
except Exception as e:
logger.exception("Failed to fetch function status", error=str(e))

self._status = status

@@ -86,9 +91,12 @@ def status(self) -> dict:
def set_function_status(self, state: int) -> dict:
if not self.enabled:
return self.status
res = patch_hog_function_status(self.team_id, self.id, state)
if res.status_code == 200:
self._status = res.json()
try:
res = patch_hog_function_status(self.team_id, self.id, state)
if res.status_code == 200:
self._status = res.json()
except Exception as e:
logger.exception("Failed to set function status", error=str(e))

return self.status